![]() |
Qt 6.x
The Qt SDK
|
#include <qgstvideobuffer_p.h>
Public Member Functions | |
QGstVideoBuffer (GstBuffer *buffer, const GstVideoInfo &info, QGstreamerVideoSink *sink, const QVideoFrameFormat &frameFormat, QGstCaps::MemoryFormat format) | |
QGstVideoBuffer (GstBuffer *buffer, const QVideoFrameFormat &format, const GstVideoInfo &info) | |
~QGstVideoBuffer () | |
GstBuffer * | buffer () const |
QVideoFrame::MapMode | mapMode () const override |
MapData | map (QVideoFrame::MapMode mode) override |
Independently maps the planes of a video buffer to memory. | |
void | unmap () override |
Releases the memory mapped by the map() function. | |
virtual std::unique_ptr< QVideoFrameTextures > | mapTextures (QRhi *) override |
![]() | |
QAbstractVideoBuffer (QVideoFrame::HandleType type, QRhi *rhi=nullptr) | |
Constructs an abstract video buffer of the given type. | |
virtual | ~QAbstractVideoBuffer () |
Destroys an abstract video buffer. | |
QVideoFrame::HandleType | handleType () const |
Returns the type of a video buffer's handle. | |
QRhi * | rhi () const |
Returns the QRhi instance. | |
virtual QVideoFrame::MapMode | mapMode () const =0 |
virtual MapData | map (QVideoFrame::MapMode mode)=0 |
Independently maps the planes of a video buffer to memory. | |
virtual void | unmap ()=0 |
Releases the memory mapped by the map() function. | |
virtual std::unique_ptr< QVideoFrameTextures > | mapTextures (QRhi *) |
virtual quint64 | textureHandle (int) const |
Returns a texture handle to the data buffer. | |
virtual QMatrix4x4 | externalTextureMatrix () const |
Additional Inherited Members | |
![]() | |
QVideoFrame::HandleType | m_type |
QRhi * | m_rhi = nullptr |
Definition at line 30 of file qgstvideobuffer_p.h.
QGstVideoBuffer::QGstVideoBuffer | ( | GstBuffer * | buffer, |
const GstVideoInfo & | info, | ||
QGstreamerVideoSink * | sink, | ||
const QVideoFrameFormat & | frameFormat, | ||
QGstCaps::MemoryFormat | format | ||
) |
Definition at line 53 of file qgstvideobuffer.cpp.
|
inline |
Definition at line 36 of file qgstvideobuffer_p.h.
QGstVideoBuffer::~QGstVideoBuffer | ( | ) |
Definition at line 71 of file qgstvideobuffer.cpp.
References unmap().
|
inline |
Definition at line 41 of file qgstvideobuffer_p.h.
|
overridevirtual |
Independently maps the planes of a video buffer to memory.
The map 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 be sure to call the unmap() function to release the mapped memory and possibly update the buffer contents.
Returns the number of planes in the mapped video data. For each plane the line stride of that plane will be returned in bytesPerLine, and a pointer to the plane data will be returned in data. The accumulative size of the mapped data is returned in numBytes.
Not all buffer implementations will map more than the first plane, if this returns a single plane for a planar format the additional planes will have to be calculated from the line stride of the first plane and the frame height. Mapping a buffer with QVideoFrame will do this for you.
To implement this function create a derivative of QAbstractPlanarVideoBuffer and implement its map function instance instead.
Implements QAbstractVideoBuffer.
Definition at line 84 of file qgstvideobuffer.cpp.
References QAbstractVideoBuffer::MapData::bytesPerLine, QAbstractVideoBuffer::MapData::data, i, mapData(), QVideoFrame::NotMapped, QAbstractVideoBuffer::MapData::nPlanes, QVideoFrame::ReadOnly, QAbstractVideoBuffer::MapData::size, and QVideoFrame::WriteOnly.
|
overridevirtual |
Implements QAbstractVideoBuffer.
Definition at line 79 of file qgstvideobuffer.cpp.
|
overridevirtual |
Reimplemented from QAbstractVideoBuffer.
Definition at line 368 of file qgstvideobuffer.cpp.
References QGstCaps::DMABuf, QGstCaps::GLTexture, QVideoFrameFormat::pixelFormat(), and QAbstractVideoBuffer::rhi().
|
overridevirtual |
Releases the memory mapped by the map() function.
If the \l {QVideoFrame::MapMode}{MapMode} included the QVideoFrame::WriteOnly
flag this will write the current content of the mapped memory back to the video frame.
Implements QAbstractVideoBuffer.
Definition at line 116 of file qgstvideobuffer.cpp.
References QVideoFrame::NotMapped.
Referenced by ~QGstVideoBuffer().