[gst-devel] help about EOS

Andy Wingo wingo at pobox.com
Tue Oct 15 09:14:03 CEST 2002


On Tue, 15 Oct 2002, Alexandre Alison wrote:

> I am using gstreamer to realise a part of an ultrasound application. I am
> looking for the right way to stop the plugins so as to flush correctly the
> stream and to display the last acquired frame (I must stop the iteration at
> the end of the display of this frame to be able to communicate then restart
> the acquisition when asked).
> 
> must I use:
>     gst_element_set_eos (GST_ELEMENT (bittwareinputplugin));
>     or buf = GST_BUFFER(gst_event_new(GST_EVENT_EOS));
>     or GST_PAD_EOS
> 
> Is there a documentation about this? (the helloworld example is too simple
> for me) I use google to find information and I study the code of plugins but
> there are obsolete ways of doing this in plugins and in documentations
> (google find old documentations :( ). Where can I find up to date
> information about the ways of realising a correct EOS?

I was going to answer your question by pointing you to some code, but
things have changed since I was familiar with most plugins' EOS
behavior.

If your element is chain-based, it's pretty easy: if you don't set the
plugin as EVENT_AWARE, everything should (in theory) be taken care of
for you. GStreamer will set your element to eos (causing emission of
::eos and setting of your plugin to PAUSED) at the proper time, and you
do any cleanup in the PLAYING->PAUSED transition. If you are event
aware, just call a gst_pad_event_default (pad, event); on the event as
in gst-plugins/ext/mad/gstmad.c. If you have a loop-based element, you
have to push the event on a source pad and set the plugin to EOS (in
that order, i think).

This is rusty knowledge, though; you might try finding wtay on IRC to
give you a hand.

cheers,

wingo.




More information about the gstreamer-devel mailing list