Page 1 of 1

Overlay OpenGLES and MMAL h264 decoder

Posted: Fri Aug 09, 2019 8:21 pm
by ktb92677
Hi all! So I have the following complex situation I need help resolving. I want to overlay graphics in a hardware accelerated fashion on top of an h264 video stream displayed on a raspberry PI. I built an MMAL h264 decoder based on this code here: https://github.com/raspberrypi/userland ... _basic_2.c.

The OpenGLES code I used was copied from here: https://github.com/vurtun/nuklear/tree/ ... _opengles2. (yes, I want to render GUI components on top of the h264 stream)

Currently for some reason the OpenGLES graphics always completely hides the h264 stream running even if I set the background color to totally transparent like this:

Code: Select all

glClearColor(0, 0, 0, 0);
Any help would be greatly appreciated!

Re: Overlay OpenGLES and MMAL h264 decoder

Posted: Fri Aug 09, 2019 8:40 pm
by dividuum
A good start is probably to take a look at the output of `vcgencmd dispmanx_list`. It'll show your the arrangement of layers.

Re: Overlay OpenGLES and MMAL h264 decoder

Posted: Fri Aug 09, 2019 8:43 pm
by ktb92677
dividuum wrote:
Fri Aug 09, 2019 8:40 pm
A good start is probably to take a look at the output of `vcgencmd dispmanx_list`. It'll show your the arrangement of layers.
Oh cool utility! Is there anyway to set the layer of OpenGLES? Anyway to set the layer of MMAL? Anyway to set the background of OpenGLES to transparent to show the underlying MMAL stream based on the examples I linked?

Re: Overlay OpenGLES and MMAL h264 decoder

Posted: Fri Aug 09, 2019 8:49 pm
by dividuum
I got that working using the old OMX API from my existing code. I'm currently porting this over to the MMAL API and run into basically the same issues myself. See my post at https://www.raspberrypi.org/forums/view ... 7&t=248353

Re: Overlay OpenGLES and MMAL h264 decoder

Posted: Fri Aug 09, 2019 9:00 pm
by ktb92677
Wow, we posted our topics at fairly similar times! There must be a solution to this... maybe @6by9 can shed some light here