bin: Fix bin won't post async done message to parent while nothing pending in state changing

When we run Cheese 41.1 on our imx platform, Cheese preview freeze
at first frame.

During pipeline state changing from NULL to PLAYING, if there are
both elements that state change asynchronously and state change
with no preroll in the bin, the element inside may send ASYNC_DONE
message to it, while the bin's pending state is VOID_PENDING.

In this case, the bin will not post ASYNC_DONE message to parent
bin, which makes parent bin thinks that there are still elements
in it that haven't completed state changing, causing the pipeline
freeze in an intermediate state.

This commit modifies the bin_handle_async_done() function. When the
bin, whose pending state is VOIDING_PENDING, receives the ASYNC_DONE
message, it will also post this message to its parent bin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3490>
This commit is contained in:
Chao Guo 2022-11-29 18:32:09 +08:00 committed by GStreamer Marge Bot
parent 0f8785cbc6
commit dfa8661334

View file

@ -3496,6 +3496,13 @@ was_busy:
nothing_pending:
{
GST_CAT_INFO_OBJECT (GST_CAT_STATES, bin, "nothing pending");
amessage = gst_message_new_async_done (GST_OBJECT_CAST (bin), running_time);
GST_OBJECT_UNLOCK (bin);
gst_element_post_message (GST_ELEMENT_CAST (bin), amessage);
GST_OBJECT_LOCK (bin);
return;
}
}