From: Andy Nichols Date: Mon, 3 Mar 2014 14:18:38 +0000 (+0100) Subject: AVFoundation: Fix y-inverted QML Videos X-Git-Tag: upstream/5.2.90+alpha~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1fe5a7964fa1362349b10753c5cc89f1cc7fd978;p=platform%2Fupstream%2Fqtmultimedia.git 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 --- 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();