PySide6.QtMultimedia.QAbstractVideoBuffer¶
- class QAbstractVideoBuffer¶
- The - QAbstractVideoBufferclass is an abstraction for video data. More_…- Added in version 6.8. - Synopsis¶- Virtual methods¶- Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- The - QVideoFrameclass makes use of a- QAbstractVideoBufferinternally to reference a buffer of video data. Creating a subclass of- QAbstractVideoBufferallows you to construct video frames from preallocated or static buffers. The subclass can contain a hardware buffer, and implement access to the data by mapping the buffer to CPU memory.- The contents of a buffer can be accessed by mapping the buffer to memory using the - map()function, which returns a structure containing information about plane layout of the current video data.- See also - abstract format()¶
- Return type:
 
 - Gets - QVideoFrameFormatof the underlying video buffer.- The format must be available upon construction of - QVideoFrame.- QVideoFramewill contain won instance of the given format, that can be detached and modified.- Maps the planes of a video buffer to memory. - Returns a - MapDatastructure that contains information about the plane layout of the mapped current video data. If the mapping fails, the method returns the default structure. For CPU memory buffers, the data is considered as already mapped, so the function just returns the plane layout of the preallocated underlying data.- The map - modeindicates whether the contents of the mapped memory should be read from and/or written to the buffer. If the map mode includes the- QVideoFrame::ReadOnlyflag the mapped memory will be populated with the content of the buffer when initially mapped. If the map mode includes the- QVideoFrame::WriteOnlyflag the content of the possibly modified mapped memory will be written back to the buffer when unmapped.- When access to the data is no longer needed, the - unmapfunction is called to release the mapped memory and possibly update the buffer contents.- If the format of the video data is multiplanar, the method may map the whole pixel data as a single plane. In this case, mapping a buffer with - QVideoFramewill calculate additional planes from the specified line stride of the first plane, the frame height, and the data size.- unmap()¶
 - Releases the memory mapped by the - map()function.- If the - MapModeincluded the- QVideoFrame::WriteOnlyflag this will write the current content of the mapped memory back to the video frame.- For CPU video buffers, the function may be not overridden. The default implementation of - unmapdoes nothing.- See also - class MapData¶
- Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- PySide6.QtMultimedia.QAbstractVideoBuffer.MapData.planeCount¶
 - PySide6.QtMultimedia.QAbstractVideoBuffer.MapData.bytesPerLine¶
 - PySide6.QtMultimedia.QAbstractVideoBuffer.MapData.data¶
 - PySide6.QtMultimedia.QAbstractVideoBuffer.MapData.dataSize¶