QVideoFrameclass makes use of a
QAbstractVideoBufferinternally 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
QAbstractVideoBufferwill allow you to construct video frames from preallocated or static buffers, in cases where the
QVideoFrameconstructors taking a
QImagedo 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
- class PySide2.QtMultimedia.QAbstractVideoBuffer(type)¶
- param type:
Constructs an abstract video buffer of the given
Identifies the type of a video buffers handle.
The buffer has no handle, its data can only be accessed by mapping the buffer.
The handle of the buffer is an OpenGL texture ID.
The handle contains pointer to shared memory XVideo image.
The handle contains pointer to macOS CIImage.
The handle of the buffer is a
The handle of the buffer is an EGLImageKHR.
Start value for user defined handle types.
Enumerates how a video buffer’s data is mapped to system memory.
The video buffer is not mapped to memory.
The mapped memory is populated with data from the video buffer when mapped, but the content of the mapped memory may be discarded when unmapped.
The mapped memory is uninitialized when mapped, but the possibly modified content will be used to populate the video buffer when unmapped.
The mapped memory is populated with data from the video buffer, and the video buffer is repopulated with the content of the mapped memory when it is unmapped.
- Return type:
Returns a type specific handle to the data buffer.
The type of the handle is given by
- Return type:
Returns the type of a video buffer’s handle.
- Return type:
Returns the mode a video buffer is mapped in.
Releases the video buffer.
QVideoFramecalls when the buffer is not used any more and can be destroyed or returned to the buffer pool.
The default implementation deletes the buffer instance.
Releases the memory mapped by the
QAbstractVideoBuffer::WriteOnlyflag this will write the current content of the mapped memory back to the video frame.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.