Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base > Class Template Referencefinal

#include <qmaterializingvideobuffer_p.h>

Inheritance diagram for QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >:
Collaboration diagram for QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >:

Public Types

using State = MaterializableSource<Source>
using SlotType = typename Registry::SlotType
using Lease = typename Registry::Lease

Public Member Functions

template<typename... BaseArgs>
 MaterializingVideoBuffer (Lease lease, Source sourcesource, QVideoFrameFormat formatformat={}, BaseArgs &&...baseArgs)
QAbstractVideoBuffer::MapData map (QVideoFrame::MapMode modemode) override
 Maps the planes of a video buffer to memory.
void unmap () override
 Releases the memory mapped by the map() function.
State & state () noexcept
Public Member Functions inherited from QHwVideoBuffer
 QHwVideoBuffer ()
 ~QHwVideoBuffer () override
virtual QRhi * associatedCurrentThreadRhi () const
QVideoFrameFormat format () const final
 Gets \l QVideoFrameFormat of the underlying video buffer.
virtual QMatrix4x4 externalTextureMatrix () const
virtual QVideoFrameTexturesUPtr mapTextures (QRhi &rhi, QVideoFrameTexturesUPtr &)
virtual QVideoFrameTexturesUPtr mapTextures (QRhi &)
virtual bool isDmaBuf () const
Public Member Functions inherited from QAbstractVideoBuffer
virtual ~QAbstractVideoBuffer ()
 \variable QAbstractVideoBuffer::MapData::planeCount
Public Member Functions inherited from QVideoFrameTexturesHandles
virtual ~QVideoFrameTexturesHandles ()
virtual quint64 textureHandle (QRhi &, int)
virtual std::optional< QVideoFrameFormat::PixelFormat > texturePixelFormat () const

Static Public Member Functions

template<typename SlotArg, typename... BaseArgs>
static std::unique_ptr< MaterializingVideoBuffer > tryCreate (Registry &registry, SlotArg &&slot, Source sourcesource, QVideoFrameFormat formatformat={}, BaseArgs &&...baseArgs)
template<typename... BaseArgs>
static std::unique_ptr< QAbstractVideoBuffer > wrapOrMaterialize (Registry &registry, SlotType slot, Source sourcesource, QVideoFrameFormat formatformat={}, BaseArgs &&...baseArgs)

Detailed Description

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
class QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >

Definition at line 256 of file qmaterializingvideobuffer_p.h.

Member Typedef Documentation

◆ Lease

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
using QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::Lease = typename Registry::Lease

Definition at line 263 of file qmaterializingvideobuffer_p.h.

◆ SlotType

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
using QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::SlotType = typename Registry::SlotType

Definition at line 262 of file qmaterializingvideobuffer_p.h.

◆ State

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
using QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::State = MaterializableSource<Source>

Definition at line 261 of file qmaterializingvideobuffer_p.h.

Constructor & Destructor Documentation

◆ MaterializingVideoBuffer()

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
template<typename... BaseArgs>
QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::MaterializingVideoBuffer ( Lease lease,
Source source,
QVideoFrameFormat format = {},
BaseArgs &&... baseArgs )
inline

Member Function Documentation

◆ map()

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
QAbstractVideoBuffer::MapData QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::map ( QVideoFrame::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 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 \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 294 of file qmaterializingvideobuffer_p.h.

◆ state()

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
State & QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::state ( )
inlinenoexcept

Definition at line 300 of file qmaterializingvideobuffer_p.h.

◆ tryCreate()

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
template<typename SlotArg, typename... BaseArgs>
std::unique_ptr< MaterializingVideoBuffer > QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::tryCreate ( Registry & registry,
SlotArg && slot,
Source source,
QVideoFrameFormat format = {},
BaseArgs &&... baseArgs )
inlinestatic

Definition at line 268 of file qmaterializingvideobuffer_p.h.

◆ unmap()

template<typename Source, typename Registry, typename Base = QHwVideoBuffer>
void QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::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.

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 298 of file qmaterializingvideobuffer_p.h.

◆ wrapOrMaterialize()

template<typename Source, typename Registry, typename Base>
template<typename... BaseArgs>
std::unique_ptr< QAbstractVideoBuffer > QtMultimediaPrivate::MaterializingVideoBuffer< Source, Registry, Base >::wrapOrMaterialize ( Registry & registry,
SlotType slot,
Source source,
QVideoFrameFormat format = {},
BaseArgs &&... baseArgs )
inlinestatic

Definition at line 350 of file qmaterializingvideobuffer_p.h.


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