[gst-devel] How to stop the pipeline from plugin?

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Jun 25 11:04:32 CEST 2009

On Thu, 2009-06-25 at 11:07 +0300, Joonas Salo wrote:

> I want to make a plugin which stops the pipeline (and gst-launch) when  
> second frame from video stream arrives. The point is to read one  
> single frame from webcam. So far i succeeded with the task in a very  
> crude way, by using exit() in plugin chain-function. Is there a clean  
> way to do this?

The easiest way is not to do a plugin at all, but just set the
num-buffers property on the source element to 1. It will then EOS
automatically after one buffer.

If you do decide to write an element, the most correct way would
probably be to return GST_FLOW_UNEXPECTED from your chain function to
upstream when you don't want any more buffers (which should make it EOS
as well).


More information about the gstreamer-devel mailing list