How to pause an individual queue?

Tim-Philipp Müller t.i.m at
Tue Dec 18 15:21:46 PST 2012

On Tue, 2012-12-18 at 14:38 -0800, mattes wrote:


> I have the following pipeline:
>   filesrc -> avidemux -> queue -> mp4decoder -> videosink
>                       -> queue -> aacdecoder -> audiosink
> Everything plays back fine. I can pause playback fine, by sending
> a GST_STATE_PAUSED to the pipeline. Playback stop and resumes once
> I set the pipeline state back to GST_STATE_PLAYING.
> How do I pause an individual queue/element?
> I tried setting GST_STATE_PAUSED on audiosink and audio decoder,
> but it pauses the entire pipeline. Meaning video playback and audio
> playback stops. Resetting audiosync to GST_STATE_PLAYING and botyh
> video and audio resume.
> I like to either the audio chain or video chain. 
> I am obviously doing something wrong. What am I missing?
> Is there a difference in behaviour between live and on demand?

You can't really pause individual elements in most cases. "Pausing"
usually happens in the sink (for non-live sources): the sink stops
rendering data, and at some point the upstream elements just block in
gst_pad_push_buffer(), because downstream doesn't consume data any more
(and queues fill up etc.). Or a source stops producing data. Most
filters / elements in the middle, don't differentiate between paused and
playing state.

You can block data flow by setting up a pad block, but that will have
repercussions on the other branch.

You can also add a valve element (or a pad probe that drops buffers) and
just drop buffers on one branch. That might cause issues with preroll
though, if data doesn't reach the sinks any more (you can set the sink
async=false then though).

What are you trying to do? (big picture)


More information about the gstreamer-devel mailing list