How to stop the pipeline from plugin?

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

How to stop the pipeline from plugin?

Joonas Salo
Hi,
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?

Thanks,
Joonas


------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to stop the pipeline from plugin?

Edward Hervey
Administrator
Hi,

  The clean way is to:
 * push an EOS event downstream
 * return GST_FLOW_UNEXPECTED

    Edward

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

> Hi,
> 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?
>
> Thanks,
> Joonas
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to stop the pipeline from plugin?

Tim-Philipp Müller-2
In reply to this post by Joonas Salo
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).

Cheers
 -Tim



------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel