1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Structure describing events that are passed up and down a pipeline
7 <!-- ##### SECTION Long_Description ##### -->
9 The event classes are used to construct and query events.
13 Events are usually created with gst_event_new() which takes the event type as an argument.
14 properties specific to the event can be set afterwards with the provided macros.
15 The event should be unreferenced with gst_event_unref().
18 gst_event_new_seek() is a usually used to create a seek event and it takes the
19 needed parameters for a seek event.
22 gst_event_new_flush() creates a new flush event.
25 <!-- ##### SECTION See_Also ##### -->
30 <!-- ##### STRUCT GstEvent ##### -->
40 <!-- ##### ENUM GstEventType ##### -->
42 The different major types of events.
45 @GST_EVENT_UNKNOWN: unknown event.
46 @GST_EVENT_EOS: an end-of-stream event.
47 @GST_EVENT_FLUSH: a flush event.
48 @GST_EVENT_EMPTY: an empty event.
49 @GST_EVENT_DISCONTINUOUS: a discontinuous event to indicate the stream has a discontinuity.
50 @GST_EVENT_QOS: a quality of service event
51 @GST_EVENT_SEEK: a seek event.
52 @GST_EVENT_SEEK_SEGMENT: a segment seek with start and stop position
53 @GST_EVENT_SEGMENT_DONE: the event that will be emited when the segment seek has ended
54 @GST_EVENT_SIZE: a size suggestion for a peer element
55 @GST_EVENT_RATE: adjust the output rate of an element
56 @GST_EVENT_FILLER: a dummy event that should be ignored by plugins
57 @GST_EVENT_TS_OFFSET: an event to set the time offset on buffers
58 @GST_EVENT_INTERRUPT: mainly used by _get based elements when they were interrupted
59 while waiting for a buffer.
60 @GST_EVENT_NAVIGATION:
63 <!-- ##### MACRO GST_EVENT_ANY ##### -->
70 <!-- ##### MACRO GST_EVENT_TRACE_NAME ##### -->
72 The name used for memory allocation tracing
77 <!-- ##### MACRO GST_EVENT_TYPE ##### -->
82 @event: The event to query.
85 <!-- ##### MACRO GST_EVENT_TIMESTAMP ##### -->
87 Get the timestamp of the event.
90 @event: The event to query.
93 <!-- ##### MACRO GST_EVENT_SRC ##### -->
95 The source object that generated this event
98 @event: The event to query
101 <!-- ##### MACRO GST_EVENT_IS_INTERRUPT ##### -->
103 Check if the event is an interrupt event
106 @event: The event to check
109 <!-- ##### MACRO GST_SEEK_FORMAT_SHIFT ##### -->
111 Shift for the format in the GstSeekType
116 <!-- ##### MACRO GST_SEEK_METHOD_SHIFT ##### -->
118 Shift for the method in the GstSeekType
123 <!-- ##### MACRO GST_SEEK_FLAGS_SHIFT ##### -->
125 Shift for the flags in the GstSeekType
130 <!-- ##### MACRO GST_SEEK_FORMAT_MASK ##### -->
132 Mask for the format in the GstSeekType
137 <!-- ##### MACRO GST_SEEK_METHOD_MASK ##### -->
139 Mask for the method in the GstSeekType
144 <!-- ##### MACRO GST_SEEK_FLAGS_MASK ##### -->
146 Mask for the flags in the GstSeekType
151 <!-- ##### ENUM GstEventFlag ##### -->
153 Event flags are used when querying for supported events
156 @GST_EVENT_FLAG_NONE: no value
157 @GST_RATE_FLAG_NEGATIVE: indicates negative rates are supported
159 <!-- ##### MACRO GST_EVENT_MASK_FUNCTION ##### -->
161 A convenience macro to create event mask functions
164 @type: The type of the first argument of the function
165 @functionname: the name of the function
166 @...: event masks, the last element is marked with 0
169 <!-- ##### ENUM GstSeekType ##### -->
171 The different types of seek events. When constructing a seek event a format,
172 a seek method and optional flags are OR-ed together. The seek event is then
173 inserted into the graph with #gst_pad_send_event() or #gst_element_send_event().
175 Following example illustrates how to insert a seek event (1 second in the stream)
178 <title>Insertion of a seek event into a pipeline</title>
183 event = gst_event_new_seek (
184 GST_FORMAT_TIME | /* seek on time */
185 GST_SEEK_METHOD_SET | /* set the absolute position */
186 GST_SEEK_FLAG_FLUSH, /* flush any pending data */
187 1 * GST_SECOND); /* the seek offset (1 second) */
189 res = gst_element_send_event (GST_ELEMENT (osssink), event);
191 g_warning ("seek failed");
197 @GST_SEEK_METHOD_CUR: Seek to an relative position
198 @GST_SEEK_METHOD_SET: Seek to an absolute position
199 @GST_SEEK_METHOD_END: Seek relative to the end of the stream
200 @GST_SEEK_FLAG_FLUSH: Flush any pending data while seeking
201 @GST_SEEK_FLAG_ACCURATE: Seek as accurately as possible
202 @GST_SEEK_FLAG_KEY_UNIT: Seek to a nearby key unit
203 @GST_SEEK_FLAG_SEGMENT_LOOP: Loop between start and stop in a segmented seek
205 <!-- ##### ENUM GstSeekAccuracy ##### -->
207 The accuracy about a seek operation gives more information of how the seek was
208 performed, namly if the seek was accurate or fuzzy.
211 @GST_SEEK_CERTAIN: The seek was exact
212 @GST_SEEK_FUZZY: The seek was fuzzy, exact position can not be guaranteed
214 <!-- ##### MACRO GST_EVENT_SEEK_TYPE ##### -->
216 Get the seektype of the GST_EVENT_SEEK.
219 @event: The event to query.
222 <!-- ##### MACRO GST_EVENT_SEEK_FORMAT ##### -->
224 The format of the seek value
227 @event: The event operate on
230 <!-- ##### MACRO GST_EVENT_SEEK_METHOD ##### -->
232 The seek method to use as one of #GstSeekType
235 @event: The event operate on
238 <!-- ##### MACRO GST_EVENT_SEEK_FLAGS ##### -->
240 The optional seek flags
243 @event: The event operate on
246 <!-- ##### MACRO GST_EVENT_SEEK_OFFSET ##### -->
248 Get the offset of the seek event.
251 @event: The event to query.
254 <!-- ##### MACRO GST_EVENT_SEEK_ENDOFFSET ##### -->
256 The event stop position for a segment seek
259 @event: The event to query
262 <!-- ##### MACRO GST_EVENT_SEEK_ACCURACY ##### -->
264 Indicates how accurate the event was performed.
267 @event: The event to query
270 <!-- ##### MACRO GST_EVENT_DISCONT_NEW_MEDIA ##### -->
272 Flag that indicates the discont event was because of a new media
276 @event: The event to operate on
279 <!-- ##### MACRO GST_EVENT_DISCONT_OFFSET ##### -->
281 The offset of the discont event. A discont event can hold up to 8 different
285 @event: The event to query
286 @i: The offset/value pair.
289 <!-- ##### MACRO GST_EVENT_DISCONT_OFFSET_LEN ##### -->
291 Get the number of offset/value pairs this event has.
294 @event: The event to query.
297 <!-- ##### MACRO GST_EVENT_SIZE_FORMAT ##### -->
299 The format of the size event.
302 @event: The event to query
305 <!-- ##### MACRO GST_EVENT_SIZE_VALUE ##### -->
307 The value of the size event
310 @event: The event to query
313 <!-- ##### MACRO GST_EVENT_RATE_VALUE ##### -->
315 Get access to the rate vale field
318 @event: The event to query
321 <!-- ##### FUNCTION gst_event_new ##### -->
330 <!-- ##### MACRO gst_event_ref ##### -->
332 Increase the refcount of this event
335 @ev: The event to refcount
338 <!-- ##### MACRO gst_event_ref_by_count ##### -->
340 Increase the refcount of the event with the given value
343 @ev: The event to refcount
344 @c: The value to add to the refcount
347 <!-- ##### MACRO gst_event_unref ##### -->
349 Decrease the refcount of an event, freeing it if the refcount reaches 0
352 @ev: The event to unref
355 <!-- ##### MACRO gst_event_copy ##### -->
357 Copy the event using the event specific copy function
360 @ev: The event to copy
361 @Returns: A new event that is a copy of the given input event
364 <!-- ##### FUNCTION gst_event_masks_contains ##### -->
374 <!-- ##### FUNCTION gst_event_new_seek ##### -->
384 <!-- ##### FUNCTION gst_event_new_segment_seek ##### -->
395 <!-- ##### FUNCTION gst_event_new_size ##### -->
405 <!-- ##### FUNCTION gst_event_new_discontinuous ##### -->
416 <!-- ##### FUNCTION gst_event_new_discontinuous_valist ##### -->
427 <!-- ##### FUNCTION gst_event_discont_get_value ##### -->
438 <!-- ##### MACRO gst_event_new_filler ##### -->
440 Create a new dummy event that should be ignored
445 <!-- ##### MACRO gst_event_new_flush ##### -->
447 Create a new flush event.