On 04/02/2013 10:21 PM, Luca Carlon wrote: > Hi! I'm implementing a plugin for Qt Multimedia for playing video and > audio using hardware acceleration. When opening a content which includes > video, I need to instantiate an OpenGL texture and an EGLImageKHR. To do > this I need to be in the thread with the current OpenGL context, which > should be the renderer thread. > > I did this in a custom QML component (in the updatePaintNode method), > and everything is working correctly: but how do I execute my code in the > renderer thread of the scene graph from a Qt Multimedia plugin? What > options do I have? > > I quickly read the Qt Multimedia plugin for Android, but that is a > little different because the texture is instantiated by the > SurfaceTexture java class.
If you can get access to the QWindow you can qobject_cast to check that it's a QQuickWindow. In that case you can connect to the beforeRendering() signal of the QQuickWindow using a Qt::DirectConnection, which will cause your slot to be executed on the render thread before the rendering of a frame. -- Samuel _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest