[gst-devel] Flow of EOS

Arnout Vandecappelle arnout at mind.be
Wed Aug 4 09:44:25 CEST 2010


 Hoi Wes,

 I can't say I know what the problem is exactly, but wouldn't it be 
safer/easier to just destroy the existing elements and create new ones?  One 
particular advantage is that you can give the filesink the time to flush 
while you continue streaming in a new file (this is particularly important 
for large files, since the matroskamux will spend a lot of time writing the 
index).  The disadvantage is that it's more work of course.

 By the way, why do you send EOS to the appsink and bring it down to NULL?  
I'd expect you could just leave it in PAUSED.  In that case, you don't need 
to restart the appsink branch.

 Regards,
 Arnout


On Friday 16 July 2010 22:48:11, Wes Miller wrote:
> This is a continuation of a previous question
> http://gstreamer-devel.966125.n4.nabble.com/Change-File-Locations-for-Con
> tainer-Formats-that-Have-Headers-tp2283747p2283747.html Change File
> Locations for Container Formats that Have Headers  .
> 
> My pipeline has grown more complicated and I have a new quirk that needs
> to be solved.  So,
> 
> The Pipe:
> 
>    Reads from a live source.  Writes to a filesink and an appsink.
> 
> 
>       souphttpsrc ->  multipartdemux ->  queue2   ->  tee  --,->  queue
> -->  matroskamux  --> filesink
>                                                           name=q0
> 
> |   name=q1
> 
> '->  queue   --> appsink
> 
> name=q2         :
> :.... (appsink handler)
> 
> The appsink handler is essentially:
> 
>      while ( true )
>           while ( appsink is not EOS )
>                sip from stream
>                print "tick" every 25th pass
>           end while
>     end while
> 
> 
> Expected Operation:
> 
>      Every 4 seconds a timer tells the src pad of q0 to block.
>      Q0Blocked callback sends EOS to sinkpads of q1 and q2.
>      EOS passes down both legs of the pipe
>      Either or both of filesink and appsink post EOS to bus
>      bus_callback
>        -  sets all elements from tee to appsink and to filesink to
> GST_STATE_NULL
>        -  change output file location of the filesink
>        -  sends unblock to src pad of q0
>      Q0UnBlocked handler
>        -  sets all elements from tee to appsink and to filesink to
> GST_STATE_PLAYING
>      Operation iterates.
> 
> Well, of course, this isn't what happens
> 
>   -  Eveerything goes as expected through the first pass.
>   -  Debug confirms that both sinks go to EOS
>   -  The bus_callback is called.
>         -  EOS is detected.
>         -  filesink set to GST_STATE_NULL - rc = 1
>         -  Unblock goes to q0:src.
>   -  Q0UnBlock is called-back.
>         -  Filesink set back to GST_STATE_PLAYING
>         -  Printf's show all elements are in PLAYING state,
>         -  filesink is async waiting
>   -  Debug output says src is getting and passing data to demux and then
> to q0.
>   -  Finally, At the end of the second buffer we see this:
> 
>      basesrc gstbasesrc.c:2473:gst_base_src_loop:            <my_src>
> pausing task, reason unexpected
>     GST_PADS gstpad.c:5250:gst_pad_pause_task:           <my_src:src>
> pause task
>         task gsttask.c:608:gst_task_set_state:<task3> Changing task
> 0xa2069d0 to state 2
>    GST_EVENT gstevent.c:269:gst_event_new: creating new event 0xa159450
> eos 86
>    GST_EVENT gstpad.c:5020:gst_pad_send_event:         <my_demux:sink>
> have event type eos
>     GST_PADS gstpad.c:3517:gst_pad_event_default:       <my_demux:sink>
> pausing task because of eos
>     GST_PADS gstpad.c:5250:gst_pad_pause_task:          <my_demux:sink>
> pause task
>     GST_PADS gstpad.c:5268:gst_pad_pause_task:          <my_demux:sink>
> pad has no task
>     GST_PADS gstpad.c:3417:gst_pad_event_default_dispatch:
> <my_demux:sink> Sending event 0xa159450 (eos) to all internally linked
> pads GST_PADS
> gstpad.c:3213:gst_pad_iterate_internal_links_default:<my_demux:sink>
> Making iterator
>    GST_EVENT gstpad.c:5020:gst_pad_send_event:<capsfilter0:sink> have
> event type eos
>    GST_EVENT gstpad.c:5020:gst_pad_send_event:       <my_queue0:sink>
> have event type eos
>     GST_PADS gstpad.c:5048:gst_pad_send_event:       <my_queue0:sink>
> sent event, result 1
>     GST_PADS gstpad.c:5048:gst_pad_send_event:<capsfilter0:sink> sent
> event, result 1
>     GST_PADS gstpad.c:5048:gst_pad_send_event:       <my_demux:sink> sent
> event, result 1
> 
> Many, many of these lines:
>      appsink gstappsink.c:976:gst_app_sink_is_eos:      <my_appsink> we
> are EOS and the queue is empty
> 
>    GST_EVENT gstpad.c:5020:gst_pad_send_event:      <my_tee:sink> have
> event type eos
>     GST_PADS gstpad.c:3517:gst_pad_event_default:    <my_tee:sink>
> pausing task because of eos
>     GST_PADS gstpad.c:5250:gst_pad_pause_task:       <my_tee:sink> pause
> task
>     GST_PADS gstpad.c:5268:gst_pad_pause_task:       <my_tee:sink> pad
> has no task
>     GST_PADS gstpad.c:3417:gst_pad_event_default_dispatch:
> <my_tee:sink> Sending event 0xa159450 (eos) to all internally linked pads
>     GST_PADS
> gstpad.c:3213:gst_pad_iterate_internal_links_default:<my_tee:sink> Making
> iterator
>    GST_EVENT gstpad.c:5020:gst_pad_send_event:      <my_queue2:sink> have
> event type eos
>       queue2 gstqueue2.c:1304:gst_queue2_handle_sink_event:
> <my_queue2> refusing event, we are flushing
>     GST_PADS gstpad.c:5048:gst_pad_send_event:       <my_queue2:sink>
> sent event, result 0
>    GST_EVENT gstpad.c:5020:gst_pad_send_event:      <my_queue1:sink> have
> event type eos
>       queue2 gstqueue2.c:1304:gst_queue2_handle_sink_event:
> <my_queue1> refusing event, we are flushing
>     GST_PADS gstpad.c:5048:gst_pad_send_event:       <my_queue1:sink>
> sent event, result 0
>     GST_PADS gstpad.c:5048:gst_pad_send_event:       <my_tee:sink> sent
> event, result 0
>     GST_PADS gstpad.c:5250:gst_pad_pause_task:       <my_queue0:src>
> pause task
>         task gsttask.c:608:gst_task_set_state:<task2> Changing task
> 0xa206948 to state 2
>      appsink gstappsink.c:976:gst_app_sink_is_eos:      <my_appsink> we
> are EOS and the queue is empty
> 
> And THOUSANDS of these lines...
>      appsink gstappsink.c:976:gst_app_sink_is_eos:      <my_appsink> we
> are EOS and the queue is empty
>      appsink gstappsink.c:976:gst_app_sink_is_eos:      <my_appsink> we
> are EOS and the queue is empty
> 
> 
> Any help greatly appreciated.
> 
> Wes

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43




More information about the gstreamer-devel mailing list