Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QVideoTextureHelper Namespace Reference

Classes

class  QVideoFrameTexturesArray
 
struct  SubtitleLayout
 
struct  TextureDescription
 
struct  UniformData
 

Functions

const TextureDescriptiontextureDescription (QVideoFrameFormat::PixelFormat format)
 
QString vertexShaderFileName (const QVideoFrameFormat &format)
 
QString fragmentShaderFileName (const QVideoFrameFormat &format, QRhiSwapChain::Format surfaceFormat)
 
static QMatrix4x4 colorMatrix (const QVideoFrameFormat &format)
 
static float convertPQFromLinear (float sig)
 
float convertHLGFromLinear (float sig)
 
static float convertSDRFromLinear (float sig)
 
void updateUniformData (QByteArray *dst, const QVideoFrameFormat &format, const QVideoFrame &frame, const QMatrix4x4 &transform, float opacity, float maxNits)
 
static bool updateTextureWithMap (QVideoFrame frame, QRhi *rhi, QRhiResourceUpdateBatch *rub, int plane, std::unique_ptr< QRhiTexture > &tex)
 
static std::unique_ptr< QRhiTexturecreateTextureFromHandle (const QVideoFrame &frame, QRhi *rhi, int plane)
 
static std::unique_ptr< QVideoFrameTexturescreateTexturesFromHandles (const QVideoFrame &frame, QRhi *rhi)
 
std::unique_ptr< QVideoFrameTexturescreateTexturesFromMemory (const QVideoFrame &frame, QRhi *rhi, QRhiResourceUpdateBatch *rub, QVideoFrameTextures *old)
 
std::unique_ptr< QVideoFrameTexturescreateTextures (QVideoFrame &frame, QRhi *rhi, QRhiResourceUpdateBatch *rub, std::unique_ptr< QVideoFrameTextures > &&oldTextures)
 

Variables

static const TextureDescription descriptions [QVideoFrameFormat::NPixelFormats]
 

Function Documentation

◆ colorMatrix()

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

Definition at line 373 of file qvideotexturehelper.cpp.

References QVideoFrameFormat::ColorRange_Full, QVideoFrameFormat::ColorSpace_AdobeRgb, QVideoFrameFormat::ColorSpace_BT2020, QVideoFrameFormat::ColorSpace_BT601, QVideoFrameFormat::ColorSpace_BT709, and QVideoFrameFormat::ColorSpace_Undefined.

Referenced by updateUniformData().

+ Here is the caller graph for this function:

◆ convertHLGFromLinear()

float QVideoTextureHelper::convertHLGFromLinear ( float  sig)

Definition at line 485 of file qvideotexturehelper.cpp.

Referenced by updateUniformData().

+ Here is the caller graph for this function:

◆ convertPQFromLinear()

static float QVideoTextureHelper::convertPQFromLinear ( float  sig)
static

Definition at line 469 of file qvideotexturehelper.cpp.

References c2.

Referenced by updateUniformData().

+ Here is the caller graph for this function:

◆ convertSDRFromLinear()

static float QVideoTextureHelper::convertSDRFromLinear ( float  sig)
static

Definition at line 496 of file qvideotexturehelper.cpp.

Referenced by updateUniformData().

+ Here is the caller graph for this function:

◆ createTextureFromHandle()

static std::unique_ptr< QRhiTexture > QVideoTextureHelper::createTextureFromHandle ( const QVideoFrame frame,
QRhi rhi,
int  plane 
)
static

Definition at line 639 of file qvideotexturehelper.cpp.

References QRhi::backend(), descriptions, QRhiTexture::ExternalOES, fmt, QVideoFrameFormat::Format_SamplerExternalOES, QVideoFrameFormat::Format_SamplerRect, frame, QRhi::newTexture(), QRhi::OpenGLES2, qWarning, QVideoTextureHelper::TextureDescription::sizeScale, QVideoTextureHelper::TextureDescription::textureFormat, QRhiTexture::TextureRectangleGL, QVideoTextureHelper::TextureDescription::SizeScale::x, and QVideoTextureHelper::TextureDescription::SizeScale::y.

Referenced by createTexturesFromHandles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTextures()

Q_MULTIMEDIA_EXPORT std::unique_ptr< QVideoFrameTextures > QVideoTextureHelper::createTextures ( QVideoFrame frame,
QRhi rhi,
QRhiResourceUpdateBatch rub,
std::unique_ptr< QVideoFrameTextures > &&  oldTextures 
)

Definition at line 724 of file qvideotexturehelper.cpp.

References createTexturesFromHandles(), createTexturesFromMemory(), frame, and QAbstractVideoBuffer::mapTextures().

Referenced by QSGVideoMaterial::updateTextures(), and QVideoWindowPrivate::updateTextures().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTexturesFromHandles()

static std::unique_ptr< QVideoFrameTextures > QVideoTextureHelper::createTexturesFromHandles ( const QVideoFrame frame,
QRhi rhi 
)
static

Definition at line 691 of file qvideotexturehelper.cpp.

References createTextureFromHandle(), descriptions, frame, QVideoTextureHelper::TextureDescription::nplanes, and ok.

Referenced by createTextures().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTexturesFromMemory()

std::unique_ptr< QVideoFrameTextures > QVideoTextureHelper::createTexturesFromMemory ( const QVideoFrame frame,
QRhi rhi,
QRhiResourceUpdateBatch rub,
QVideoFrameTextures old 
)

Definition at line 706 of file qvideotexturehelper.cpp.

References descriptions, frame, QVideoTextureHelper::TextureDescription::nplanes, ok, QVideoTextureHelper::QVideoFrameTexturesArray::takeTextures(), and updateTextureWithMap().

Referenced by createTextures().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fragmentShaderFileName()

Q_MULTIMEDIA_EXPORT QString QVideoTextureHelper::fragmentShaderFileName ( const QVideoFrameFormat format,
QRhiSwapChain::Format  surfaceFormat 
)

Definition at line 245 of file qvideotexturehelper.cpp.

References QVideoFrameFormat::ColorTransfer_ST2084, QVideoFrameFormat::ColorTransfer_STD_B67, QVideoFrameFormat::Format_ABGR8888, QVideoFrameFormat::Format_ARGB8888, QVideoFrameFormat::Format_ARGB8888_Premultiplied, QVideoFrameFormat::Format_AYUV, QVideoFrameFormat::Format_AYUV_Premultiplied, QVideoFrameFormat::Format_BGRA8888, QVideoFrameFormat::Format_BGRA8888_Premultiplied, QVideoFrameFormat::Format_BGRX8888, QVideoFrameFormat::Format_IMC1, QVideoFrameFormat::Format_IMC2, QVideoFrameFormat::Format_IMC3, QVideoFrameFormat::Format_IMC4, QVideoFrameFormat::Format_Invalid, QVideoFrameFormat::Format_Jpeg, QVideoFrameFormat::Format_NV12, QVideoFrameFormat::Format_NV21, QVideoFrameFormat::Format_P010, QVideoFrameFormat::Format_P016, QVideoFrameFormat::Format_RGBA8888, QVideoFrameFormat::Format_RGBX8888, QVideoFrameFormat::Format_SamplerExternalOES, QVideoFrameFormat::Format_SamplerRect, QVideoFrameFormat::Format_UYVY, QVideoFrameFormat::Format_XBGR8888, QVideoFrameFormat::Format_XRGB8888, QVideoFrameFormat::Format_Y16, QVideoFrameFormat::Format_Y8, QVideoFrameFormat::Format_YUV420P, QVideoFrameFormat::Format_YUV420P10, QVideoFrameFormat::Format_YUV422P, QVideoFrameFormat::Format_YUYV, QVideoFrameFormat::Format_YV12, QString::fromLatin1(), QRhiSwapChain::HDRExtendedSrgbLinear, Q_FALLTHROUGH, and QStringLiteral.

Referenced by QVideoFrameFormat::fragmentShaderFileName(), QVideoWindowPrivate::setupGraphicsPipeline(), and updateTextures().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ textureDescription()

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

Definition at line 223 of file qvideotexturehelper.cpp.

References descriptions.

Referenced by QVideoFrame::QVideoFrame(), QFFmpegVideoBuffer::map(), QVideoFrameFormat::planeCount(), Q_LOGGING_CATEGORY(), AVFVideoBuffer::textureHandle(), updateTextures(), QVideoWindowPrivate::updateTextures(), and QWasmVideoOutput::videoFrameCallback().

+ Here is the caller graph for this function:

◆ updateTextureWithMap()

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

◆ updateUniformData()

Q_MULTIMEDIA_EXPORT void QVideoTextureHelper::updateUniformData ( QByteArray dst,
const QVideoFrameFormat format,
const QVideoFrame frame,
const QMatrix4x4 transform,
float  opacity,
float  maxNits 
)

Definition at line 501 of file qvideotexturehelper.cpp.

References colorMatrix(), QVideoFrameFormat::ColorTransfer_ST2084, QVideoFrameFormat::ColorTransfer_STD_B67, QMatrix4x4::constData(), convertHLGFromLinear(), convertPQFromLinear(), convertSDRFromLinear(), QVideoFrameFormat::Format_ABGR8888, QVideoFrameFormat::Format_ARGB8888, QVideoFrameFormat::Format_ARGB8888_Premultiplied, QVideoFrameFormat::Format_AYUV, QVideoFrameFormat::Format_AYUV_Premultiplied, QVideoFrameFormat::Format_BGRA8888, QVideoFrameFormat::Format_BGRA8888_Premultiplied, QVideoFrameFormat::Format_BGRX8888, QVideoFrameFormat::Format_IMC1, QVideoFrameFormat::Format_IMC2, QVideoFrameFormat::Format_IMC3, QVideoFrameFormat::Format_IMC4, QVideoFrameFormat::Format_Invalid, QVideoFrameFormat::Format_Jpeg, QVideoFrameFormat::Format_NV12, QVideoFrameFormat::Format_NV21, QVideoFrameFormat::Format_P010, QVideoFrameFormat::Format_P016, QVideoFrameFormat::Format_RGBA8888, QVideoFrameFormat::Format_RGBX8888, QVideoFrameFormat::Format_SamplerExternalOES, QVideoFrameFormat::Format_SamplerRect, QVideoFrameFormat::Format_UYVY, QVideoFrameFormat::Format_XBGR8888, QVideoFrameFormat::Format_XRGB8888, QVideoFrameFormat::Format_Y16, QVideoFrameFormat::Format_Y8, QVideoFrameFormat::Format_YUV420P, QVideoFrameFormat::Format_YUV420P10, QVideoFrameFormat::Format_YUV422P, QVideoFrameFormat::Format_YUYV, QVideoFrameFormat::Format_YV12, frame, QSize::height(), Q_UNUSED, QMatrix4x4::scale(), QWidget::size, and QSize::width().

Referenced by QVideoWindowPrivate::render(), and QVideoFrameFormat::updateUniformData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vertexShaderFileName()

Q_MULTIMEDIA_EXPORT QString QVideoTextureHelper::vertexShaderFileName ( const QVideoFrameFormat format)

Definition at line 228 of file qvideotexturehelper.cpp.

References fmt, QVideoFrameFormat::Format_SamplerExternalOES, QVideoFrameFormat::Format_SamplerRect, Q_UNUSED, and QStringLiteral.

Referenced by QVideoWindowPrivate::setupGraphicsPipeline(), updateTextures(), and QVideoFrameFormat::vertexShaderFileName().

+ Here is the caller graph for this function:

Variable Documentation

◆ descriptions