QAbstractVideoBuffer 類是視頻數據的抽象。 更多...
| 頭: |
#include <QAbstractVideoBuffer>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
|
| qmake: |
QT += multimedia
|
| Since: | Qt 6.8 |
| struct | MapData |
| virtual | ~QAbstractVideoBuffer () |
| virtual QVideoFrameFormat | format () const = 0 |
| virtual QAbstractVideoBuffer::MapData | map (QVideoFrame::MapMode mode ) = 0 |
| virtual void | unmap () |
The QVideoFrame class makes use of a QAbstractVideoBuffer internally to reference a buffer of video data. Creating a subclass of QAbstractVideoBuffer allows 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.
另請參閱 QVideoFrame , QVideoFrameFormat ,和 QVideoFrame::MapMode .
[virtual noexcept]
QAbstractVideoBuffer::
~QAbstractVideoBuffer
()
銷毀視頻緩衝。
[pure virtual]
QVideoFrameFormat
QAbstractVideoBuffer::
format
() const
獲取 QVideoFrameFormat 對於底層視頻緩衝。
The format must be available upon construction of QVideoFrame . QVideoFrame will contain won instance of the given format, that can be detached and modified.
[pure virtual]
QAbstractVideoBuffer::MapData
QAbstractVideoBuffer::
map
(
QVideoFrame::MapMode
mode
)
Maps the planes of a video buffer to memory.
返迴 MapData structure 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.
映射
mode
indicates whether the contents of the mapped memory should be read from and/or written to the buffer. If the map mode includes the
QVideoFrame::ReadOnly
flag the mapped memory will be populated with the content of the buffer when initially mapped. If the map mode includes the
QVideoFrame::WriteOnly
flag 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 unmap function 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 QVideoFrame will calculate additional planes from the specified line stride of the first plane, the frame height, and the data size.
[virtual]
void
QAbstractVideoBuffer::
unmap
()
釋放內存映射通過 map () 函數。
若
MapMode
包括
QVideoFrame::WriteOnly
flag 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
unmap
什麼都不做。
另請參閱 map ().