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

Classes

class  QVideoFrameTexturesArray
 
struct  SubtitleLayout
 
struct  TextureDescription
 
struct  UniformData
 

Enumerations

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

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 UpdateTextureWithMapResult updateTextureWithMap (const 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)
 
static std::unique_ptr< QVideoFrameTexturescreateTexturesFromMemory (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]
 

Enumeration Type Documentation

◆ UpdateTextureWithMapResult

Enumerator
Failed 
UpdatedWithDataCopy 
UpdatedWithDataReference 

Definition at line 564 of file qvideotexturehelper.cpp.

Function Documentation

◆ colorMatrix()

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

Definition at line 375 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 461 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 445 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 472 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 630 of file qvideotexturehelper.cpp.

References QRhi::backend(), descriptions, QRhiTexture::ExternalOES, fmt, QVideoFrameFormat::Format_SamplerExternalOES, QVideoFrameFormat::Format_SamplerRect, frame, QRhi::newTexture(), QRhi::OpenGLES2, qWarning, and QRhiTexture::TextureRectangleGL.

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

References createTexturesFromHandles(), createTexturesFromMemory(), and frame.

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

References createTextureFromHandle(), descriptions, frame, and ok.

Referenced by createTextures().

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

◆ createTexturesFromMemory()

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

Definition at line 707 of file qvideotexturehelper.cpp.

References descriptions, Failed, frame, qScopeGuard(), qWarning, QVideoFrame::ReadOnly, QVideoTextureHelper::QVideoFrameTexturesArray::takeTextures(), UpdatedWithDataReference, 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 QSGVideoMaterialRhiShader::QSGVideoMaterialRhiShader(), 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 UpdateTextureWithMapResult QVideoTextureHelper::updateTextureWithMap ( const QVideoFrame & frame,
QRhi * rhi,
QRhiResourceUpdateBatch * rub,
int plane,
std::unique_ptr< QRhiTexture > & tex )
static

Definition at line 570 of file qvideotexturehelper.cpp.

References descriptions, Failed, fmt, QImage::Format_ARGB32, QVideoFrameFormat::Format_Jpeg, frame, QByteArray::fromRawData(), QRhi::newTexture(), Q_ASSERT, qWarning, QRhiTextureSubresourceUploadDescription::setData(), QRhiTextureSubresourceUploadDescription::setDataStride(), QRhiTextureSubresourceUploadDescription::setImage(), UpdatedWithDataCopy, and UpdatedWithDataReference.

Referenced by createTexturesFromMemory().

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

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

References colorMatrix(), QVideoFrameFormat::ColorTransfer_ST2084, QVideoFrameFormat::ColorTransfer_STD_B67, 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, QSize::scale(), QWidget::size, and QSize::width().

Referenced by QVideoWindowPrivate::render(), QVideoFrameFormat::updateUniformData(), and QSGVideoMaterialRhiShader::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 QSGVideoMaterialRhiShader::QSGVideoMaterialRhiShader(), QVideoWindowPrivate::setupGraphicsPipeline(), updateTextures(), and QVideoFrameFormat::vertexShaderFileName().

+ Here is the caller graph for this function:

Variable Documentation

◆ descriptions