Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
AVFVideoBuffer Class Reference

#include <avfvideobuffer_p.h>

+ Inheritance diagram for AVFVideoBuffer:
+ Collaboration diagram for AVFVideoBuffer:

Public Member Functions

 AVFVideoBuffer (AVFVideoSinkInterface *sink, CVImageBufferRef buffer)
 
 ~AVFVideoBuffer ()
 
QVideoFrame::MapMode mapMode () const
 
MapData map (QVideoFrame::MapMode mode)
 Independently maps the planes of a video buffer to memory.
 
void unmap ()
 Releases the memory mapped by the map() function.
 
virtual quint64 textureHandle (QRhi *, int plane) const
 Returns a texture handle to the data buffer.
 
QVideoFrameFormat videoFormat () const
 
- 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 std::unique_ptr< QVideoFrameTexturesmapTextures (QRhi *)
 
virtual QMatrix4x4 externalTextureMatrix () const
 
virtual QByteArray underlyingByteArray (int) const
 

Additional Inherited Members

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

Detailed Description

Definition at line 34 of file avfvideobuffer_p.h.

Constructor & Destructor Documentation

◆ AVFVideoBuffer()

QT_USE_NAMESPACE AVFVideoBuffer::AVFVideoBuffer ( AVFVideoSinkInterface * sink,
CVImageBufferRef buffer )

Definition at line 18 of file avfvideobuffer.mm.

References QRhi::OpenGLES2, and QAVFHelpers::videoFormatForImageBuffer().

+ Here is the call graph for this function:

◆ ~AVFVideoBuffer()

AVFVideoBuffer::~AVFVideoBuffer ( )

Definition at line 30 of file avfvideobuffer.mm.

References i, and unmap().

+ Here is the call graph for this function:

Member Function Documentation

◆ map()

AVFVideoBuffer::MapData AVFVideoBuffer::map ( QVideoFrame::MapMode mode)
virtual

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 46 of file avfvideobuffer.mm.

References i, mapData(), QVideoFrame::NotMapped, Q_ASSERT, and QVideoFrame::ReadOnly.

+ Here is the call graph for this function:

◆ mapMode()

QVideoFrame::MapMode AVFVideoBuffer::mapMode ( ) const
inlinevirtual

Implements QAbstractVideoBuffer.

Definition at line 40 of file avfvideobuffer_p.h.

◆ textureHandle()

quint64 AVFVideoBuffer::textureHandle ( QRhi * rhi,
int plane ) const
virtual

◆ unmap()

void AVFVideoBuffer::unmap ( )
virtual

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 79 of file avfvideobuffer.mm.

References QVideoFrame::NotMapped, and QVideoFrame::ReadOnly.

Referenced by ~AVFVideoBuffer().

+ Here is the caller graph for this function:

◆ videoFormat()

QVideoFrameFormat AVFVideoBuffer::videoFormat ( ) const
inline

Definition at line 46 of file avfvideobuffer_p.h.


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