[gst-devel] Playing/pausing/swapping separate bins/elements within a running pipeline - pause problem

Donny Viszneki donny.viszneki at gmail.com
Mon Feb 1 12:37:18 CET 2010


I don't think what you're trying to do is supported by the API

On Sun, Jan 31, 2010 at 11:40 AM, Nick Daniels
<somebodys.home.is at gmail.com> wrote:
> Hi there,
>
> I was hoping someone may be able to help me on this...I'm rather stuck!
>
> I have managed to successfully swap out bins (I found these posts
> particularly useful for this:
> http://n4.nabble.com/Dynamically-adding-and-removing-branches-of-a-tee-td973635.html,
> http://n4.nabble.com/Any-ways-to-add-remove-branches-to-from-a-running-pipeline-td973959.html#a973959)
> however I'm having a small problem playing/pausing/swapping the seperate
> bins.
>
> I've pasted a diagram of the test pipeline at http://pastebin.com/f15fc14a4
> to make it easier to see. It's basically made up of two bins linked into the
> videomixer element outputting to a xvimagesink. The bins are made up of a
> filesrc, decodebin with a tee leading to a preview xvimagesink and the bin's
> ghost src pad (which then leads to the videomixer).
>
> What I want to be able to do is disconnect bin1 from the videomixer, pause
> it, play it etc (without affecting bin2 still connected to the videomixer)
> and then swap it back into the videomixer.
>
> I have managed to disconnect bin1 and pause it, but when I start playing it
> plays from where the video would have been if I hadn't paused, not from
> where it was paused (I assume this is because it is using the pipeline's
> clock for playback which is still running for the remaining, unpaused
> bin???). What do I have to do to make sure it plays back from the correct
> place? I've detailed the method I used to disconnect bin1 and pause/play it
> below.
>
> Any insight into what's going on would be very helpful :)
>
> Many thanks,
> Nick
>
> =============================================================
>
> This is my method to disconnect bin1 from the videomixer:
>
> 1. Block bin1's source pad
>      pad = gst_element_get_static_pad (bin1, "src");
>      gst_pad_set_blocked(pad,TRUE);
>
> 2. Unlink bin1 and videomixer and release videomixer's request pad
>      gst_element_unlink (bin1, mixer);
>      gst_element_release_request_pad(mixer, mixerpad);
>
> 3. Add fakesink to pipeline and set state to READY
>      gst_bin_add (GST_BIN (pipeline), fakesink);
>      gst_element_set_state (fakesink, GST_STATE_READY);
>
> 4. Link fakesink to bin1 and set state to PLAYING
>      gst_element_link (bin1, fakesink);
>      gst_element_set_state (fakesink, GST_STATE_PLAYING);
>
> 5. Unblock bin1's ghost pad
>      gst_pad_set_blocked(pad,FALSE);
>
> This works fine, no problems.
>
> Ok now I want to pause bin1 so I do:
>
>      gst_element_set_state (fakesink, GST_STATE_PAUSED);
>      gst_element_set_state (bin1, GST_STATE_PAUSED);
>
> Great it's paused. Now the problem...I want to play it again.
>
>      gst_element_set_state (fakesink, GST_STATE_PLAYING);
>      gst_element_set_state (bin1, GST_STATE_PLAYING);
>
> Instead of continuing playing from when I paused it, it plays from where it
> would have been if I hadn't paused it (it skips forward). I assume this is
> because its using the pipeline's (or the other bin's?) clock? Is this a bug?
> Is there a way to make sure this bin plays back from where it was paused?
>
> I've also tried putting it to the READY state instead of PAUSED. This works,
> but when I set it to PLAYING again the following error appears in the
> console 21 times, and the video plays back at a very fast rate.
>      (test:5682): GLib-GObject-WARNING **: invalid uninstantiatable type
> `<invalid>' in cast to `GstElement'
>      (test:5682): GLib-GObject-WARNING **: invalid uninstantiatable type
> `<invalid>' in cast to `GObject'
>      (test:5682): GLib-GObject-CRITICAL **: g_object_get: assertion
> `G_IS_OBJECT (object)' failed
>
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>



-- 
http://codebad.com/




More information about the gstreamer-devel mailing list