How to send EOS from within source?!
Tim-Philipp Müller
t.i.m at zen.co.uk
Wed Jun 12 05:20:15 PDT 2013
On Wed, 2013-06-12 at 13:26 +0200, Tim Aerts wrote:
> I have create a source plugin. It works fine. But I don't know how to
> tell the application that there is no more data. Right now, I am using
> gst_element_post_message(), but that doesn't seem to do anything.
Posting a message isn't really right, the sink should do that once it
has finished processing all data.
> I read that the EOS is only passed from the pipeline to the app when
> the last sink posts an EOS. But how do I control that? I am not making
> a sink, I'm making a source.
> Also, I read that I should "just return GST_FLOW_EOS". I get that, but
> I am deriving from GstAudioSrc. Which is derived from GstBaseAudioSrc,
> and even that one doesn't ever send GST_FLOW_EOS!? So how can I?
>
>
> I need to tell you that I am running 0.10 for now. I cannot upgrade
> (for now). I need it to work with 0.10.
>
>
> I have looked at other source implementations, but none of those seem
> to have been derived from GstAudioSrc. Mine is. I have a deadline by
> the end of this week. It's looking very bad for the moment... :s
FLOW_EOS is FLOW_UNEXPECTED in 0.10, for what it's worth. But that
doesn't really help you, because the assumption for the audio source
class was probably that it's an endless stream to capture.
What you could try is something like this:
gst_element_send_event (src, gst_event_new_eos ());
but I'm not sure if that will work from within the streaming thread
(because of locks that it will take), you might have to do that from a
short-lived helper thread or so (or from your application if you have
tight plugin-application integration).
Cheers
-Tim
More information about the gstreamer-devel
mailing list