![]() |
Qt 6.x
The Qt SDK
|
#include <qvideowindow_p.h>
Public Types | |
enum | { NVideoFrameSlots = 4 } |
Public Member Functions | |
QVideoWindowPrivate (QVideoWindow *q) | |
~QVideoWindowPrivate () | |
bool | canRender () const |
QRhi * | rhi () 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) |
Definition at line 31 of file qvideowindow_p.h.
anonymous enum |
Enumerator | |
---|---|
NVideoFrameSlots |
Definition at line 82 of file qvideowindow_p.h.
QVideoWindowPrivate::QVideoWindowPrivate | ( | QVideoWindow * | q | ) |
Definition at line 36 of file qvideowindow.cpp.
References QObject::connect(), QRhi::D3D11, QSurface::Direct3DSurface, m_graphicsApi, m_sink, QRhi::Metal, QSurface::MetalSurface, QRhi::Null, QRhi::OpenGLES2, QSurface::OpenGLSurface, QSurface::OpenVGSurface, QGuiApplicationPrivate::platformIntegration(), platformSurfaceType(), Q_ASSERT, QSurface::RasterGLSurface, QSurface::RasterSurface, QPlatformIntegration::RhiBasedRendering, QVideoSink::videoFrameChanged(), QRhi::Vulkan, and QSurface::VulkanSurface.
QVideoWindowPrivate::~QVideoWindowPrivate | ( | ) |
Definition at line 70 of file qvideowindow.cpp.
References QObject::disconnect(), m_sink, and QVideoSink::videoFrameChanged().
|
inline |
Definition at line 35 of file qvideowindow_p.h.
References m_useRhi.
void QVideoWindowPrivate::init | ( | ) |
Definition at line 279 of file qvideowindow.cpp.
References backingStore, initialized, initRhi(), m_rhi, and m_sink.
Referenced by render().
void QVideoWindowPrivate::initRhi | ( | ) |
Definition at line 110 of file qvideowindow.cpp.
References QRhiSampler::ClampToEdge, QRhi::create(), QRhi::D3D11, QRhiBuffer::Dynamic, QRhi::FramesInFlight, g_vw_quad, QRhiSwapChain::HDRExtendedSrgbLinear, 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().
void QVideoWindowPrivate::releaseSwapChain | ( | ) |
Definition at line 298 of file qvideowindow.cpp.
References m_hasSwapChain, and m_swapChain.
void QVideoWindowPrivate::render | ( | ) |
Definition at line 306 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, QRect::height(), 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(), QRect::moveCenter(), QVideoFrame::paint(), QBackingStore::paintDevice(), painter, qWarning, rect, QBackingStore::resize(), resizeSwapChain(), QVideoFrame::rotationAngle(), QMatrix4x4::scale(), scaled(), QSize::scaled(), QBackingStore::size(), QVideoFrame::size(), QByteArray::size(), QRect::size(), QRectF::size(), QVideoFrame::surfaceFormat(), QRect::top(), QSizeF::toSize(), QMatrix4x4::translate(), QSize::transpose(), QRhiResourceUpdateBatch::updateDynamicBuffer(), updateSubtitle(), updateTextures(), QVideoTextureHelper::updateUniformData(), QRhiResourceUpdateBatch::uploadStaticBuffer(), QVideoTextureHelper::SubtitleLayout::videoSize, QRect::width(), QRectF::width(), and QPointF::y().
void QVideoWindowPrivate::resizeSwapChain | ( | ) |
Definition at line 293 of file qvideowindow.cpp.
References m_hasSwapChain, and m_swapChain.
Referenced by render().
|
inline |
Definition at line 37 of file qvideowindow_p.h.
References m_rhi.
void QVideoWindowPrivate::setupGraphicsPipeline | ( | QRhiGraphicsPipeline * | pipeline, |
QRhiShaderResourceBindings * | bindings, | ||
const QVideoFrameFormat & | fmt | ||
) |
Definition at line 181 of file qvideowindow.cpp.
References QRhiGraphicsPipeline::create(), QRhiVertexInputAttribute::Float2, fmt, QRhiShaderStage::Fragment, QVideoTextureHelper::fragmentShaderFileName(), QShader::isValid(), m_renderPass, m_swapChain, Q_ASSERT, QRhiVertexInputLayout::setAttributes(), QRhiVertexInputLayout::setBindings(), QRhiGraphicsPipeline::setRenderPassDescriptor(), QRhiGraphicsPipeline::setShaderResourceBindings(), QRhiGraphicsPipeline::setShaderStages(), QRhiGraphicsPipeline::setTopology(), QRhiGraphicsPipeline::setVertexInputLayout(), QRhiGraphicsPipeline::TriangleStrip, QRhiShaderStage::Vertex, QVideoTextureHelper::vertexShaderFileName(), and vwGetShader().
Referenced by updateSubtitle(), and updateTextures().
void QVideoWindowPrivate::updateSubtitle | ( | QRhiResourceUpdateBatch * | rub, |
const QSize & | frameSize | ||
) |
Definition at line 243 of file qvideowindow.cpp.
References QVideoTextureHelper::SubtitleLayout::bounds, QRhiGraphicsPipeline::TargetBlend::enable, QVideoFrameFormat::Format_RGBA8888, QRhiShaderResourceBinding::FragmentStage, frameSize(), QString::isEmpty(), m_currentFrame, m_hasSubtitle, m_rhi, m_subtitleDirty, m_subtitleLayout, m_subtitlePipeline, m_subtitleResourceBindings, m_subtitleTexture, m_subtitleUniformBuf, m_textureSampler, QRhiTexture::RGBA8, QRhiShaderResourceBinding::sampledTexture(), setupGraphicsPipeline(), QRectF::size(), QVideoFrame::subtitleText(), QVideoTextureHelper::SubtitleLayout::toImage(), QSizeF::toSize(), QRhiShaderResourceBinding::uniformBuffer(), QVideoTextureHelper::SubtitleLayout::update(), QRhiResourceUpdateBatch::uploadTexture(), and QRhiShaderResourceBinding::VertexStage.
Referenced by render().
void QVideoWindowPrivate::updateTextures | ( | QRhiResourceUpdateBatch * | rub | ) |
Definition at line 207 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().
Qt::AspectRatioMode QVideoWindowPrivate::aspectRatioMode = Qt::KeepAspectRatio |
Definition at line 53 of file qvideowindow_p.h.
Referenced by render().
QBackingStore* QVideoWindowPrivate::backingStore = nullptr |
Definition at line 55 of file qvideowindow_p.h.
QVideoFrameFormat QVideoWindowPrivate::format |
Definition at line 92 of file qvideowindow_p.h.
bool QVideoWindowPrivate::initialized = false |
Definition at line 85 of file qvideowindow_p.h.
bool QVideoWindowPrivate::isExposed = false |
Definition at line 86 of file qvideowindow_p.h.
Referenced by render().
QVideoFrame QVideoWindowPrivate::m_currentFrame |
Definition at line 79 of file qvideowindow_p.h.
Referenced by render(), updateSubtitle(), and updateTextures().
std::unique_ptr<QVideoFrameTextures> QVideoWindowPrivate::m_frameTextures |
Definition at line 67 of file qvideowindow_p.h.
Referenced by updateTextures().
QRhi::Implementation QVideoWindowPrivate::m_graphicsApi = QRhi::Null |
Definition at line 78 of file qvideowindow_p.h.
Referenced by QVideoWindowPrivate(), and initRhi().
std::unique_ptr<QRhiGraphicsPipeline> QVideoWindowPrivate::m_graphicsPipeline |
Definition at line 70 of file qvideowindow_p.h.
Referenced by render(), and updateTextures().
bool QVideoWindowPrivate::m_hasSubtitle = false |
Definition at line 91 of file qvideowindow_p.h.
Referenced by render(), and updateSubtitle().
bool QVideoWindowPrivate::m_hasSwapChain = false |
Definition at line 88 of file qvideowindow_p.h.
Referenced by releaseSwapChain(), render(), and resizeSwapChain().
std::unique_ptr<QRhiRenderPassDescriptor> QVideoWindowPrivate::m_renderPass |
Definition at line 62 of file qvideowindow_p.h.
Referenced by initRhi(), and setupGraphicsPipeline().
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().
std::unique_ptr<QRhiShaderResourceBindings> QVideoWindowPrivate::m_shaderResourceBindings |
Definition at line 69 of file qvideowindow_p.h.
Referenced by initRhi(), render(), and updateTextures().
std::unique_ptr<QVideoSink> QVideoWindowPrivate::m_sink |
Definition at line 77 of file qvideowindow_p.h.
Referenced by QVideoWindowPrivate(), ~QVideoWindowPrivate(), and init().
bool QVideoWindowPrivate::m_subtitleDirty = false |
Definition at line 90 of file qvideowindow_p.h.
Referenced by render(), and updateSubtitle().
QVideoTextureHelper::SubtitleLayout QVideoWindowPrivate::m_subtitleLayout |
Definition at line 80 of file qvideowindow_p.h.
Referenced by render(), and updateSubtitle().
std::unique_ptr<QRhiGraphicsPipeline> QVideoWindowPrivate::m_subtitlePipeline |
Definition at line 74 of file qvideowindow_p.h.
Referenced by render(), and updateSubtitle().
std::unique_ptr<QRhiShaderResourceBindings> QVideoWindowPrivate::m_subtitleResourceBindings |
Definition at line 73 of file qvideowindow_p.h.
Referenced by initRhi(), render(), and updateSubtitle().
std::unique_ptr<QRhiTexture> QVideoWindowPrivate::m_subtitleTexture |
Definition at line 72 of file qvideowindow_p.h.
Referenced by updateSubtitle().
std::unique_ptr<QRhiBuffer> QVideoWindowPrivate::m_subtitleUniformBuf |
Definition at line 75 of file qvideowindow_p.h.
Referenced by initRhi(), render(), and updateSubtitle().
std::unique_ptr<QRhiSwapChain> QVideoWindowPrivate::m_swapChain |
Definition at line 61 of file qvideowindow_p.h.
Referenced by initRhi(), releaseSwapChain(), render(), resizeSwapChain(), and setupGraphicsPipeline().
std::unique_ptr<QRhiSampler> QVideoWindowPrivate::m_textureSampler |
Definition at line 68 of file qvideowindow_p.h.
Referenced by initRhi(), updateSubtitle(), and updateTextures().
bool QVideoWindowPrivate::m_texturesDirty = true |
Definition at line 89 of file qvideowindow_p.h.
Referenced by render(), and updateTextures().
std::unique_ptr<QRhiBuffer> QVideoWindowPrivate::m_uniformBuf |
Definition at line 66 of file qvideowindow_p.h.
Referenced by initRhi(), render(), and updateTextures().
bool QVideoWindowPrivate::m_useRhi = true |
Definition at line 87 of file qvideowindow_p.h.
Referenced by canRender().
std::unique_ptr<QRhiBuffer> QVideoWindowPrivate::m_vertexBuf |
Definition at line 64 of file qvideowindow_p.h.
bool QVideoWindowPrivate::m_vertexBufReady = false |
Definition at line 65 of file qvideowindow_p.h.
QVideoFrame QVideoWindowPrivate::m_videoFrameSlots[NVideoFrameSlots] |
Definition at line 83 of file qvideowindow_p.h.
Referenced by render().
QVideoWindow* QVideoWindowPrivate::q = nullptr |
Definition at line 52 of file qvideowindow_p.h.
Referenced by initRhi().