gst main loop runs even when eos send to pipeline

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

gst main loop runs even when eos send to pipeline

umit
Hi,

I have a frustrating situation where I can't stop gstreamer main loop with
gst_element_send_event(gstPipeline, gst_event_new_eos()) called from user
thread.

This is the pipeline string I'm using for gst_parse_launch:

"udpsrc port=43444 ! video/mpegts ! tsdemux !
video/x-h264,stream-format=byte-stream,alignment=nal ! appsink
name=appsinkname sync=false drop=true max-buffers=1
enable-last-sample=false"

below is the GST_DEBUG output:


0:00:17.417792400 17008 0000017A18B67900 INFO                 basesrc
gstbasesrc.c:2854:gst_base_src_loop:<udpsrc0> pausing after
gst_base_src_get_range() = flushing0:00:17.417827800 17008 0000017A18B67900
INFO                    task gsttask.c:312:gst_task_func:<udpsrc0:src> Task
going to paused
0:00:17.417846800 17008 0000017A18B67900 INFO                    task
gsttask.c:314:gst_task_func:<udpsrc0:src> Task resume from paused
0:00:17.417865400 17008 0000017A18B67900 INFO                 basesrc
gstbasesrc.c:2854:gst_base_src_loop:<udpsrc0> pausing after
gst_base_src_get_range() = eos
0:00:17.417896700 17008 0000017A18B67900 INFO                    task
gsttask.c:312:gst_task_func:<udpsrc0:src> Task going to paused
0:00:17.418003800 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<appsinkname> current NULL pending
VOID_PENDING, desired next READY
0:00:17.418079600 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<appsinkname> completed state
change to READY
0:00:17.418101300 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<appsinkname> notifying
about state-changed NULL to READY (VOID_PENDING pending)
0:00:17.418133300 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'appsinkname'
changed state to 2(READY) successfully
0:00:17.418156900 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<capsfilter2> current NULL pending
VOID_PENDING, desired next READY
0:00:17.418162500 17008 0000017A18BA63F0 INFO           GST_PARENTAGE
gstbin.c:4467:gst_bin_get_by_name: [pipeline1]: looking up child element
appsinkname
0:00:17.418185300 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<capsfilter2> completed state
change to READY
0:00:17.418243600 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<capsfilter2> notifying
about state-changed NULL to READY (VOID_PENDING pending)
0:00:17.418263300 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'capsfilter2'
changed state to 2(READY) successfully
0:00:17.418279600 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<rtph264depay0> current NULL pending
VOID_PENDING, desired next READY
0:00:17.418313500 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<rtph264depay0> completed state
change to READY
0:00:17.418340900 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<rtph264depay0> notifying
about state-changed NULL to READY (VOID_PENDING pending)
0:00:17.418384300 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'rtph264depay0'
changed state to 2(READY) successfully
0:00:17.418398700 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<udpsrc1> current NULL pending
VOID_PENDING, desired next READY
0:00:17.418617100 17008 0000017A18BA60C0 INFO                  udpsrc
gstudpsrc.c:1459:gst_udpsrc_open:<udpsrc1> have udp buffer of 65536 bytes
0:00:17.418645100 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<udpsrc1> completed state
change to READY
0:00:17.418716000 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<udpsrc1> notifying about
state-changed NULL to READY (VOID_PENDING pending)
0:00:17.418737000 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'udpsrc1' changed
state to 2(READY) successfully
0:00:17.418754500 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2651:gst_element_continue_state:<pipeline1> committing state
from NULL to READY, pending PLAYING, next PAUSED
0:00:17.418768800 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<pipeline1> notifying
about state-changed NULL to READY (PLAYING pending)
0:00:17.418785700 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2658:gst_element_continue_state:<pipeline1> continue state
change READY to PAUSED, final PLAYING
0:00:17.418805300 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<appsinkname> current READY pending
VOID_PENDING, desired next PAUSED
0:00:17.418824400 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2957:gst_bin_change_state_func:<pipeline1> child 'appsinkname' is
changing state asynchronously to PAUSED
0:00:17.418839900 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<capsfilter2> current READY pending
VOID_PENDING, desired next PAUSED
0:00:17.418855800 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<capsfilter2> completed state
change to PAUSED
0:00:17.418870100 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<capsfilter2> notifying
about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:17.418899400 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'capsfilter2'
changed state to 3(PAUSED) successfully
0:00:17.418918600 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<rtph264depay0> current READY
pending VOID_PENDING, desired next PAUSED
0:00:17.418936000 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<rtph264depay0> completed state
change to PAUSED
0:00:17.418950400 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<rtph264depay0> notifying
about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:17.418971500 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'rtph264depay0'
changed state to 3(PAUSED) successfully
0:00:17.418998700 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<udpsrc1> current READY pending
VOID_PENDING, desired next PAUSED
0:00:17.419044400 17008 0000017A18BA60C0 INFO                 basesrc
gstbasesrc.c:1373:gst_base_src_do_seek:<udpsrc1> seeking: time segment
start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.000000000, duration
99:99:99.999999999
0:00:17.419099900 17008 0000017A18BA60C0 INFO                    task
gsttask.c:453:gst_task_set_lock: setting stream lock 0000017A18BD0210 on
task 0000017A18B6BDD0
0:00:17.419114100 17008 0000017A18BA60C0 INFO                GST_PADS
gstpad.c:6158:gst_pad_start_task:<udpsrc1:src> created task 0000017A18B6BDD0
0:00:17.419221800 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<udpsrc1> completed state
change to PAUSED
0:00:17.423411600 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<udpsrc1> notifying about
state-changed READY to PAUSED (VOID_PENDING pending)
0:00:17.423445800 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2994:gst_bin_change_state_func:<pipeline1> child 'udpsrc1' changed
state to 3(PAUSED) successfully without preroll
0:00:17.423477300 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2651:gst_element_continue_state:<pipeline1> committing state
from READY to PAUSED, pending PLAYING, next PLAYING
0:00:17.423503800 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<pipeline1> notifying
about state-changed READY to PAUSED (PLAYING pending)
0:00:17.423530300 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2658:gst_element_continue_state:<pipeline1> continue state
change PAUSED to PLAYING, final PLAYING
0:00:17.423584600 17008 0000017A18BA60C0 INFO               GST_EVENT
gstevent.c:1450:gst_event_new_latency: creating latency event
0:00:00.000000000
0:00:17.423995900 17008 0000017A18B67EC0 INFO        GST_ELEMENT_PADS
gstelement.c:913:gst_element_get_static_pad: no such pad 'sink' in element
"udpsrc1"
0:00:17.424052800 17008 0000017A18BA60C0 INFO                     bin
gstbin.c:2780:gst_bin_do_latency_func:<pipeline1> configured latency of
0:00:00.000000000
0:00:17.424078100 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<appsinkname> current READY pending
PAUSED, desired next PLAYING
0:00:17.424093900 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2957:gst_bin_change_state_func:<pipeline1> child 'appsinkname' is
changing state asynchronously to PLAYING
0:00:17.424112000 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<capsfilter2> current PAUSED pending
VOID_PENDING, desired next PLAYING
0:00:17.424128000 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<capsfilter2> completed state
change to PLAYING
0:00:17.424144600 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<capsfilter2> notifying
about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:17.424167300 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'capsfilter2'
changed state to 4(PLAYING) successfully
0:00:17.424102900 17008 0000017A18B67EC0 INFO               GST_EVENT
gstevent.c:820:gst_event_new_caps: creating caps event application/x-rtp,
encoding-name=(string)H264, clock-rate=(int)90000, payload=(int)96,
media=(string)video
0:00:17.424192100 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<rtph264depay0> current PAUSED
pending VOID_PENDING, desired next PLAYING
0:00:17.424261300 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<rtph264depay0> completed state
change to PLAYING
0:00:17.424272600 17008 0000017A18B67EC0 INFO               GST_EVENT
gstevent.c:820:gst_event_new_caps: creating caps event video/x-h264,
stream-format=(string)byte-stream, alignment=(string)au
0:00:17.424279700 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<rtph264depay0> notifying
about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:17.424307400 17008 0000017A18B67EC0 INFO           basetransform
gstbasetransform.c:1317:gst_base_transform_setcaps:<capsfilter2> reuse caps
0:00:17.424331100 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'rtph264depay0'
changed state to 4(PLAYING) successfully
0:00:17.424349100 17008 0000017A18B67EC0 INFO               GST_EVENT
gstevent.c:820:gst_event_new_caps: creating caps event video/x-h264,
stream-format=(string)byte-stream, alignment=(string)au
0:00:17.424386900 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2676:gst_element_continue_state:<udpsrc1> completed state
change to PLAYING
0:00:17.424428300 17008 0000017A18B67EC0 INFO               GST_EVENT
gstevent.c:820:gst_event_new_caps: creating caps event video/x-h264,
stream-format=(string)byte-stream, alignment=(string)au
0:00:17.424441700 17008 0000017A18BA60C0 INFO              GST_STATES
gstelement.c:2579:_priv_gst_element_state_changed:<udpsrc1> notifying about
state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:17.424490300 17008 0000017A18BA60C0 INFO              GST_STATES
gstbin.c:2951:gst_bin_change_state_func:<pipeline1> child 'udpsrc1' changed
state to 4(PLAYING) successfully


Somehow pipeline items are going from PLAYING state to PAUSED state, and
then they go PLAYING again as seen above.
An important information is that pipeline do not stop if I don't send any
video data to above port, but it stops perfectly if any video data is sent
to the port.

Note that, gst version is 1.16.0.

Can someone please help?

Thanks,





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst main loop runs even when eos send to pipeline

umit
Is it a good idea to just g_main_loop_quit(loop) instead of
gst_element_send_event(gstPipeline, gst_event_new_eos()) to return from
g_main_loop_run (loop)?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst main loop runs even when eos send to pipeline

Olivier Crête-3
Hi,

GStreamer doesn't control the main loop, we only use it to give messages back to the application. It's your responsability to start and stop it. So yes, you must call g_main_loop_quit() to stop it.

OIivier

On Tue, 2020-07-14 at 02:07 -0500, umit wrote:
Is it a good idea to just g_main_loop_quit(loop) instead of
gst_element_send_event(gstPipeline, gst_event_new_eos()) to return from
g_main_loop_run (loop)?



--
Sent from: 
http://gstreamer-devel.966125.n4.nabble.com/

_______________________________________________
gstreamer-devel mailing list
[hidden email]

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-- 
Olivier Crête


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel