From 5b42ce74199671f88ee82c971ebff70f87c018db Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Thu, 26 Oct 2017 11:42:11 +0200 Subject: Don't discard the surface format when creating a video node All relevant properties from the surface are now copied Task-number: QTBUG-53268 Change-Id: I7f18f0e6a623c8c7c5be68e912b298e0b4b130b7 Reviewed-by: Christian Stromme --- src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp index 412694cc3..f1b7662b5 100644 --- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp +++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp @@ -335,7 +335,14 @@ QSGNode *QDeclarativeVideoRendererBackend::updatePaintNode(QSGNode *oldNode, for (QSGVideoNodeFactoryInterface* factory : qAsConst(m_videoNodeFactories)) { // Get a node that supports our frame. The surface is irrelevant, our // QSGVideoItemSurface supports (logically) anything. - videoNode = factory->createNode(QVideoSurfaceFormat(m_frame.size(), m_frame.pixelFormat(), m_frame.handleType())); + QVideoSurfaceFormat nodeFormat(m_frame.size(), m_frame.pixelFormat(), m_frame.handleType()); + const QVideoSurfaceFormat surfaceFormat = m_surface->surfaceFormat(); + nodeFormat.setYCbCrColorSpace(surfaceFormat.yCbCrColorSpace()); + nodeFormat.setPixelAspectRatio(surfaceFormat.pixelAspectRatio()); + nodeFormat.setScanLineDirection(surfaceFormat.scanLineDirection()); + nodeFormat.setViewport(surfaceFormat.viewport()); + nodeFormat.setFrameRate(surfaceFormat.frameRate()); + videoNode = factory->createNode(nodeFormat); if (videoNode) { qCDebug(qLcVideo) << "updatePaintNode: Video node created. Handle type:" << m_frame.handleType() << " Supported formats for the handle by this node:" -- cgit v1.2.1