Tunç Arslan
Tunç Arslan

Reputation: 131

Gstremer Events

I am having a bit of trouble understanding how events work in Gstreamer. I understand that you can pass events to elements from the application to end a stream or block a pad etc., but when I look at the sample code in here, it seems like the program is not sending any specific event, just listening them through probes. If the program is only listening events through probes, then these events have to be sent between elements in some kind of fashion after certain things automatically. However, I couldn't find any information regarding to this. How does the events work in Gstreamer?

Upvotes: 1

Views: 3186

Answers (1)

jfoytik
jfoytik

Reputation: 910

More information on the design of gstreamer events can be found here (https://github.com/GStreamer/gstreamer/blob/master/docs/random/events). This document describes how the various events propagate through a pipeline.

In the provided sample code, an EOS event is sent to an element with the function : gst_pad_send_event (sinkpad, gst_event_new_eos ()); The element then proceeds to flush all of its buffers and forwards the EOS event downstream to the next element by posting the event on its src pad. This event continues through the elements until it reaches the installed probe which contains special logic to manipulate the pipeline if an EOS event is received.

This sample shows several things in regards to your question: - Events are intrinsically handled within the gstreamer pipeline. The gstreamer elements automatically handle them. - Pad Probes can be used to externally observe/modify events as they propagate through the pipeline. - Events can be directly inserted within a pipeline using the function gst_pad_send_event or gst_element_send_event

Upvotes: 2

Related Questions