-
Notifications
You must be signed in to change notification settings - Fork 1.7k
video_decoder (and others): Allow using an empty buffer with EOS flag to signal EOS and drain the component #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As far as I can tell zero length packets are supported, and these can contain OMX_BUFFERFLAG_EOS, and that will put the component into EOS state. |
It's not guaranteed that you get an output buffer with the EOS flag set. If there are no pending output buffers, the empty EOS buffer is simply ignored and never produces any output. |
Are you saying you don't get an OMX_EventBufferFlag with OMX_BUFFERFLAG_EOS set callback? |
Yes, neither an OMX_EventBufferFlag (on any port) nor an empty buffer with the EOS flag set. I don't get either of these at any time if I pass a non-empty or empty buffer to the input port of video_decode with the EOS flag set. |
But I get OMX_EventBufferFlag in hello_video on the video_render input port and also on the video_decode output port. In my case I grab buffers directly from the video_decode output port without tunneling to any other component, maybe that's the problem? |
Simple testcase based on hello_video with all the other components removed. This hangs forever after the EOS buffer is sent. Changing (the normal) hello_video to wait for EOS on the video_decode output port works fine though so it must be something with the tunneling. |
From OpenMax guy: I believe the issue here is that the event we're sending is not the one expected by the test code. In the event, we send the full buffer nFlags field while the tests code is filtering exclusively for OMX_BUFFERFLAG_EOS. So that line: |
That doesn't work either. There is no event arriving after the empty EOS buffer is passed to the component, if you add a printf() to ilclient_event_handler() you'll see that. |
Ok, I got it working with hello_video now but not with my own code. I don't see the difference between the two, but this is the difference in the logs. For hello_video: For my code: "saveBuffer" or "timer retry" is nowhere in the logs for hello_video. |
Nevermind, it was a stupid bug in my own code. |
Hi,
it would be really great if it would be possible to signal EOS to video_decode (and other components) by passing an empty (nFilledLen=0) buffer with the EOS flag to the input port. The output port would then either first output all frames that can still be output and set the EOS flag on the last of them, or would just output an empty buffer with the EOS flag if there are no frames pending (alternatively: always put the EOS flag on an empty buffer instead of the last buffer). It's just important that, no matter what, a buffer with the EOS flag is output.
This would allow to drain the component and make it possible to ensure that no buffers are ever lost. Useful for example when switching from one video stream to another.
This behaviour is not described anywhere in the spec (and does not conflict with anything in the spec) but many other OpenMAX IL implements provide this behaviour. Also it should not break any existing software as it needs to be triggered by something that previously had no effect at all, and is probably quite easy to implement.
The text was updated successfully, but these errors were encountered: