QAbstractVideoBuffer Class

The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia \ingroup multimedia \ingroup multimedia_video. More...

Header: #include <QAbstractVideoBuffer>
Inherited By:

QMemoryVideoBuffer

Public Functions

QAbstractVideoBuffer(QVideoFrame::HandleType type, QRhi *rhi = nullptr)
virtual ~QAbstractVideoBuffer()
QVideoFrame::HandleType handleType() const
QRhi *rhi() const

Detailed Description

\internal

The QVideoFrame class makes use of a QAbstractVideoBuffer internally to reference a buffer of video data. Quite often video data buffers may reside in video memory rather than system memory, and this class provides an abstraction of the location.

In addition, creating a subclass of QAbstractVideoBuffer will allow you to construct video frames from preallocated or static buffers. This caters for cases where the QVideoFrame constructors taking a QByteArray or a QImage do not suffice. This may be necessary when implementing a new hardware accelerated video system, for example.

The contents of a buffer can be accessed by mapping the buffer to memory using the map() function, which returns a pointer to memory containing the contents of the video buffer. The memory returned by map() is released by calling the unmap() function.

The handle() of a buffer may also be used to manipulate its contents using type specific APIs. The type of a buffer's handle is given by the handleType() function.

See also QVideoFrame.

Member Function Documentation

QAbstractVideoBuffer::QAbstractVideoBuffer(QVideoFrame::HandleType type, QRhi *rhi = nullptr)

Constructs an abstract video buffer of the given type.

[virtual noexcept] QAbstractVideoBuffer::~QAbstractVideoBuffer()

Destroys an abstract video buffer.

QVideoFrame::HandleType QAbstractVideoBuffer::handleType() const

Returns the type of a video buffer's handle.

See also handle().

QRhi *QAbstractVideoBuffer::rhi() const

Returns the QRhi instance.