Search code examples
qtgstreameryoctoimx6eglfs

Qt Overlay over GStreamer


I've a question considering the current setup:

  • Yocto Linux on iMX6
  • Neither a window-, nor a display-manager
  • A fully functional Qt Application, tested on Debian 9

The application consists of 2 main elements:

  • A GStreamer part, with a imxg2dvideosink
  • A semi-transparent Qt Overlay, which should be displayed over the stream

The question:

How can I accomplish to display the overlay over the stream, while having both parts on fullscreen (filling the whole screen)? Possible solutions:

  • /dev/fb1 as an overlay to /dev/fb0 (How to split a single application to two fb's ?)
  • Use a display-manager ?
  • Use a window-manager ?
  • linuxfb instead of eglfs ?

My current (not working) solution:

  • Using -platform eglfs
  • The application will first start GStreamer, and afterwards show the overlay

Solution

  • I've found the solution myself. Shared below:

    1) Run Qt Application on /dev/fb1:

    • export QT_QPA_EGLFS_FB=/dev/fb1 (Specify /dev/fb1 as eglfs framebuffer)
    • echo 0 > /sys/class/graphics/fb1/blank (Unblank framebuffer)
    • fbset -fb /dev/fb1 --geometry <your geometry here> (Set framebuffer geometry)
    • ./YourApplication -platform eglfs (Run application)

    Use a Color Key if you want full opacity while having fully transparent parts of your overlay.

    2) Run GStreamer on /dev/fb0:

    • gst-launch-1.0 videotestsrc ! imxg2dvideosink framebuffer=/dev/fb0

    This is the solution for eglfs. Other possibilities are linuxfb.