<div dir="ltr"><div dir="ltr">seems the msg is ignored because the gstbus is flushing at that time.<div>is it a bug?</div><div><br></div><div><div>export GST_DEBUG=*:6</div><div>0:00:07.640203750 12491 0x34c35600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_pipeline> notifying about state-changed READY to NULL (VOID_PENDING pending)</div><div>0:00:07.640232375 12491 0x34c35600 LOG GST_MESSAGE gstmessage.c:301:gst_message_new_custom: source my_pipeline: creating new message 0x34db4480 state-changed</div><div>0:00:07.640260500 12491 0x34c35600 DEBUG GST_BUS gstbus.c:318:gst_bus_post:<bus1> [msg 0x34db4480] posting on bus state-changed message: 0x34db4480, time 99:99:99.999999999, seq-num 192, element 'my_pipeline', GstMessageStateChanged, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_NULL, pending-state=(GstState)GST_STATE_VOID_PENDING;</div><div>0:00:07.640319750 12491 0x34c35600 DEBUG GST_BUS gstbus.c:410:gst_bus_post:<bus1> bus is flushing</div><div>0:00:07.640342000 12491 0x34c35600 LOG GST_MESSAGE gstmessage.c:208:_gst_message_free: finalize message 0x34db4480, state-changed from my_pipeline</div><div>0:00:07.640369750 12491 0x34c35600 LOG GST_STATES gstelement.c:3004:gst_element_change_state:<my_pipeline> exit state change 1</div><div>0:00:07.640391250 12491 0x34c35600 LOG GST_STATES gstelement.c:3004:gst_element_change_state:<my_pipeline> exit state change 1</div><div>0:00:07.640411500 12491 0x34c35600 LOG GST_STATES gstelement.c:3004:gst_element_change_state:<my_pipeline> exit state change 1</div><div>0:00:07.640432875 12491 0x34c35600 DEBUG GST_STATES gstelement.c:2911:gst_element_set_state_func:<my_pipeline> returned SUCCESS</div><div><br></div><div>gstbus.c</div><div> 407 /* ERRORS */</div><div> 408 is_flushing:</div><div> 409 {</div><div> 410 GST_DEBUG_OBJECT (bus, "bus is flushing");</div><div> 411 GST_OBJECT_UNLOCK (bus);</div><div> 412 gst_message_unref (message);</div><div> 413</div><div> 414 return FALSE;</div><div> 415 }</div><div> 416 }</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Halley Zhao <<a href="mailto:aihua.halley.zhao@gmail.com">aihua.halley.zhao@gmail.com</a>> 于2019年5月8日周三 上午10:28写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">export GST_DEBUG=*:4</div><div dir="ltr">there is gst log"<my_pipeline> notifying about state-changed READY to NULL (VOID_PENDING pending)", but no msg got on GstBus</div><div dir="ltr"><br></div><div dir="ltr"><div>here are the log:</div><div><br></div><div><div>(bus_call, 84)my_pipeline state change, old state: PLAYING, new state: PAUSED</div><div>0:00:05.294249625 12094 0xebc8600 INFO GST_STATES gstelement.c:2658:gst_element_continue_state:<my_pipeline> continue state change PAUSED to READY, final NULL</div><div>0:00:05.294405000 12094 0xebc8600 INFO GST_STATES gstbin.c:2504:gst_bin_element_set_state:<my_sink> current PAUSED pending VOID_PENDING, desired next READY</div><div>0:00:05.294566500 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_sink> completed state change to READY</div><div>0:00:05.294626250 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_sink> notifying about state-changed PAUSED to READY (VOID_PENDING pending)</div><div>(bus_call, 84)my_sink state change, old state: PAUSED, new state: READY</div><div>0:00:05.294731000 12094 0xebc8600 INFO GST_STATES gstbin.c:2952:gst_bin_change_state_func:<my_pipeline> child 'my_sink' changed state to 2(READY) successfully</div><div>0:00:05.294849875 12094 0xebc8600 INFO GST_STATES gstbin.c:2504:gst_bin_element_set_state:<my_vdec> current PAUSED pending VOID_PENDING, desired next READY</div><div>0:00:05.317103625 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_vdec> completed state change to READY</div><div>0:00:05.317294250 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_vdec> notifying about state-changed PAUSED to READY (VOID_PENDING pending)</div><div>0:00:05.317593875 12094 0xebc8600 INFO GST_STATES gstbin.c:2952:gst_bin_change_state_func:<my_pipeline> child 'my_vdec' changed state to 2(READY) successfully</div><div>(bus_call, 84)my_vdec state change, old state: PAUSED, new state: READY</div><div>0:00:05.317717375 12094 0xebc8600 INFO GST_STATES gstbin.c:2504:gst_bin_element_set_state:<my_h264parse> current PAUSED pending VOID_PENDING, desired next READY</div><div>0:00:05.318214875 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_h264parse> completed state change to READY</div><div>0:00:05.318281375 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_h264parse> notifying about state-changed PAUSED to READY (VOID_PENDING pending)</div><div>(bus_call, 84)my_h264parse state change, old state: PAUSED, new state: READY</div><div>0:00:05.318393875 12094 0xebc8600 INFO GST_STATES gstbin.c:2952:gst_bin_change_state_func:<my_pipeline> child 'my_h264parse' changed state to 2(READY) successfully</div><div>0:00:05.318517750 12094 0xebc8600 INFO GST_STATES gstbin.c:2504:gst_bin_element_set_state:<my_appsrc> current PAUSED pending VOID_PENDING, desired next READY</div><div>0:00:05.318673500 12094 0xed408a0 INFO task gsttask.c:318:gst_task_func:<my_appsrc:src> Task resume from paused</div><div>0:00:05.319093500 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_appsrc> completed state change to READY</div><div>0:00:05.319155625 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_appsrc> notifying about state-changed PAUSED to READY (VOID_PENDING pending)</div><div>(bus_call, 84)my_appsrc state change, old state: PAUSED, new state: READY</div><div>0:00:05.319267375 12094 0xebc8600 INFO GST_STATES gstbin.c:2952:gst_bin_change_state_func:<my_pipeline> child 'my_appsrc' changed state to 2(READY) successfully</div><div>0:00:05.319451375 12094 0xebc8600 INFO GST_STATES gstelement.c:2651:gst_element_continue_state:<my_pipeline> committing state from PAUSED to READY, pending NULL, next NULL</div><div>0:00:05.319526500 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_pipeline> notifying about state-changed PAUSED to READY (NULL pending)</div><div>(bus_call, 84)my_pipeline state change, old state: PAUSED, new state: READY</div><div>0:00:05.319628625 12094 0xebc8600 INFO GST_STATES gstelement.c:2658:gst_element_continue_state:<my_pipeline> continue state change READY to NULL, final NULL</div><div>0:00:05.319799625 12094 0xebc8600 INFO GST_STATES gstbin.c:2504:gst_bin_element_set_state:<my_sink> current READY pending VOID_PENDING, desired next NULL</div><div>0:00:06.443495875 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_sink> completed state change to NULL</div><div>0:00:06.443610625 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_sink> notifying about state-changed READY to NULL (VOID_PENDING pending)</div><div>0:00:06.443782875 12094 0xebc8600 INFO GST_STATES gstbin.c:2952:gst_bin_change_state_func:<my_pipeline> child 'my_sink' changed state to 1(NULL) successfully</div><div>(bus_call, 84)my_sink state change, old state: READY, new state: NULL</div><div>0:00:06.443899625 12094 0xebc8600 INFO GST_STATES gstbin.c:2504:gst_bin_element_set_state:<my_vdec> current READY pending VOID_PENDING, desired next NULL</div><div>0:00:06.450190250 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_vdec> completed state change to NULL</div><div>0:00:06.450258625 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_vdec> notifying about state-changed READY to NULL (VOID_PENDING pending)</div><div>(bus_call, 84)my_vdec state change, old state: READY, new state: NULL</div><div>0:00:06.450385750 12094 0xebc8600 INFO GST_STATES gstbin.c:2952:gst_bin_change_state_func:<my_pipeline> child 'my_vdec' changed state to 1(NULL) successfully</div><div>0:00:06.450535125 12094 0xebc8600 INFO GST_STATES gstbin.c:2504:gst_bin_element_set_state:<my_h264parse> current READY pending VOID_PENDING, desired next NULL</div><div>0:00:06.450629625 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_h264parse> completed state change to NULL</div><div>0:00:06.450687375 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_h264parse> notifying about state-changed READY to NULL (VOID_PENDING pending)</div><div>(bus_call, 84)my_h264parse state change, old state: READY, new state: NULL</div><div>0:00:06.450794500 12094 0xebc8600 INFO GST_STATES gstbin.c:2952:gst_bin_change_state_func:<my_pipeline> child 'my_h264parse' changed state to 1(NULL) successfully</div><div>0:00:06.450913125 12094 0xebc8600 INFO GST_STATES gstbin.c:2504:gst_bin_element_set_state:<my_appsrc> current READY pending VOID_PENDING, desired next NULL</div><div>0:00:06.451000500 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_appsrc> completed state change to NULL</div><div>0:00:06.451056625 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_appsrc> notifying about state-changed READY to NULL (VOID_PENDING pending)</div><div>(bus_call, 84)my_appsrc state change, old state: READY, new state: NULL</div><div>0:00:06.451159125 12094 0xebc8600 INFO GST_STATES gstbin.c:2952:gst_bin_change_state_func:<my_pipeline> child 'my_appsrc' changed state to 1(NULL) successfully</div><div>0:00:06.451296000 12094 0xebc8600 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<my_pipeline> completed state change to NULL</div><div>0:00:06.451355500 12094 0xebc8600 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<my_pipeline> notifying about state-changed READY to NULL (VOID_PENDING pending)</div><div>(main, 282)unref the pipeline</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Halley Zhao <<a href="mailto:aihua.halley.zhao@gmail.com" target="_blank">aihua.halley.zhao@gmail.com</a>> 于2019年5月8日周三 上午10:05写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi experts:</div><div>I want to do cleanup after pipeline changed to GST_STATE_NULL. however I received GST_MESSAGE_STATE_CHANGED with newstate of GST_STATE_NULL of its children element, but not the pipeline itself.</div><div><br></div><div>I don't know whether there is something wrong in my code, or it is by design?</div><div>my pipeline contains "appsrc-->h264parse-->videodecode-->appsink". here is my log:</div><div>the source code sees attachment</div><div><br></div><div><div>(cb_need_data, 148)emit eos signal</div><div>(bus_call, 61)End of stream</div><div><br></div><div>(bus_call, 84)my_sink state change, old state: PLAYING, new state: PAUSED</div><div>(bus_call, 84)my_vdec state change, old state: PLAYING, new state: PAUSED</div><div>(bus_call, 84)my_h264parse state change, old state: PLAYING, new state: PAUSED</div><div>(bus_call, 84)my_appsrc state change, old state: PLAYING, new state: PAUSED</div><div>(bus_call, 84)my_pipeline state change, old state: PLAYING, new state: PAUSED</div><div>(bus_call, 84)my_sink state change, old state: PAUSED, new state: READY</div><div>(bus_call, 84)my_vdec state change, old state: PAUSED, new state: READY</div><div>(bus_call, 84)my_h264parse state change, old state: PAUSED, new state: READY</div><div>(bus_call, 84)my_appsrc state change, old state: PAUSED, new state: READY</div><div>(bus_call, 84)my_pipeline state change, old state: PAUSED, new state: READY</div><div>(bus_call, 84)my_sink state change, old state: READY, new state: NULL</div><div>(bus_call, 84)my_vdec state change, old state: READY, new state: NULL</div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div>