clinuxvideoh.264openmax

How to decode h264 video using OpenMax in Linux? Is this code correct?


I'm trying to decode h264 video stream using OpenMAX decoder:

https://gist.github.com/NicholasShatokhin/f6a86d03707decf53d684c4c82f909a6

Looks like that everything is OK, but when I send data to decoder it doesn't fill the output buffers. FillBufferDone callback doesn't called during application running. Only when Flush function called, I get this callback with empty buffer.

What did I miss here? Is there problem with my code or with decoder itself? How to check it?


Solution

  • I guess that question is without answer for long enough for you to find it in other place, but I will answer regardless.

    In your callback event handler on PortSettingsChanged event you only print a message about it, but what OpenMAX specification describes in section 3.4.5 is dynamic port reconfiguration. In case of tunneled implementation it would only require to disable/re-enable port that this event occured for (disabling the port will cause return and deallocation of buffers connected to this port, enabling will allocate new buffers configured with new port setings). In case of non-tunneled implementation you have to: - disable port, - free buffers, - read port settings, - enable port, - alloc new buffers according to settings.

    Should be working from there.