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>

Enumerations

enum class  UpdateTextureWithMapResult : uint8_t {
  Failed , UpdatedWithDataCopy , UpdatedWithDataReference , Failed ,
  UpdatedWithDataCopy , UpdatedWithDataReference
}
enum class  UpdateTextureWithMapResult : uint8_t {
  Failed , UpdatedWithDataCopy , UpdatedWithDataReference , Failed ,
  UpdatedWithDataCopy , UpdatedWithDataReference
}

Functions

Q_MULTIMEDIA_EXPORT const TextureDescriptiontextureDescription (QVideoFrameFormat::PixelFormat format)
Q_MULTIMEDIA_EXPORT QString vertexShaderFileName (const QVideoFrameFormat &format)
Q_MULTIMEDIA_EXPORT QString fragmentShaderFileName (const QVideoFrameFormat &format, QRhi *rhi, QRhiSwapChain::Format surfaceFormat=QRhiSwapChain::SDR)
Q_MULTIMEDIA_EXPORT void updateUniformData (QByteArray *dst, QRhi *rhi, const QVideoFrameFormat &format, const QVideoFrame &frame, const QMatrix4x4 &transform, float opacity, float maxNits=100)
Q_MULTIMEDIA_EXPORT QVideoFrameTexturesUPtr createTexturesFromHandles (QVideoFrameTexturesHandlesUPtr handles, QRhi &rhi, QVideoFrameFormat::PixelFormat pixelFormat, QSize size)
 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.
Q_MULTIMEDIA_EXPORT 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.
Q_MULTIMEDIA_EXPORT QRhiTexture::Format 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.
Q_MULTIMEDIA_EXPORT void setExcludedRhiTextureFormats (QList< QRhiTexture::Format > formats)
Q_MULTIMEDIA_EXPORT bool forceGlTextureExternalOesIsSet ()
static bool isRhiTextureFormatSupported (const QRhi *rhi, QRhiTexture::Format format)
static QMatrix4x4 colorMatrix (const QVideoFrameFormat &format)
static float convertPQFromLinear (float sig)
float convertHLGFromLinear (float sig)
static float convertSDRFromLinear (float sig)
static UpdateTextureWithMapResult updateTextureWithMap (const QVideoFrame &frame, QRhi &rhi, QRhiResourceUpdateBatch &rub, int plane, std::unique_ptr< QRhiTexture > &tex)
static std::unique_ptr< QRhiTexturecreateTextureFromHandle (QVideoFrameTexturesHandles &texturesSet, QRhi &rhi, QVideoFrameFormat::PixelFormat pixelFormat, QSize size, int plane)
template<typename TexturesType, typename... Args>
static QVideoFrameTexturesUPtr createTexturesArray (QRhi &rhi, QVideoFrameTexturesHandles &texturesSet, QVideoFrameFormat::PixelFormat pixelFormat, QSize size, Args &&...args)
static QVideoFrameTexturesUPtr createTexturesFromMemory (QVideoFrame frame, QRhi &rhi, QRhiResourceUpdateBatch &rub, QVideoFrameTexturesUPtr &oldTextures)

Variables

static const TextureDescription descriptions [QVideoFrameFormat::NPixelFormats]

Typedef Documentation

◆ RhiTextureArray

Enumeration Type Documentation

◆ UpdateTextureWithMapResult [1/2]

Enumerator
Failed 
UpdatedWithDataCopy 
UpdatedWithDataReference 
Failed 
UpdatedWithDataCopy 
UpdatedWithDataReference 

Definition at line 709 of file qvideotexturehelper.cpp.

◆ UpdateTextureWithMapResult [2/2]

Enumerator
Failed 
UpdatedWithDataCopy 
UpdatedWithDataReference 
Failed 
UpdatedWithDataCopy 
UpdatedWithDataReference 

Definition at line 709 of file qvideotexturehelper.cpp.

Function Documentation

◆ colorMatrix()

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

Definition at line 482 of file qvideotexturehelper.cpp.

◆ convertHLGFromLinear()

float QVideoTextureHelper::convertHLGFromLinear ( float sig)

Definition at line 568 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 552 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 579 of file qvideotexturehelper.cpp.

Referenced by updateUniformData().

Here is the caller graph for this function:

◆ createTextureFromHandle()

std::unique_ptr< QRhiTexture > QVideoTextureHelper::createTextureFromHandle ( QVideoFrameTexturesHandles & texturesSet,
QRhi & rhi,
QVideoFrameFormat::PixelFormat pixelFormat,
QSize size,
int plane )
static

Definition at line 787 of file qvideotexturehelper.cpp.

◆ 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 892 of file qvideotexturehelper.cpp.

◆ createTexturesArray()

template<typename TexturesType, typename... Args>
QVideoFrameTexturesUPtr QVideoTextureHelper::createTexturesArray ( QRhi & rhi,
QVideoFrameTexturesHandles & texturesSet,
QVideoFrameFormat::PixelFormat pixelFormat,
QSize size,
Args &&... args )
static

Definition at line 819 of file qvideotexturehelper.cpp.

◆ createTexturesFromHandles()

QVideoFrameTexturesUPtr QVideoTextureHelper::createTexturesFromHandles ( QVideoFrameTexturesHandlesUPtr handles,
QRhi & rhi,
QVideoFrameFormat::PixelFormat pixelFormat,
QSize size )

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 836 of file qvideotexturehelper.cpp.

◆ createTexturesFromMemory()

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

Definition at line 855 of file qvideotexturehelper.cpp.

References Failed, and UpdatedWithDataReference.

◆ forceGlTextureExternalOesIsSet()

bool QVideoTextureHelper::forceGlTextureExternalOesIsSet ( )

Definition at line 23 of file qvideotexturehelper.cpp.

◆ fragmentShaderFileName()

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

Definition at line 341 of file qvideotexturehelper.cpp.

◆ isRhiTextureFormatSupported()

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

Definition at line 238 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 281 of file qvideotexturehelper.cpp.

◆ setExcludedRhiTextureFormats()

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

Definition at line 314 of file qvideotexturehelper.cpp.

◆ textureDescription()

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

Definition at line 319 of file qvideotexturehelper.cpp.

◆ updateTextureWithMap()

UpdateTextureWithMapResult QVideoTextureHelper::updateTextureWithMap ( const QVideoFrame & frame,
QRhi & rhi,
QRhiResourceUpdateBatch & rub,
int plane,
std::unique_ptr< QRhiTexture > & tex )
static

Definition at line 715 of file qvideotexturehelper.cpp.

References Failed, UpdatedWithDataCopy, and UpdatedWithDataReference.

◆ 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 584 of file qvideotexturehelper.cpp.

References convertHLGFromLinear(), convertPQFromLinear(), convertSDRFromLinear(), and QVideoFramePrivate::hasDmaBuf().

Here is the call graph for this function:

◆ vertexShaderFileName()

QString QVideoTextureHelper::vertexShaderFileName ( const QVideoFrameFormat & format)

Definition at line 324 of file qvideotexturehelper.cpp.

Variable Documentation

◆ descriptions

const TextureDescription QVideoTextureHelper::descriptions
static

Definition at line 29 of file qvideotexturehelper.cpp.