Playing/pausing bins within a running pipeline

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

Playing/pausing bins within a running pipeline

Guillaume Dorchies
Hello,

I have this pipeline I add bin B dynamicly

|-----------------------------|
|bin A                      |
|  source -> queue ->|\
|-----------------------------| \
                                  -> Adder -> queue -> sink
|-----------------------------| /
|bin B                      |/
|  source -> queue ->|
|-----------------------------|

What I want to be able to do is pause "bin B", play it etc (without affecting "bin A")
 
I try gst_element_set_state (binB, GST_STATE_PAUSED); but this don't work

I try :
pad = gst_element_get_static_pad(binB, "src");
gst_pad_set_blocked(pad,TRUE);
But this block the pipeline


Does someone know how to do this or where can I find an example ?


Best regards

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

Re: Playing/pausing bins within a running pipeline

Wim Taymans
On 05/29/2012 10:19 AM, Guillaume Dorchies wrote:

> Hello,
>
> I have this pipeline I add bin B dynamicly
>
> |-----------------------------|
> |bin A                      |
> |  source -> queue ->|\
> |-----------------------------| \
>                                   -> Adder -> queue -> sink
> |-----------------------------| /
> |bin B                      |/
> |  source -> queue ->|
> |-----------------------------|
>
> What I want to be able to do is pause "bin B", play it etc (without
> affecting "bin A")
>
> I try gst_element_set_state (binB, GST_STATE_PAUSED); but this don't work
>
> I try :
> pad = gst_element_get_static_pad(binB, "src");
> gst_pad_set_blocked(pad,TRUE);
> But this block the pipeline
>
After you block the pad you need to unlink the pad to adder and release
the adder pad. Playback
will then continue again. If you want restart B, request a new adder
pad, link to B srcpad and
unblock the srcpad.

Wim

>
> Does someone know how to do this or where can I find an example ?
>
>
> Best regards
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Playing/pausing bins within a running pipeline

Guillaume Dorchies
It's work very well

But now I try to do a seek :)

If I make directly my seek on the souce of binB or on the bin nothing happens.

I try to block pad , seek , unblock pad  but this don't work

Do you have any ideas ?

PS:
Code to block
  pad = gst_element_get_static_pad(binB, "src");
  gst_pad_set_blocked(pad,TRUE);
  gst_pad_unlink(pad,adder_pad);
  gst_element_release_request_pad(adder,adder_pad);
  gst_object_unref(adder_pad);
  gst_object_unref(pad);


Code to unlock
  adder_pad = gst_element_get_request_pad(adder, "sink%d");
  g_assert(adder_pad != NULL);
  gst_pad_link(gst_element_get_pad(bin,"src"),adder_pad);
  gst_pad_set_blocked(pad,FALSE);
  gst_object_unref(pad);


2012/5/29 Wim Taymans <[hidden email]>
On 05/29/2012 10:19 AM, Guillaume Dorchies wrote:
Hello,

I have this pipeline I add bin B dynamicly

|-----------------------------|
|bin A                      |
|  source -> queue ->|\
|-----------------------------| \
                                 -> Adder -> queue -> sink
|-----------------------------| /
|bin B                      |/
|  source -> queue ->|
|-----------------------------|

What I want to be able to do is pause "bin B", play it etc (without affecting "bin A")

I try gst_element_set_state (binB, GST_STATE_PAUSED); but this don't work

I try :
pad = gst_element_get_static_pad(binB, "src");
gst_pad_set_blocked(pad,TRUE);
But this block the pipeline

After you block the pad you need to unlink the pad to adder and release the adder pad. Playback
will then continue again. If you want restart B, request a new adder pad, link to B srcpad and
unblock the srcpad.

Wim

Does someone know how to do this or where can I find an example ?


Best regards


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