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
QVideoWindowPrivate Class Reference

#include <qvideowindow_p.h>

+ Collaboration diagram for QVideoWindowPrivate:

Public Types

enum  { NVideoFrameSlots = 4 }
 

Public Member Functions

 QVideoWindowPrivate (QVideoWindow *q)
 
 ~QVideoWindowPrivate ()
 
bool canRender () const
 
QRhirhi () const
 
void init ()
 
void render ()
 
void initRhi ()
 
void resizeSwapChain ()
 
void releaseSwapChain ()
 
void updateTextures (QRhiResourceUpdateBatch *rub)
 
void updateSubtitle (QRhiResourceUpdateBatch *rub, const QSize &frameSize)
 
void setupGraphicsPipeline (QRhiGraphicsPipeline *pipeline, QRhiShaderResourceBindings *bindings, const QVideoFrameFormat &fmt)
 

Public Attributes

QVideoWindowq = nullptr
 
Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio
 
QBackingStorebackingStore = nullptr
 
std::unique_ptr< QRhim_rhi
 
std::unique_ptr< QRhiSwapChainm_swapChain
 
std::unique_ptr< QRhiRenderPassDescriptorm_renderPass
 
std::unique_ptr< QRhiBufferm_vertexBuf
 
bool m_vertexBufReady = false
 
std::unique_ptr< QRhiBufferm_uniformBuf
 
std::unique_ptr< QVideoFrameTexturesm_frameTextures
 
std::unique_ptr< QRhiSamplerm_textureSampler
 
std::unique_ptr< QRhiShaderResourceBindingsm_shaderResourceBindings
 
std::unique_ptr< QRhiGraphicsPipelinem_graphicsPipeline
 
std::unique_ptr< QRhiTexturem_subtitleTexture
 
std::unique_ptr< QRhiShaderResourceBindingsm_subtitleResourceBindings
 
std::unique_ptr< QRhiGraphicsPipelinem_subtitlePipeline
 
std::unique_ptr< QRhiBufferm_subtitleUniformBuf
 
std::unique_ptr< QVideoSinkm_sink
 
QRhi::Implementation m_graphicsApi = QRhi::Null
 
QVideoFrame m_currentFrame
 
QVideoTextureHelper::SubtitleLayout m_subtitleLayout
 
QVideoFrame m_videoFrameSlots [NVideoFrameSlots]
 
bool initialized = false
 
bool isExposed = false
 
bool m_useRhi = true
 
bool m_hasSwapChain = false
 
bool m_texturesDirty = true
 
bool m_subtitleDirty = false
 
bool m_hasSubtitle = false
 
QVideoFrameFormat format
 

Detailed Description

Definition at line 31 of file qvideowindow_p.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NVideoFrameSlots 

Definition at line 82 of file qvideowindow_p.h.

Constructor & Destructor Documentation

◆ QVideoWindowPrivate()

◆ ~QVideoWindowPrivate()

QVideoWindowPrivate::~QVideoWindowPrivate ( )

Definition at line 71 of file qvideowindow.cpp.

References QObject::disconnect(), m_sink, and QVideoSink::videoFrameChanged().

+ Here is the call graph for this function:

Member Function Documentation

◆ canRender()

bool QVideoWindowPrivate::canRender ( ) const
inline

Definition at line 35 of file qvideowindow_p.h.

References m_useRhi.

◆ init()

void QVideoWindowPrivate::init ( )

Definition at line 278 of file qvideowindow.cpp.

References backingStore, initialized, initRhi(), m_rhi, and m_sink.

Referenced by render().

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

◆ initRhi()

void QVideoWindowPrivate::initRhi ( )

Definition at line 111 of file qvideowindow.cpp.

References QRhiSampler::ClampToEdge, QRhi::create(), QRhi::D3D11, QRhiBuffer::Dynamic, QRhi::FramesInFlight, g_vw_quad, QRhiBuffer::Immutable, QRhiSampler::Linear, m_graphicsApi, m_renderPass, m_rhi, m_shaderResourceBindings, m_subtitleResourceBindings, m_subtitleUniformBuf, m_swapChain, m_textureSampler, m_uniformBuf, m_vertexBuf, m_vertexBufReady, QRhi::Metal, QRhiSampler::None, QRhi::Null, NVideoFrameSlots, QRhi::OpenGLES2, q, Q_ASSERT, QRhiBuffer::UniformBuffer, QRhiBuffer::VertexBuffer, and QRhi::Vulkan.

Referenced by init().

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

◆ releaseSwapChain()

void QVideoWindowPrivate::releaseSwapChain ( )

Definition at line 297 of file qvideowindow.cpp.

References m_hasSwapChain, and m_swapChain.

Referenced by render().

+ Here is the caller graph for this function:

◆ render()

void QVideoWindowPrivate::render ( )

Definition at line 305 of file qvideowindow.cpp.

References aspectRatioMode, backingStore, QBackingStore::beginPaint(), Qt::black, QVideoTextureHelper::SubtitleLayout::bounds, cb, QRectF::center(), QRhiSwapChainHdrInfo::ColorComponentValue, QByteArray::constData(), device, QPainter::end(), QBackingStore::endPaint(), QBackingStore::flush(), fmt, QVideoFrameFormat::Format_ARGB8888, QRhi::FrameOpSuccess, QRhi::FrameOpSwapChainOutOfDate, frameSize(), g_vw_quad, QRhiSwapChain::HDRExtendedSrgbLinear, QRectF::height(), info, init(), initialized, QRect::intersected(), isExposed, m_currentFrame, m_graphicsPipeline, m_hasSubtitle, m_hasSwapChain, m_rhi, m_shaderResourceBindings, m_subtitleDirty, m_subtitleLayout, m_subtitlePipeline, m_subtitleResourceBindings, m_subtitleUniformBuf, m_swapChain, m_texturesDirty, m_uniformBuf, m_vertexBuf, m_vertexBufReady, m_videoFrameSlots, QVideoFrame::mirrored(), QVideoFrame::paint(), QBackingStore::paintDevice(), painter, qGetRequiredSwapChainFormat(), qShouldUpdateSwapChainFormat(), qWarning, rect, releaseSwapChain(), QBackingStore::resize(), resizeSwapChain(), QVideoFrame::rotation(), QMatrix4x4::scale(), scaled(), QBackingStore::size(), QVideoFrame::size(), QByteArray::size(), QRectF::size(), QVideoFrame::surfaceFormat(), QMatrix4x4::translate(), updateSubtitle(), updateTextures(), QVideoTextureHelper::updateUniformData(), QRhiResourceUpdateBatch::uploadStaticBuffer(), QVideoTextureHelper::SubtitleLayout::videoSize, and QRectF::width().

+ Here is the call graph for this function:

◆ resizeSwapChain()

void QVideoWindowPrivate::resizeSwapChain ( )

Definition at line 292 of file qvideowindow.cpp.

References m_hasSwapChain, and m_swapChain.

Referenced by render().

+ Here is the caller graph for this function:

◆ rhi()

QRhi * QVideoWindowPrivate::rhi ( ) const
inline

Definition at line 37 of file qvideowindow_p.h.

References m_rhi.

◆ setupGraphicsPipeline()

void QVideoWindowPrivate::setupGraphicsPipeline ( QRhiGraphicsPipeline * pipeline,
QRhiShaderResourceBindings * bindings,
const QVideoFrameFormat & fmt )

◆ updateSubtitle()

◆ updateTextures()

void QVideoWindowPrivate::updateTextures ( QRhiResourceUpdateBatch * rub)

Definition at line 206 of file qvideowindow.cpp.

References QVideoTextureHelper::createTextures(), fmt, QVideoFrameFormat::Format_RGBA8888, QRhiShaderResourceBinding::FragmentStage, i, QVideoFrame::isValid(), m_currentFrame, m_frameTextures, m_graphicsPipeline, m_rhi, m_shaderResourceBindings, m_textureSampler, m_texturesDirty, m_uniformBuf, QRhiShaderResourceBinding::sampledTexture(), setupGraphicsPipeline(), QVideoFrame::surfaceFormat(), QVideoTextureHelper::textureDescription(), QRhiShaderResourceBinding::uniformBuffer(), and QRhiShaderResourceBinding::VertexStage.

Referenced by render().

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

Member Data Documentation

◆ aspectRatioMode

Qt::AspectRatioMode QVideoWindowPrivate::aspectRatioMode = Qt::KeepAspectRatio

Definition at line 53 of file qvideowindow_p.h.

Referenced by render().

◆ backingStore

QBackingStore* QVideoWindowPrivate::backingStore = nullptr

Definition at line 55 of file qvideowindow_p.h.

Referenced by init(), and render().

◆ format

QVideoFrameFormat QVideoWindowPrivate::format

Definition at line 92 of file qvideowindow_p.h.

◆ initialized

bool QVideoWindowPrivate::initialized = false

Definition at line 85 of file qvideowindow_p.h.

Referenced by init(), and render().

◆ isExposed

bool QVideoWindowPrivate::isExposed = false

Definition at line 86 of file qvideowindow_p.h.

Referenced by render().

◆ m_currentFrame

QVideoFrame QVideoWindowPrivate::m_currentFrame

Definition at line 79 of file qvideowindow_p.h.

Referenced by render(), updateSubtitle(), and updateTextures().

◆ m_frameTextures

std::unique_ptr<QVideoFrameTextures> QVideoWindowPrivate::m_frameTextures

Definition at line 67 of file qvideowindow_p.h.

Referenced by updateTextures().

◆ m_graphicsApi

QRhi::Implementation QVideoWindowPrivate::m_graphicsApi = QRhi::Null

Definition at line 78 of file qvideowindow_p.h.

Referenced by QVideoWindowPrivate(), and initRhi().

◆ m_graphicsPipeline

std::unique_ptr<QRhiGraphicsPipeline> QVideoWindowPrivate::m_graphicsPipeline

Definition at line 70 of file qvideowindow_p.h.

Referenced by render(), and updateTextures().

◆ m_hasSubtitle

bool QVideoWindowPrivate::m_hasSubtitle = false

Definition at line 91 of file qvideowindow_p.h.

Referenced by render(), and updateSubtitle().

◆ m_hasSwapChain

bool QVideoWindowPrivate::m_hasSwapChain = false

Definition at line 88 of file qvideowindow_p.h.

Referenced by releaseSwapChain(), render(), and resizeSwapChain().

◆ m_renderPass

std::unique_ptr<QRhiRenderPassDescriptor> QVideoWindowPrivate::m_renderPass

Definition at line 62 of file qvideowindow_p.h.

Referenced by initRhi(), and setupGraphicsPipeline().

◆ m_rhi

std::unique_ptr<QRhi> QVideoWindowPrivate::m_rhi

Definition at line 60 of file qvideowindow_p.h.

Referenced by init(), initRhi(), render(), rhi(), updateSubtitle(), and updateTextures().

◆ m_shaderResourceBindings

std::unique_ptr<QRhiShaderResourceBindings> QVideoWindowPrivate::m_shaderResourceBindings

Definition at line 69 of file qvideowindow_p.h.

Referenced by initRhi(), render(), and updateTextures().

◆ m_sink

std::unique_ptr<QVideoSink> QVideoWindowPrivate::m_sink

Definition at line 77 of file qvideowindow_p.h.

Referenced by QVideoWindowPrivate(), ~QVideoWindowPrivate(), and init().

◆ m_subtitleDirty

bool QVideoWindowPrivate::m_subtitleDirty = false

Definition at line 90 of file qvideowindow_p.h.

Referenced by render(), and updateSubtitle().

◆ m_subtitleLayout

QVideoTextureHelper::SubtitleLayout QVideoWindowPrivate::m_subtitleLayout

Definition at line 80 of file qvideowindow_p.h.

Referenced by render(), and updateSubtitle().

◆ m_subtitlePipeline

std::unique_ptr<QRhiGraphicsPipeline> QVideoWindowPrivate::m_subtitlePipeline

Definition at line 74 of file qvideowindow_p.h.

Referenced by render(), and updateSubtitle().

◆ m_subtitleResourceBindings

std::unique_ptr<QRhiShaderResourceBindings> QVideoWindowPrivate::m_subtitleResourceBindings

Definition at line 73 of file qvideowindow_p.h.

Referenced by initRhi(), render(), and updateSubtitle().

◆ m_subtitleTexture

std::unique_ptr<QRhiTexture> QVideoWindowPrivate::m_subtitleTexture

Definition at line 72 of file qvideowindow_p.h.

Referenced by updateSubtitle().

◆ m_subtitleUniformBuf

std::unique_ptr<QRhiBuffer> QVideoWindowPrivate::m_subtitleUniformBuf

Definition at line 75 of file qvideowindow_p.h.

Referenced by initRhi(), render(), and updateSubtitle().

◆ m_swapChain

std::unique_ptr<QRhiSwapChain> QVideoWindowPrivate::m_swapChain

◆ m_textureSampler

std::unique_ptr<QRhiSampler> QVideoWindowPrivate::m_textureSampler

Definition at line 68 of file qvideowindow_p.h.

Referenced by initRhi(), updateSubtitle(), and updateTextures().

◆ m_texturesDirty

bool QVideoWindowPrivate::m_texturesDirty = true

Definition at line 89 of file qvideowindow_p.h.

Referenced by render(), and updateTextures().

◆ m_uniformBuf

std::unique_ptr<QRhiBuffer> QVideoWindowPrivate::m_uniformBuf

Definition at line 66 of file qvideowindow_p.h.

Referenced by initRhi(), render(), and updateTextures().

◆ m_useRhi

bool QVideoWindowPrivate::m_useRhi = true

Definition at line 87 of file qvideowindow_p.h.

Referenced by canRender().

◆ m_vertexBuf

std::unique_ptr<QRhiBuffer> QVideoWindowPrivate::m_vertexBuf

Definition at line 64 of file qvideowindow_p.h.

Referenced by initRhi(), and render().

◆ m_vertexBufReady

bool QVideoWindowPrivate::m_vertexBufReady = false

Definition at line 65 of file qvideowindow_p.h.

Referenced by initRhi(), and render().

◆ m_videoFrameSlots

QVideoFrame QVideoWindowPrivate::m_videoFrameSlots[NVideoFrameSlots]

Definition at line 83 of file qvideowindow_p.h.

Referenced by render().

◆ q

QVideoWindow* QVideoWindowPrivate::q = nullptr

Definition at line 52 of file qvideowindow_p.h.

Referenced by initRhi().


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