Hey Mark,<br>Try this.<br><a href="http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt">http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt</a><br>Hope it works for you.<br>
<br>Regards,<br>Vikram<br><div class="gmail_quote">On Fri, Aug 24, 2012 at 11:15 PM, markymark <span dir="ltr"><<a href="mailto:mark.rollins@yahoo.com" target="_blank">mark.rollins@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
0 down vote favorite<br>
<br>
<br>
I'm looking for the correct technique, if one exists, for dynamically<br>
replacing an element in a running gstreamer pipeline. I have a gstreamer<br>
based c++ app and the pipeline it creates looks like this (using gst-launch<br>
syntax) :<br>
<br>
souphttpsrc location="<a href="http://localhost/local.ts" target="_blank">http://localhost/local.ts</a>" ! mpegtsdemux name=d !<br>
queue ! mpeg2dec ! xvimagesink d. ! queue ! a52dec ! pulsesink<br>
<br>
During the middle of playback (i.e. GST_STATE_PLAYING is the pipeline state<br>
and the user is happily watching video), I need to remove souphttpsrc from<br>
the pipeline and create a new souphttpsrc, or even a new neonhttpsource, and<br>
then immediately add that back into the pipeline and continue playback of<br>
the same uri source stream at the same time position where playback was<br>
before we performed this operation. The user might see a small delay and<br>
that is fine.<br>
<br>
We've barely figured out how to remove and replace the source, and we need<br>
more understanding. Here's our best attempt thus far:<br>
<br>
gst_element_unlink(source, demuxer);<br>
gst_element_set_state(source, GST_STATE_NULL);<br>
gst_bin_remove(GST_BIN(pipeline), source);<br>
source = gst_element_factory_make("souphttpsrc", "src");<br>
g_object_set(G_OBJECT(source), "location", url, NULL);<br>
gst_bin_add(GST_BIN(pipeline), source);<br>
gst_element_link(source, demuxer);<br>
gst_element_sync_state_with_parent(source);<br>
<br>
This doesn't work perfectly because the source is playing back from the<br>
beginning and the rest of the pipeline is waiting for the correct<br>
timestamped buffers (I assume) because after several seconds, playback picks<br>
back up. I tried seeking the source in multiple ways but nothing has worked.<br>
<br>
I need to know the correct way to do this. It would be nice to know a<br>
general technique, if one exists, as well, in case we wanted to dynamically<br>
replace the decoder or some other element.<br>
<br>
thanks<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/dynamically-replacing-elements-in-a-playing-gstreamer-pipeline-tp4656068.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/dynamically-replacing-elements-in-a-playing-gstreamer-pipeline-tp4656068.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br>