summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-10-26 11:42:11 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-10-27 07:44:48 +0000
commit5b42ce74199671f88ee82c971ebff70f87c018db (patch)
tree3b5c6c8a79c98006d021060b674357d7f0d59947
parent08db8a408829cb3bbd204e71dd8d5616e7d21d3d (diff)
downloadqtmultimedia-5b42ce74199671f88ee82c971ebff70f87c018db.tar.gz
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 <christian.stromme@qt.io>
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp9
1 files changed, 8 insertions, 1 deletions
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:"