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
QVideoTextureHelper Namespace Reference

Classes

class  QVideoFrameTexturesFromHandlesSet
class  QVideoFrameTexturesFromMemory
class  QVideoFrameTexturesFromRhiTextureArray
struct  SubtitleLayout
struct  TextureDescription
struct  UniformData

Typedefs

using RhiTextureArray = std::array<std::unique_ptr<QRhiTexture>, TextureDescription::maxPlanes>

Functions

bool forceGlTextureExternalOesIsSet ()
void setForceGlTextureExternalOesIsSet (bool isSet)
static bool isRhiTextureFormatSupported (const QRhi *rhi, QRhiTexture::Format formatformat)
QRhiTexture::Format resolvedRhiTextureFormat (QRhiTexture::Format formatformat, QRhi *rhi)
 Returns a QRhiTexture::Format taking into account rhi capabilities and explicitly excluded formats using a chain of pre-defined fallback texture formats. If no valid fallback is determined, will return the format argument.
void setExcludedRhiTextureFormats (QList< QRhiTexture::Format > formatsformats)
const TextureDescription * textureDescription (QVideoFrameFormat::PixelFormat formatformat)
QString vertexShaderFileName (const QVideoFrameFormat &formatformat)
QString fragmentShaderFileName (const QVideoFrameFormat &formatformat, QRhi *rhi, QRhiSwapChain::Format surfaceFormat)
static QMatrix4x4 colorConversionMatrix (const QVideoFrameFormat &formatformat)
static float convertPQFromLinear (float sig)
float convertHLGFromLinear (float sig)
static float convertSDRFromLinear (float sig)
void updateUniformData (QByteArray *dstdst, QRhi *rhi, const QVideoFrameFormat &formatformat, const QVideoFrame &frame, const QMatrix4x4 &transformtransform, float opacity, float maxNits)
QVideoFrameTexturesUPtr createTexturesFromHandles (QVideoFrameTexturesHandlesUPtr handles, QRhi &rhi, QVideoFrameFormat::PixelFormat pixelFormat, QSize sizesize, QVideoFrame sourceFrame={})
 Creates plane textures from texture handles set by the specified rhi. The result owns the specified handles set; the QRhiTexture(s), exposed by the result refer to the owned handles set. If the specified size is empty or pixelFormat is invalid, null is returned.
static std::unique_ptr< QVideoFrameTexturesFromMemory > tryRecycleMemory (QVideoFrameTexturesUPtr oldTextures)
static QVideoFrameTexturesUPtr createTexturesFromMemory (QVideoFrame frame, QRhi &rhi, QRhiResourceUpdateBatch &rub, QVideoFrameTexturesUPtr oldTextures)
QVideoFrameTexturesUPtr createTextures (const QVideoFrame &frame, QRhi &rhi, QRhiResourceUpdateBatch &rub, QVideoFrameTexturesUPtr &oldTextures)
 Creates plane textures from a video frame by the specified rhi. If possible, the function modifies 'oldTextures', which is the texture from the pool, and returns the specified one or a new one with any taken data.

Variables

static const TextureDescription descriptions [QVideoFrameFormat::NPixelFormats]

Typedef Documentation

◆ RhiTextureArray

Function Documentation

◆ colorConversionMatrix()

QMatrix4x4 QVideoTextureHelper::colorConversionMatrix ( const QVideoFrameFormat & format)
static

Definition at line 508 of file qvideotexturehelper.cpp.

◆ convertHLGFromLinear()

float QVideoTextureHelper::convertHLGFromLinear ( float sig)

Definition at line 594 of file qvideotexturehelper.cpp.

Referenced by updateUniformData().

Here is the caller graph for this function:

◆ convertPQFromLinear()

float QVideoTextureHelper::convertPQFromLinear ( float sig)
static

Definition at line 578 of file qvideotexturehelper.cpp.

Referenced by updateUniformData().

Here is the caller graph for this function:

◆ convertSDRFromLinear()

float QVideoTextureHelper::convertSDRFromLinear ( float sig)
static

Definition at line 605 of file qvideotexturehelper.cpp.

Referenced by updateUniformData().

Here is the caller graph for this function:

◆ createTextures()

QVideoFrameTexturesUPtr QVideoTextureHelper::createTextures ( const QVideoFrame & frame,
QRhi & rhi,
QRhiResourceUpdateBatch & rub,
QVideoFrameTexturesUPtr & oldTextures )

Creates plane textures from a video frame by the specified rhi. If possible, the function modifies 'oldTextures', which is the texture from the pool, and returns the specified one or a new one with any taken data.

Definition at line 950 of file qvideotexturehelper.cpp.

◆ createTexturesFromHandles()

QVideoFrameTexturesUPtr QVideoTextureHelper::createTexturesFromHandles ( QVideoFrameTexturesHandlesUPtr texturesSet,
QRhi & rhi,
QVideoFrameFormat::PixelFormat pixelFormat,
QSize size,
QVideoFrame sourceFrame = {} )

Creates plane textures from texture handles set by the specified rhi. The result owns the specified handles set; the QRhiTexture(s), exposed by the result refer to the owned handles set. If the specified size is empty or pixelFormat is invalid, null is returned.

Definition at line 884 of file qvideotexturehelper.cpp.

◆ createTexturesFromMemory()

QVideoFrameTexturesUPtr QVideoTextureHelper::createTexturesFromMemory ( QVideoFrame frame,
QRhi & rhi,
QRhiResourceUpdateBatch & rub,
QVideoFrameTexturesUPtr oldTextures )
static

Definition at line 914 of file qvideotexturehelper.cpp.

◆ forceGlTextureExternalOesIsSet()

bool QVideoTextureHelper::forceGlTextureExternalOesIsSet ( )

Definition at line 40 of file qvideotexturehelper.cpp.

◆ fragmentShaderFileName()

QString QVideoTextureHelper::fragmentShaderFileName ( const QVideoFrameFormat & format,
QRhi * rhi,
QRhiSwapChain::Format surfaceFormat = QRhiSwapChain::SDR )

Definition at line 362 of file qvideotexturehelper.cpp.

◆ isRhiTextureFormatSupported()

bool QVideoTextureHelper::isRhiTextureFormatSupported ( const QRhi * rhi,
QRhiTexture::Format format )
static

Definition at line 259 of file qvideotexturehelper.cpp.

◆ resolvedRhiTextureFormat()

QRhiTexture::Format QVideoTextureHelper::resolvedRhiTextureFormat ( QRhiTexture::Format format,
QRhi * rhi )

Returns a QRhiTexture::Format taking into account rhi capabilities and explicitly excluded formats using a chain of pre-defined fallback texture formats. If no valid fallback is determined, will return the format argument.

Definition at line 302 of file qvideotexturehelper.cpp.

◆ setExcludedRhiTextureFormats()

void QVideoTextureHelper::setExcludedRhiTextureFormats ( QList< QRhiTexture::Format > formats)

Definition at line 340 of file qvideotexturehelper.cpp.

◆ setForceGlTextureExternalOesIsSet()

void QVideoTextureHelper::setForceGlTextureExternalOesIsSet ( bool isSet)

Definition at line 45 of file qvideotexturehelper.cpp.

◆ textureDescription()

const TextureDescription * QVideoTextureHelper::textureDescription ( QVideoFrameFormat::PixelFormat format)

Definition at line 345 of file qvideotexturehelper.cpp.

◆ tryRecycleMemory()

std::unique_ptr< QVideoFrameTexturesFromMemory > QVideoTextureHelper::tryRecycleMemory ( QVideoFrameTexturesUPtr oldTextures)
static

Definition at line 903 of file qvideotexturehelper.cpp.

◆ updateUniformData()

void QVideoTextureHelper::updateUniformData ( QByteArray * dst,
QRhi * rhi,
const QVideoFrameFormat & format,
const QVideoFrame & frame,
const QMatrix4x4 & transform,
float opacity,
float maxNits = 100 )

Definition at line 610 of file qvideotexturehelper.cpp.

References convertHLGFromLinear(), convertPQFromLinear(), and convertSDRFromLinear().

Here is the call graph for this function:

◆ vertexShaderFileName()

QString QVideoTextureHelper::vertexShaderFileName ( const QVideoFrameFormat & format)

Definition at line 350 of file qvideotexturehelper.cpp.

Variable Documentation

◆ descriptions

const TextureDescription QVideoTextureHelper::descriptions
static

Definition at line 50 of file qvideotexturehelper.cpp.