Why calling methods on gstreamer sometimes is blocking forever ?

Krutskikh Ivan stein.hak at gmail.com
Mon Dec 12 14:58:56 UTC 2016


Oh yeah, this... Try inserting get_state with timeout after sending
pipeline to NULL

2016-12-12 16:14 GMT+03:00 Nicolas Castillejos <djos06 at gmail.com>:

>
> I've found more informations :
> It only hangs when the return of the stop() method (setState(NULL)) is
> ASYNC !
> When it is success it doesn't hangs .
> How does it works when it is async ?
> where can I define a method/listener/handler to receive async results ?
>
> You can see here the gstreamer "GST_STATES"  logs, you can see that it
> finishes by
>
> 0:00:11.890189502  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<source> final: setting
> state from PLAYING to PAUSED
>
> 0:00:11.905778577  8208   15E4AAE0 DEBUG             GST_STATES
> gstelement.c:2020:gst_element_get_state_func:<source> getting state,
> timeout 99:99:99.999999999
>
> 0:00:11.905801989  8208   15E4AAE0 DEBUG             GST_STATES
> gstelement.c:2025:gst_element_get_state_func:<source> RETURN is ASYNC
>
> 0:00:11.905814176  8208   15E4AAE0 INFO              GST_STATES
> gstelement.c:2048:gst_element_get_state_func:<source> waiting for element
> to commit state
>
>
> It seems that is it waiting for ever (timeout 99:99:99.999999999) an
> element state change but it nevers happends why ?
>
> Here are full logs starting from the call of stop() method on pipeline
> object :
>
> 0:00:11.888218377  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<main pipeline> set_state to
> NULL
>
> 0:00:11.888247883  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<main pipeline> setting
> target state to NULL
>
> 0:00:11.888261353  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<main pipeline> current
> PLAYING, old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.888279955  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<main pipeline>
> intermediate: setting state from PLAYING to PAUSED
>
> 0:00:11.888302084  8208   224AE280 DEBUG             GST_STATES
> gstbin.c:2591:gst_bin_change_state_func:<main pipeline> changing state of
> children from PLAYING to PAUSED
>
> 0:00:11.888395092  8208   224AE280 INFO              GST_STATES
> gstbin.c:2243:gst_bin_element_set_state:<Video Bin> current PLAYING
> pending VOID_PENDING, desired next PAUSED
>
> 0:00:11.888413694  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<Video Bin> set_state to
> PAUSED
>
> 0:00:11.888425560  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<Video Bin> setting target
> state to PAUSED
>
> 0:00:11.888441917  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<Video Bin> current PLAYING,
> old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.888463084  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<Video Bin> final: setting
> state from PLAYING to PAUSED
>
> 0:00:11.888478479  8208   224AE280 DEBUG             GST_STATES
> gstbin.c:2591:gst_bin_change_state_func:<Video Bin> changing state of
> children from PLAYING to PAUSED
>
> 0:00:11.888503815  8208   224AE280 INFO              GST_STATES
> gstbin.c:2243:gst_bin_element_set_state:<GstVideoComponent> current
> PLAYING pending VOID_PENDING, desired next PAUSED
>
> 0:00:11.888517285  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<GstVideoComponent>
> set_state to PAUSED
>
> 0:00:11.888527869  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<GstVideoComponent> setting
> target state to PAUSED
>
> 0:00:11.888570204  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<GstVideoComponent> current
> PLAYING, old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.888584636  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<GstVideoComponent> final:
> setting state from PLAYING to PAUSED
>
> 0:00:11.888607407  8208   224AE280 DEBUG             GST_STATES
> gstbin.c:3124:bin_handle_async_start:<Video Bin> state change busy
>
> 0:00:11.888622160  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2620:gst_element_change_state:<GstVideoComponent> element
> will change state ASYNC
>
> 0:00:11.888635951  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2565:gst_element_set_state_func:<GstVideoComponent> returned
> ASYNC
>
> 0:00:11.888650062  8208   224AE280 INFO              GST_STATES
> gstbin.c:2713:gst_bin_change_state_func:<Video Bin> child
> 'GstVideoComponent' is changing state asynchronously to PAUSED
>
> 0:00:11.888668022  8208   224AE280 INFO              GST_STATES
> gstbin.c:2243:gst_bin_element_set_state:<capsfilter> current PLAYING
> pending VOID_PENDING, desired next PAUSED
>
> 0:00:11.888681492  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<capsfilter> set_state to
> PAUSED
>
> 0:00:11.888695283  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<capsfilter> setting target
> state to PAUSED
>
> 0:00:11.888709074  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<capsfilter> current
> PLAYING, old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.888723185  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<capsfilter> final: setting
> state from PLAYING to PAUSED
>
> 0:00:11.888738259  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2638:gst_element_change_state:<capsfilter> element changed
> state SUCCESS
>
> 0:00:11.888753012  8208   224AE280 INFO              GST_STATES
> gstelement.c:2330:gst_element_continue_state:<capsfilter> completed state
> change to PAUSED
>
> 0:00:11.888768086  8208   224AE280 INFO              GST_STATES
> gstelement.c:2235:_priv_gst_element_state_changed:<capsfilter> notifying
> about state-changed PLAYING to PAUSED (VOID_PENDING pending)
>
> 0:00:11.888987456  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2565:gst_element_set_state_func:<capsfilter> returned SUCCESS
>
> 0:00:11.889003813  8208   224AE280 INFO              GST_STATES
> gstbin.c:2707:gst_bin_change_state_func:<Video Bin> child 'capsfilter'
> changed state to 3(PAUSED) successfully
>
> 0:00:11.889020169  8208   224AE280 INFO              GST_STATES
> gstbin.c:2243:gst_bin_element_set_state:<videoconvert> current PLAYING
> pending VOID_PENDING, desired next PAUSED
>
> 0:00:11.889036846  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<videoconvert> set_state to
> PAUSED
>
> 0:00:11.889049675  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<videoconvert> setting
> target state to PAUSED
>
> 0:00:11.889063145  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<videoconvert> current
> PLAYING, old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.889077898  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<videoconvert> final:
> setting state from PLAYING to PAUSED
>
> 0:00:11.889097783  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2638:gst_element_change_state:<videoconvert> element changed
> state SUCCESS
>
> 0:00:11.889109970  8208   224AE280 INFO              GST_STATES
> gstelement.c:2330:gst_element_continue_state:<videoconvert> completed
> state change to PAUSED
>
> 0:00:11.889122478  8208   224AE280 INFO              GST_STATES
> gstelement.c:2235:_priv_gst_element_state_changed:<videoconvert>
> notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
>
> 0:00:11.889230880  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2565:gst_element_set_state_func:<videoconvert> returned
> SUCCESS
>
> 0:00:11.889245954  8208   224AE280 INFO              GST_STATES
> gstbin.c:2707:gst_bin_change_state_func:<Video Bin> child 'videoconvert'
> changed state to 3(PAUSED) successfully
>
> 0:00:11.889261027  8208   224AE280 INFO              GST_STATES
> gstbin.c:2243:gst_bin_element_set_state:<H264 Decoder> current PLAYING
> pending VOID_PENDING, desired next PAUSED
>
> 0:00:11.889273856  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<H264 Decoder> set_state to
> PAUSED
>
> 0:00:11.889289571  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<H264 Decoder> setting
> target state to PAUSED
>
> 0:00:11.889302400  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<H264 Decoder> current
> PLAYING, old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.889320039  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<H264 Decoder> final:
> setting state from PLAYING to PAUSED
>
> 0:00:11.889334471  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2638:gst_element_change_state:<H264 Decoder> element changed
> state SUCCESS
>
> 0:00:11.889346659  8208   224AE280 INFO              GST_STATES
> gstelement.c:2330:gst_element_continue_state:<H264 Decoder> completed
> state change to PAUSED
>
> 0:00:11.889359487  8208   224AE280 INFO              GST_STATES
> gstelement.c:2235:_priv_gst_element_state_changed:<H264 Decoder>
> notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
>
> 0:00:11.889468852  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2565:gst_element_set_state_func:<H264 Decoder> returned
> SUCCESS
>
> 0:00:11.889483605  8208   224AE280 INFO              GST_STATES
> gstbin.c:2707:gst_bin_change_state_func:<Video Bin> child 'H264 Decoder'
> changed state to 3(PAUSED) successfully
>
> 0:00:11.889497716  8208   224AE280 INFO              GST_STATES
> gstbin.c:2243:gst_bin_element_set_state:<h264parse> current PLAYING
> pending VOID_PENDING, desired next PAUSED
>
> 0:00:11.889514393  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<h264parse> set_state to
> PAUSED
>
> 0:00:11.889526581  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<h264parse> setting target
> state to PAUSED
>
> 0:00:11.889540372  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<h264parse> current PLAYING,
> old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.889553842  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<h264parse> final: setting
> state from PLAYING to PAUSED
>
> 0:00:11.889566991  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2638:gst_element_change_state:<h264parse> element changed
> state SUCCESS
>
> 0:00:11.889579178  8208   224AE280 INFO              GST_STATES
> gstelement.c:2330:gst_element_continue_state:<h264parse> completed state
> change to PAUSED
>
> 0:00:11.889594252  8208   224AE280 INFO              GST_STATES
> gstelement.c:2235:_priv_gst_element_state_changed:<h264parse> notifying
> about state-changed PLAYING to PAUSED (VOID_PENDING pending)
>
> 0:00:11.889692391  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2565:gst_element_set_state_func:<h264parse> returned SUCCESS
>
> 0:00:11.889707144  8208   224AE280 INFO              GST_STATES
> gstbin.c:2707:gst_bin_change_state_func:<Video Bin> child 'h264parse'
> changed state to 3(PAUSED) successfully
>
> 0:00:11.889719652  8208   224AE280 DEBUG             GST_STATES
> gstbin.c:2766:gst_bin_change_state_func:<Video Bin> iterator done
>
> 0:00:11.889729594  8208   224AE280 DEBUG             GST_STATES
> gstbin.c:2784:gst_bin_change_state_func:<Video Bin> we have ASYNC
> elements SUCCESS -> ASYNC
>
> 0:00:11.889741782  8208   224AE280 DEBUG             GST_STATES
> gstbin.c:2835:gst_bin_change_state_func:<Video Bin> done changing bin's
> state from PLAYING to PAUSED, now in PLAYING, ret ASYNC
>
> 0:00:11.889806887  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2620:gst_element_change_state:<Video Bin> element will
> change state ASYNC
>
> 0:00:11.889821640  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2565:gst_element_set_state_func:<Video Bin> returned ASYNC
>
> 0:00:11.889837997  8208   224AE280 INFO              GST_STATES
> gstbin.c:2713:gst_bin_change_state_func:<main pipeline> child 'Video Bin'
> is changing state asynchronously to PAUSED
>
> 0:00:11.889855636  8208   224AE280 INFO              GST_STATES
> gstbin.c:2243:gst_bin_element_set_state:<tsdemux> current PLAYING pending
> VOID_PENDING, desired next PAUSED
>
> 0:00:11.889870389  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<tsdemux> set_state to PAUSED
>
> 0:00:11.889882576  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<tsdemux> setting target
> state to PAUSED
>
> 0:00:11.889895405  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<tsdemux> current PLAYING,
> old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.889908875  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<tsdemux> final: setting
> state from PLAYING to PAUSED
>
> 0:00:11.889920741  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2638:gst_element_change_state:<tsdemux> element changed
> state SUCCESS
>
> 0:00:11.889932287  8208   224AE280 INFO              GST_STATES
> gstelement.c:2330:gst_element_continue_state:<tsdemux> completed state
> change to PAUSED
>
> 0:00:11.889943192  8208   224AE280 INFO              GST_STATES
> gstelement.c:2235:_priv_gst_element_state_changed:<tsdemux> notifying
> about state-changed PLAYING to PAUSED (VOID_PENDING pending)
>
> 0:00:11.890091042  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2565:gst_element_set_state_func:<tsdemux> returned SUCCESS
>
> 0:00:11.890107078  8208   224AE280 INFO              GST_STATES
> gstbin.c:2707:gst_bin_change_state_func:<main pipeline> child 'tsdemux'
> changed state to 3(PAUSED) successfully
>
> 0:00:11.890121189  8208   224AE280 INFO              GST_STATES
> gstbin.c:2243:gst_bin_element_set_state:<source> current PLAYING pending
> VOID_PENDING, desired next PAUSED
>
> 0:00:11.890133377  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2481:gst_element_set_state_func:<source> set_state to PAUSED
>
> 0:00:11.890143319  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2506:gst_element_set_state_func:<source> setting target
> state to PAUSED
>
> 0:00:11.890172183  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2519:gst_element_set_state_func:<source> current PLAYING,
> old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
>
> 0:00:11.890189502  8208   224AE280 DEBUG             GST_STATES
> gstelement.c:2553:gst_element_set_state_func:<source> final: setting
> state from PLAYING to PAUSED
>
> 0:00:11.905778577  8208   15E4AAE0 DEBUG             GST_STATES
> gstelement.c:2020:gst_element_get_state_func:<source> getting state,
> timeout 99:99:99.999999999
>
> 0:00:11.905801989  8208   15E4AAE0 DEBUG             GST_STATES
> gstelement.c:2025:gst_element_get_state_func:<source> RETURN is ASYNC
>
> 0:00:11.905814176  8208   15E4AAE0 INFO              GST_STATES
> gstelement.c:2048:gst_element_get_state_func:<source> waiting for element
> to commit state
>
>
>
>
>
> Le 12/12/2016 à 10:47, Nicolas Castillejos a écrit :
>
> Hello,
>
> Thank you for your answers, I put my java code in attachment .
> I don't really think it comes from my application.
> As you can see, my code is really simple. I fill the appsrc with a byte
> array. There is no possible deadlock I can see.
> I understand the multi-process solution, but it is a pain to do this as I
> have to display video pictures in my java application.
> Do you think it can be a problem with the java mapping ? it is not the
> first time I met problems with it so....
>
> Nicolas Castillejos
>
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161212/267927d2/attachment-0001.html>


More information about the gstreamer-devel mailing list