Sequence of calling statechanges of elements in a pipeline

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

Sequence of calling statechanges of elements in a pipeline

M.Purushotham
Hi,
 
I have a pipeline as gst_bin_add_many (GST_BIN (bin), source, decoder, sink, NULL);, when I call gst_element_set_state (bin, GST_STATE_PLAYING); then state change sequence is
 
gst_element_set_state (sink, GST_STATE_READY);
gst_element_set_state (decoder, GST_STATE_READY);
gst_element_set_state (source, GST_STATE_READY);
 
gst_element_set_state (sink, GST_STATE_PAUSED);
gst_element_set_state (decoder, GST_STATE_PAUSED);
gst_element_set_state (source, GST_STATE_PAUSED );
 
gst_element_set_state (sink, GST_STATE_PLAYING);
gst_element_set_state (decoder, GST_STATE_PLAYING);
gst_element_set_state (source, GST_STATE_PLAYING);
 
In my pipeline source is the first element, sink is the last element but state change calling sequence is in reverse order, Anybody knows why this is happening?
 
Thanks
Purush
 
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Sequence of calling statechanges of elements in a pipeline

michael smith-6-3
On Fri, Jul 31, 2009 at 7:25 AM, <[hidden email]> wrote:

> Hi,
>
> I have a pipeline as gst_bin_add_many (GST_BIN (bin), source, decoder, sink,
> NULL);, when I call gst_element_set_state (bin, GST_STATE_PLAYING); then
> state change sequence is
>
> gst_element_set_state (sink, GST_STATE_READY);
> gst_element_set_state (decoder, GST_STATE_READY);
> gst_element_set_state (source, GST_STATE_READY);
>
> gst_element_set_state (sink, GST_STATE_PAUSED);
> gst_element_set_state (decoder, GST_STATE_PAUSED);
> gst_element_set_state (source, GST_STATE_PAUSED );
>
> gst_element_set_state (sink, GST_STATE_PLAYING);
> gst_element_set_state (decoder, GST_STATE_PLAYING);
> gst_element_set_state (source, GST_STATE_PLAYING);
>
> In my pipeline source is the first element, sink is the last element but
> state change calling sequence is in reverse order, Anybody knows why this is
> happening?

That's how gstreamer state changes work - it's correct behaviour. The
bin iterates from sources to sinks and changes states of contained
elements in that iteration order.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Sequence of calling statechanges of elements in a pipeline

Jan Schmidt-6
In reply to this post by M.Purushotham
On Fri, 2009-07-31 at 16:25 +0200, [hidden email] wrote:
> Hi,
>  
> I have a pipeline as gst_bin_add_many (GST_BIN(bin), source, decoder,
> sink,NULL);, when I call gst_element_set_state (bin,
> GST_STATE_PLAYING); then state change sequence is
>  
...

> gst_element_set_state (sink, GST_STATE_PLAYING);
> gst_element_set_state (decoder, GST_STATE_PLAYING);
> gst_element_set_state (source, GST_STATE_PLAYING);
>  
> In my pipeline source is the first element, sink is the last element
> but state change calling sequence is in reverse order, Anybody knows
> why this is happening?

Sink elements have to be ready to receive data before it can start
flowing - so in upward state changes, they have to change state before
the sources that produce the data.

The opposite is true when shutting down - data has to stop flowing
before the sinks are shut down.

J.

--
Jan Schmidt <[hidden email]>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel