sascha20
Posts: 2
Joined: Sun Dec 16, 2012 8:11 pm

Qt5 + omxplayer

Sun Dec 16, 2012 8:24 pm

I have implemented some kind of digital picture frame using Qt5 RC1 which displays all images in a folder and runs fine on the pi.

However, I'd also like to play small video clips (h264) between the pictures using omxplayer.

Running omxplayer from the command line the video clips play fine. Running it using a QProcess from within Qt5 only the audio is audible. The video itself appears to be hidden behind the white Qt5 widget/frame/whatever.
Also running omxplayer from the console and then starting the Qt5 app immediately hides the video.

Since the Qt5 app manages to display pictures even without X running it would seem it is doing so using OpenGL? Is there a way to tell the GPU to put omxplayer on a "higher" layer than the Qt5 app? Because now it appears as if the Qt5 app has priority over omxplayer.

Any help would be highly appreciated ;-)

Timmmm
Posts: 14
Joined: Sun Jul 15, 2012 3:13 pm

Re: Qt5 + omxplayer

Thu Dec 27, 2012 12:05 am

Yeah I'd also like to know this. It certainly behaves as if the Qt5 app is on a higher layer. You can even run the Qt app, then start omxplayer, whereupon you'll hear the audio. If you then kill the Qt app the video will appear.

I remember reading that the rpi GPU does have different layers.

We'll probably have to resort to seeing how XBMC does it.

Timmmm
Posts: 14
Joined: Sun Jul 15, 2012 3:13 pm

Re: Qt5 + omxplayer

Thu Dec 27, 2012 1:37 am

Weird I replied to this but it didn't work. Anyway, I basically said I was wondering the same thing. I want to integrate omxplayer (or libomxplayer when I make it) into my app, and have it play above the Qt5 app. I've found some commented-out code in omxplayer that sets *a* layer. I'm not sure it is the one we want, but check it out anyway:

https://github.com/xbmc/xbmc-rbp/blob/m ... o.cpp#L546

sascha20
Posts: 2
Joined: Sun Dec 16, 2012 8:11 pm

Re: Qt5 + omxplayer

Fri Dec 28, 2012 2:54 pm

Hi,

thanks for the hint. You are right. By default the display layer is set to 0.
By setting it to a value higher than 0, e.g. 1 or 2 omxplayer now is in the foreground :-)

Cheers.

sciuipis
Posts: 1
Joined: Thu Jan 10, 2013 10:28 am

Re: Qt5 + omxplayer

Thu Jan 10, 2013 10:39 am

Hi sascha20,
could you explain how to do that or share the new build of omxplayer with the layer set to 2? Compiling omxplayer directly on raspbian and not cross compiling is a long work...

Thanks,
ste

Timmmm
Posts: 14
Joined: Sun Jul 15, 2012 3:13 pm

Re: Qt5 + omxplayer

Thu Jan 10, 2013 12:17 pm

I think uncommenting these lines should do it:

Code: Select all

 configDisplay.set     = OMX_DISPLAY_SET_LAYER;
  configDisplay.layer   = 2;

  omx_err = m_omx_render.SetConfig(OMX_IndexConfigDisplayRegion, &configDisplay);
  if(omx_err != OMX_ErrorNone)
    return false;
But I agree, cross-compiling is a massive pain, it would be nice if someone shared a binary!

Return to “Graphics programming”