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 <yoann.lopes@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
16430262d9
commit
1fe5a7964f
@@ -120,7 +120,7 @@ QImage AVFVideoFrameRenderer::renderLayerToImage(AVPlayerLayer *layer)
|
|||||||
return QImage();
|
return QImage();
|
||||||
|
|
||||||
renderLayerToFBO(layer, fbo);
|
renderLayerToFBO(layer, fbo);
|
||||||
QImage fboImage = fbo->toImage().mirrored();
|
QImage fboImage = fbo->toImage();
|
||||||
m_glContext->doneCurrent();
|
m_glContext->doneCurrent();
|
||||||
|
|
||||||
return fboImage;
|
return fboImage;
|
||||||
@@ -204,7 +204,8 @@ void AVFVideoFrameRenderer::renderLayerToFBO(AVPlayerLayer *layer, QOpenGLFrameb
|
|||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glLoadIdentity();
|
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);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|||||||
Reference in New Issue
Block a user