Reduce the scope of set_state?

Sebastian Dröge sebastian at centricular.com
Thu Nov 7 00:06:48 PST 2013


On Mi, 2013-11-06 at 13:56 -0200, Adrian Pardini wrote:
> On 6 November 2013 12:31, Lautaro Woites <lauchapc87 at gmail.com> wrote:
> > I've seen the logs and the state changes  are propagated to all the elements
> > in the pipeline.
> >
> > This is a problem for me because sometimes I've had a filesrc/decoder on
> > NULL state and
> > I dont want to set it to PLAYING state when  I've changed the state of
> > another filesrc/decoder.
> > (This happens for example when I want to change two inputs at the same time)
> >
> > I've tried using a bin with the filesrc and decoder, but the state
> > propagates the same way.
> >
> > How can I limit the scope of a state change?
> 
> 
> Hi Lautaro,
> 
> normally you would block the pads, unlink the element and then put it
> on another pipeline (or just remove it from the main until it's needed
> again) so it is not affected by the state changes on the main pipeline
> of your program. Something like what is shown here:
> http://groakat.wordpress.com/2012/12/05/gstreamer-stream-h264-webcam-data-to-series-of-files/
> (but that use case is a bit different). Keep in mind that some
> elements don't really like to be reused so perhaps removing and adding
> a fresh one is the way to go. Let me know if you need a hand.

Or you could use gst_element_set_locked_state(). Then the element's
state is not changed by the parent bin.

-- 
Sebastian Dröge <sebastian at centricular.com>
Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131107/2fb0b53f/attachment.pgp>


More information about the gstreamer-devel mailing list