summaryrefslogtreecommitdiffstats
path: root/src/imports/multimedia/qdeclarativevideooutput_render.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-09-27 11:24:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-01 17:26:21 +0200
commitbe7a6241e77f67e4a19c63ac5683dd7fa566e9d2 (patch)
treeab8b66b5124d4a982d7690cf7893a40650bccc8d /src/imports/multimedia/qdeclarativevideooutput_render.cpp
parent329d9d4563445d785284a02983e237ff1a07f5dd (diff)
Android: refactor video renderer.
Removed the overhead of having to create a shared OpenGL context in the GUI thread and pre-render the frame into a FBO. We now directly render the GL_TEXTURE_EXTERNAL_OES in the QtQuick render thread, using an Android-specific QSGVideoNode. We also use a callback from the render thread to create the texture from there and not have to create a separate shared OpenGL context. Change-Id: I6c8eb94b47d0a03329c912701b8af3fb5ebd1876 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src/imports/multimedia/qdeclarativevideooutput_render.cpp')
-rw-r--r--src/imports/multimedia/qdeclarativevideooutput_render.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/imports/multimedia/qdeclarativevideooutput_render.cpp b/src/imports/multimedia/qdeclarativevideooutput_render.cpp
index 002f50a62..cd03cd6b8 100644
--- a/src/imports/multimedia/qdeclarativevideooutput_render.cpp
+++ b/src/imports/multimedia/qdeclarativevideooutput_render.cpp
@@ -193,6 +193,13 @@ QSGNode *QDeclarativeVideoRendererBackend::updatePaintNode(QSGNode *oldNode,
if (!m_glContext) {
m_glContext = QOpenGLContext::currentContext();
m_surface->scheduleOpenGLContextUpdate();
+
+ // Internal mechanism to call back the surface renderer from the QtQuick render thread
+ QObject *obj = m_surface->property("_q_GLThreadCallback").value<QObject*>();
+ if (obj) {
+ QEvent ev(QEvent::User);
+ obj->event(&ev);
+ }
}
if (m_frameChanged) {