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
IMFSampleVideoBuffer Class Reference
+ Inheritance diagram for IMFSampleVideoBuffer:
+ Collaboration diagram for IMFSampleVideoBuffer:

Public Member Functions

 IMFSampleVideoBuffer (ComPtr< IDirect3DDevice9Ex > device, const ComPtr< IMFSample > &sample, QRhi *rhi, QVideoFrame::HandleType type=QVideoFrame::NoHandle)
 
 ~IMFSampleVideoBuffer () override
 
MapData map (QtVideo::MapMode mode) override
 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 QHwVideoBuffer
 QHwVideoBuffer (QVideoFrame::HandleType type, QRhi *rhi=nullptr)
 
 ~QHwVideoBuffer () override
 
QVideoFrame::HandleType handleType () const
 
QRhirhi () const
 
QVideoFrameFormat format () const override
 Gets \l QVideoFrameFormat of the underlying video buffer.
 
virtual std::unique_ptr< QVideoFrameTexturesmapTextures (QRhi *)
 
virtual quint64 textureHandle (QRhi *, int) const
 
virtual QMatrix4x4 externalTextureMatrix () const
 
- Public Member Functions inherited from QAbstractVideoBuffer
virtual ~QAbstractVideoBuffer ()
 \variable QAbstractVideoBuffer::MapData::planeCount
 

Protected Attributes

ComPtr< IDirect3DDevice9Ex > m_device
 
ComPtr< IMFSample > m_sample
 
- Protected Attributes inherited from QHwVideoBuffer
QVideoFrame::HandleType m_type
 
QRhim_rhi = nullptr
 

Detailed Description

Definition at line 30 of file evrd3dpresentengine.cpp.

Constructor & Destructor Documentation

◆ IMFSampleVideoBuffer()

IMFSampleVideoBuffer::IMFSampleVideoBuffer ( ComPtr< IDirect3DDevice9Ex > device,
const ComPtr< IMFSample > & sample,
QRhi * rhi,
QVideoFrame::HandleType type = QVideoFrame::NoHandle )
inline

Definition at line 33 of file evrd3dpresentengine.cpp.

◆ ~IMFSampleVideoBuffer()

IMFSampleVideoBuffer::~IMFSampleVideoBuffer ( )
inlineoverride

Definition at line 42 of file evrd3dpresentengine.cpp.

References QtVideo::NotMapped.

Member Function Documentation

◆ map()

MapData IMFSampleVideoBuffer::map ( QtVideo::MapMode mode)
inlineoverridevirtual

Maps the planes of a video buffer to memory.

Returns a \l 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.

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 QtVideo::MapMode::WriteOnly flag, the content of the possibly modified mapped memory is expected to be written back to the buffer when unmapped.

When access to the data is no longer needed, the \l 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 \l QVideoFrame will calculate additional planes from the specified line stride of the first plane, the frame height, and the data size.

Implements QAbstractVideoBuffer.

Definition at line 48 of file evrd3dpresentengine.cpp.

References m_device, m_sample, mapData(), QtVideo::NotMapped, QtVideo::ReadOnly, and rect.

+ Here is the call graph for this function:

◆ unmap()

void IMFSampleVideoBuffer::unmap ( )
inlineoverridevirtual

Releases the memory mapped by the map() function.

If the \l {QtVideo::MapMode}{MapMode} included the QtVideo::MapMode::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 does nothing.

See also
map()

Reimplemented from QAbstractVideoBuffer.

Definition at line 95 of file evrd3dpresentengine.cpp.

References QtVideo::NotMapped.

Member Data Documentation

◆ m_device

ComPtr<IDirect3DDevice9Ex> IMFSampleVideoBuffer::m_device
protected

Definition at line 106 of file evrd3dpresentengine.cpp.

Referenced by map().

◆ m_sample

ComPtr<IMFSample> IMFSampleVideoBuffer::m_sample
protected

Definition at line 107 of file evrd3dpresentengine.cpp.

Referenced by map().


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