From 1fe5a7964fa1362349b10753c5cc89f1cc7fd978 Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Mon, 3 Mar 2014 15:18:38 +0100 Subject: [PATCH] AVFoundation: Fix y-inverted QML Videos When the code that supports iOS was added, we introduced a bug where QML videos would be played y-inverted on OS X. This is because we made no effort to y-invert the Framebuffer Object before rendering the texture in the SceneGraph. Now we render the video the the FBO y-inverted, so there is no need to y-invert the resulting texture. Task-number: QTBUG-35955 Change-Id: I41af1aaae57923b9972b5be5ec65f7d2a97d77c5 Reviewed-by: Yoann Lopes --- src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm index fb63392..f4e4b64 100644 --- a/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm +++ b/src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm @@ -120,7 +120,7 @@ QImage AVFVideoFrameRenderer::renderLayerToImage(AVPlayerLayer *layer) return QImage(); renderLayerToFBO(layer, fbo); - QImage fboImage = fbo->toImage().mirrored(); + QImage fboImage = fbo->toImage(); m_glContext->doneCurrent(); return fboImage; @@ -204,7 +204,8 @@ void AVFVideoFrameRenderer::renderLayerToFBO(AVPlayerLayer *layer, QOpenGLFrameb glPushMatrix(); glLoadIdentity(); - glOrtho(0.0f, m_targetSize.width(), m_targetSize.height(), 0.0f, 0.0f, 1.0f); + //Render to FBO with inverted Y + glOrtho(0.0, m_targetSize.width(), 0.0, m_targetSize.height(), 0.0, 1.0); glMatrixMode(GL_MODELVIEW); glPushMatrix(); -- 2.7.4