Has anyone had any luck with this? Dom, I completely understand if you can't publish the code for any reason, but would it be possible for you to outline the "recipe" you are using?
What I'm currently doing:
- Create an OpenGL texture with 1280x720 resolution (matches my test video) and RGBA8888 format. Create a EGL image that points to the texture.
- Create a video_decoder
- Create an egl_render
- Disable all ports on both components
- Set the pNativeWindow of the output port of the egl_render to a valid EGLDisplay handle
- Set the eCompressionFormat of the input port of the video_decoder. I believe the input of the decoder works just fine as I can see the frames if I use a video_render instead of the egl_render.
- Change the state of the video_decoder to OMX_StateIdle
- Allocate input buffers for the decoder using OMX_AllocateBuffer()
- Enable the input port of the decoder
- Change the state of the decoder to OMX_StateExecuting
- Feed decoder some data until the decoder's output port changes settings
- Create a tunnel between the output port of the decoder and the input port of the egl_render
- Enable the decoder's output port
- Enable the egl_render's input port
- Change the egl_render's state to OMX_StateIdle
- Printing the definitions for all the ports here and the frame dimensions are 1280x720 as expected, but for some reason the egl_render output port's pNativeWindow has become 0(?!)
- Enable the output port of the egl_render
- Call OMX_UseEGLImage for the egl_render's output port
- Change egl_render's state to OMX_StateExecuting
- Call OMX_FillThisBuffer with the egl_render's handle and the buffer header I got from the OMX_UseEGLImage call
- Keep feeding the decoder more data as decoder's input buffers free up
The BufferFillDone callback never gets called.
The pixel format of the decoder is OMX_COLOR_FormatYUV420PackedPlanar. This isn't very convenient from a GLSL shader perspective. I looked at the different color format options and OMX_COLOR_BRCMEGL seems interesting. I tried setting the decoder's output format to this, but doing it with OMX_IndexParamPortDefinition results in a bad parameter error. Same thing happens for RGB565 eventhough the video_decoder documentation mentions that this should be possible. I also tried setting the format with OMX_VIDEO_PARAM_PORTFORMATTYPE, but setting it with that doesn't seem to stick (no error though).
Any ideas or advice?