[gst-devel] Changing File Locations with Container Formats That Have Headers
wmiller at sdr.com
Fri Jul 9 16:07:21 CEST 2010
Here is what i have gathered is supposed to happen to accomplish changing
filesink output file locations in a running pipeline.
The pipeline ends with "...! queue2 name="q1" ! matroksamux name-mux !
filesink name="fsink" "
I build mine using
- The pipeline is in GST_STATE_PLAYING.
- The g_main_loop is running.
- The first location output file is being filled with data.
- There is a callback for bus messages.
When it comes time to swap output files: (for me this is in a timer
- block the src pad of q1
q1_srcpad = gst_element_get_static_pad( q1, "src" );
rc = gst_pad_set_blocked_async( q1_srcpad, true, Q1Blocked, NULL
in the callback Q1Blocked()
- send an EOS to mux
- This should pass down to fsink and cause t he mux to write its
rc = gst_element_send_event( mux, gst_event_new_eos() );
in the bus messages callback handler, bus_call():
- detect we got the EOS
- set mux and fsink to GST_STATE_NULL
- change the location
- unblock the q1 src pad
rc = gst_element_set_state( mux, GST_STATE_NULL );
rc = gst_element_set_state( sink, GST_STATE_NULL );
g_object_set( G_OBJECT( sink ), "location", newOutFileName,
gst_pad_set_blocked_async( that->q1src, false, Q1UnBlocked,
in Q1UnBlocked() callback handler:
- return mux and fsink to GST_SATE_PLAYING
rc = gst_element_set_state( mux, GST_STATE_PLAYING );
rc = gst_element_set_state( fsink, GST_STATE_PLAYING );
And that's where I run into a brick wall. The rc from setting fsink to
GST_STATE_PLAYING is 2, GST_STATE_CHANGE_ASYNC.
Why does filesink not return to playing? Does setting it to STATE_NULL mean
that it disconnects from the mux? The mux src pad is an always pad and so
is the filesink sink pad. Is the mux unlinked from the queue?
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Changing-File-Locations-with-Container-Formats-That-Have-Headers-tp2283223p2283223.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel