[gst-devel] Shutting down a substream
sphink at gmail.com
Thu Sep 6 21:22:42 CEST 2007
On 9/5/07, Wim Taymans <wim.taymans at gmail.com> wrote:
> On Wed, 2007-09-05 at 16:50 -0700, Steve Fink wrote:
> > I have an element with multiple src pads, all of which go into an
> > adder. What is the proper way to shut down the individual streams
> > going through those pads without dropping out of PLAYING?
> > Each pad has its own task, and each has some amount of data to send
> > out. Then each posts an EOS. But the task is evidently not halted by
> > the processing of that EOS, because the task's function is called
> > repeatedly after the EOS has been sent. I can't call
> > activate_push(FALSE) from within the task function, because that
> > results in the thread trying to join with itself. I'm assuming
> > gst_pad_set_active(FALSE) would be the same.
> > I suppose I should go back and read through all the design docs again,
> > but I'm hoping somebody here can help. Am I not passing through some
> > event or something?
> gst_pad_pause_task() is probably what you are looking for. As soon as
> the source pushed EOS, call this function and the task function will not
> be called again until somebody does gst_pad_start_task().
Excellent, thanks. Although I'd also kind of like to discard the pad
after it hits EOS as well. Is there a good way of detecting this from
the main thread? I can always send my own signal, or queue up a flag
in the element, but if there's something builtin I'd like to use it.
(The EOS is originating on a source pad of the element that would be
the one to delete the pad, so it's kind of traveling away from where
Alternatively, I could reuse pads. That might be a little tricky with
my eventual plans, though.
More information about the gstreamer-devel