[Bug 774600] omx: Pipeline premature EOS after discontinuity on lossy transport stream
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Mon Dec 12 11:50:24 UTC 2016
https://bugzilla.gnome.org/show_bug.cgi?id=774600
--- Comment #16 from minfrin at sharp.fm ---
> How would that help here? We would return EOS from acquire_buffer,
> which would shut down the caller. And if it doesn't, we would call
> back in here again and wait forever (the component usually gives
> you nothing new after EOS).
You're mixing up the gstreamer's view on EOS with OMX's implementation of EOS.
Inside OMX, the OMX_BUFFERFLAG_EOS flag's job is to tell you which packet
coming out of the codec corresponds with the packet with that same flag that
went into the codec, and that's it. There is no expectation in OMX that the
stream will be terminated.
Gstreamer uses the OMX EOS mechanism to implement drain, and while drain is
called just once at the end of a program stream, it will be called multiple
times in a live transport stream, specifically after each discontinuity in the
stream.
What makes things complicated is that we have a pending_buffers queue, and if
we just returned GST_OMX_ACQUIRE_BUFFER_EOS straight away, we would be
returning the flag too early. As a result we have an eos flag. As soon as we
see OMX_BUFFERFLAG_EOS we set the eos flag, then return buffers from the
pending_buffers queue until the queue is empty, then and only then do we send
the GST_OMX_ACQUIRE_BUFFER_EOS back to drain to signal we're done, and we need
to reset the eos flag at this point so we're back to our initial state where
drain can be called again.
If we don't set this back to false again, the drain mechanism works exactly
once. Directly after the drain is successfully completed we come around for the
next packet, eos is still true, GST_OMX_ACQUIRE_BUFFER_EOS is sent again (this
time in error), and given that the draining flag is false now, we simply follow
the exit path by returning GST_FLOW_EOS.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list