Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QV4L2VideoBuffer Class Reference
+ Inheritance diagram for QV4L2VideoBuffer:
+ Collaboration diagram for QV4L2VideoBuffer:

Public Member Functions

 QV4L2VideoBuffer (QV4L2CameraBuffers *d, int index)
 
 ~QV4L2VideoBuffer ()
 
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.
 
- Public Member Functions inherited from QAbstractVideoBuffer
 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.
 
QRhirhi () 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< QVideoFrameTexturesmapTextures (QRhi *)
 
virtual quint64 textureHandle (int) const
 Returns a texture handle to the data buffer.
 
virtual QMatrix4x4 externalTextureMatrix () const
 

Public Attributes

QVideoFrame::MapMode m_mode = QVideoFrame::NotMapped
 
MapData data
 
int index = 0
 
QExplicitlySharedDataPointer< QV4L2CameraBuffersd
 

Additional Inherited Members

- Protected Attributes inherited from QAbstractVideoBuffer
QVideoFrame::HandleType m_type
 
QRhim_rhi = nullptr
 

Detailed Description

Definition at line 218 of file qv4l2camera.cpp.

Constructor & Destructor Documentation

◆ QV4L2VideoBuffer()

QV4L2VideoBuffer::QV4L2VideoBuffer ( QV4L2CameraBuffers d,
int  index 
)
inline

Definition at line 221 of file qv4l2camera.cpp.

◆ ~QV4L2VideoBuffer()

QV4L2VideoBuffer::~QV4L2VideoBuffer ( )
inline

Definition at line 226 of file qv4l2camera.cpp.

References d, and QV4L2CameraBuffers::release().

+ Here is the call graph for this function:

Member Function Documentation

◆ map()

MapData QV4L2VideoBuffer::map ( QVideoFrame::MapMode  mode)
inlineoverridevirtual

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.

Since
5.4

Implements QAbstractVideoBuffer.

Definition at line 232 of file qv4l2camera.cpp.

References d, data, m_mode, and QV4L2CameraBuffers::v4l2FileDescriptor.

◆ mapMode()

QVideoFrame::MapMode QV4L2VideoBuffer::mapMode ( ) const
inlineoverridevirtual

Implements QAbstractVideoBuffer.

Definition at line 231 of file qv4l2camera.cpp.

References m_mode.

◆ unmap()

void QV4L2VideoBuffer::unmap ( )
inlineoverridevirtual

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.

See also
map()

Implements QAbstractVideoBuffer.

Definition at line 236 of file qv4l2camera.cpp.

References m_mode, and QVideoFrame::NotMapped.

Member Data Documentation

◆ d

Definition at line 243 of file qv4l2camera.cpp.

Referenced by ~QV4L2VideoBuffer(), and map().

◆ data

MapData QV4L2VideoBuffer::data

Definition at line 241 of file qv4l2camera.cpp.

Referenced by map().

◆ index

int QV4L2VideoBuffer::index = 0

Definition at line 242 of file qv4l2camera.cpp.

◆ m_mode

QVideoFrame::MapMode QV4L2VideoBuffer::m_mode = QVideoFrame::NotMapped

Definition at line 240 of file qv4l2camera.cpp.

Referenced by map(), mapMode(), and unmap().


The documentation for this class was generated from the following file: