Wednesday, December 26, 2012

Custom QML Component to Integrate Hardware Acceleration in Qt Scene Graph

This is a custom QQuickItem subclass rendering hardware-decoded h264 1080p video on Raspberry Pi. The egl_render component used in some previous posts is good. The QML component can play nicely with the rest of the scene rendered by the Qt Quick renderer in the scene graph.
Code will be available when I'll find the time to clean it up, but is a direct consequence of the previous posts which include the code to implement decoding and rendering.
In the QML test code, I created some simple standard QML animations and also placed an Image element with 0.5 opacity overlapping the video element.
NOTE: New information is available here.


  1. Oh wow, I have been looking into how to do this for ages! This is amazing! Code will be muchly appreciated!

  2. Awesome job! I was also looking into this, your previous post was quite an achievement as well!

  3. I've been trying to obtain the same results from your latest video, but so far I've only managed to invoke the C++ defined GLWidget element in QML - basically, I'm able to invoke the GLWidget from QML, the video is running because I'm getting positive console output, however it isn't being displayed on screen, looks like it is being drawn behind the QML view plane - no error messages either... thanks in advance!

  4. Non voglio stressarti, ma veramente voglio il codice! Per favore? :-) O come diciamo in Inglese, "per favore carino?" (non ha ragione in Inglese anche)

    (Sto provando imparare Italiano; Scusami!)

  5. Also me I'm italian and as Tim said I'm looking forward to see your code!


  6. How did you integrate the egl_render with the QQuickItem subclass? Did you have to replace the GlWidget you had or did you keep it and invoked it with the new QQuickItem?

    updateGL seems to be responsible for the texture updating every 30msec, which would generate something like 33fps... and a movie - but updateGL belongs to QGlWidget, it isn't found on QQuickItem I think... anyways drop a line if you can, also working on the same issues!

  7. If you have interest on this subject, read the new post. I completely refactored my code to include omxplayer code. Still, I have some issues and the code cannot be shared, but might give you ideas on how to implement your own.