1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
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 <!-- ##### ENUM GstEventType ##### -->
32 The different major types of events.
35 @GST_EVENT_UNKNOWN: unknown event.
36 @GST_EVENT_EOS: an end-of-stream event.
37 @GST_EVENT_FLUSH: a flush event.
38 @GST_EVENT_EMPTY: an empty event.
39 @GST_EVENT_DISCONTINUOUS: a discontinuous event to indicate the stream has a discontinuity.
40 @GST_EVENT_QOS: a quality of service event
41 @GST_EVENT_SEEK: a seek event.
42 @GST_EVENT_SEEK_SEGMENT: a segment seek with start and stop position
43 @GST_EVENT_SEGMENT_DONE: the event that will be emited when the segment seek has ended
44 @GST_EVENT_SIZE: a size suggestion for a peer element
45 @GST_EVENT_RATE: adjust the output rate of an element
46 @GST_EVENT_FILLER: a dummy event that should be ignored by plugins
47 @GST_EVENT_TS_OFFSET: an event to set the time offset on buffers
48 @GST_EVENT_INTERRUPT: mainly used by _get based elements when they were interrupted
49 while waiting for a buffer.
50 @GST_EVENT_NAVIGATION:
53 <!-- ##### MACRO GST_EVENT_TYPE ##### -->
58 @event: The event to query.
61 <!-- ##### MACRO GST_EVENT_SRC ##### -->
63 The source object that generated this event
66 @event: The event to query
69 <!-- ##### MACRO GST_EVENT_TIMESTAMP ##### -->
71 Get the timestamp of the event.
74 @event: The event to query.
77 <!-- ##### ENUM GstEventFlag ##### -->
79 Event flags are used when querying for supported events
82 @GST_EVENT_FLAG_NONE: no value
83 @GST_RATE_FLAG_NEGATIVE: indicates negative rates are supported
85 <!-- ##### ENUM GstSeekType ##### -->
87 The different types of seek events. When constructing a seek event a format,
88 a seek method and optional flags are OR-ed together. The seek event is then
89 inserted into the graph with #gst_pad_send_event() or #gst_element_send_event().
92 Following example illustrates how to insert a seek event (1 second in the stream)
99 event = gst_event_new_seek (
100 GST_FORMAT_TIME | /* seek on time */
101 GST_SEEK_METHOD_SET | /* set the absolute position */
102 GST_SEEK_FLAG_FLUSH, /* flush any pending data */
103 1 * GST_SECOND); /* the seek offset (1 second) */
105 res = gst_element_send_event (GST_ELEMENT (osssink), event);
107 g_warning ("seek failed");
113 @GST_SEEK_METHOD_CUR: Seek to an relative position
114 @GST_SEEK_METHOD_SET: Seek to an absolute position
115 @GST_SEEK_METHOD_END: Seek relative to the end of the stream
116 @GST_SEEK_FLAG_FLUSH: Flush any pending data while seeking
117 @GST_SEEK_FLAG_ACCURATE: Seek as accuratly as possible
118 @GST_SEEK_FLAG_KEY_UNIT: Seek to a nearby key unit
119 @GST_SEEK_FLAG_SEGMENT_LOOP: Loop between start and stop in a segmented seek
121 <!-- ##### ENUM GstSeekAccuracy ##### -->
123 The seekaccuracy gives more information of how the seek was performed,
124 if the seek was accurate or fuzzy.
127 @GST_SEEK_CERTAIN: The seek was exact
128 @GST_SEEK_FUZZY: The seek was fuzzy, exact position can not be guaranteed
130 <!-- ##### MACRO GST_EVENT_SEEK_TYPE ##### -->
132 Get the seektype of the GST_EVENT_SEEK.
135 @event: The event to query.
138 <!-- ##### MACRO GST_EVENT_SEEK_FORMAT ##### -->
140 The format of the seek value
143 @event: The event operate on
146 <!-- ##### MACRO GST_EVENT_SEEK_METHOD ##### -->
148 The seek method to use as one of #GstSeekType
151 @event: The event operate on
154 <!-- ##### MACRO GST_EVENT_SEEK_FLAGS ##### -->
156 The optional seek flags
159 @event: The event operate on
162 <!-- ##### MACRO GST_EVENT_SEEK_OFFSET ##### -->
164 Get the offset of the seek event.
167 @event: The event to query.
170 <!-- ##### MACRO GST_EVENT_SEEK_ACCURACY ##### -->
172 Indicates how accurate the event was performed.
175 @event: The event to query
178 <!-- ##### MACRO GST_SEEK_FLAGS_MASK ##### -->
180 Mask for the flags in the GstSeekType
185 <!-- ##### MACRO GST_SEEK_FLAGS_SHIFT ##### -->
187 Shift for the flags in the GstSeekType
192 <!-- ##### MACRO GST_SEEK_FORMAT_MASK ##### -->
194 Mask for the format in the GstSeekType
199 <!-- ##### MACRO GST_SEEK_FORMAT_SHIFT ##### -->
201 Shift for the format in the GstSeekType
206 <!-- ##### MACRO GST_SEEK_METHOD_MASK ##### -->
208 Mask for the method in the GstSeekType
213 <!-- ##### MACRO GST_SEEK_METHOD_SHIFT ##### -->
215 Shift for the method in the GstSeekType
220 <!-- ##### MACRO GST_EVENT_DISCONT_NEW_MEDIA ##### -->
222 Flag that indicates the discont event was because of a new media
226 @event: The event to operate on
229 <!-- ##### MACRO GST_EVENT_DISCONT_OFFSET ##### -->
231 The offset of the discont event. A discont evetn can hold up to 8 different
235 @event: The event to query
236 @i: The offset/value pair.
239 <!-- ##### MACRO GST_EVENT_DISCONT_OFFSET_LEN ##### -->
241 Get the number of offset/value pairs this event has.
244 @event: The event to query.
247 <!-- ##### MACRO GST_EVENT_RATE_VALUE ##### -->
249 Get access to the rate vale field
252 @event: The event to query
255 <!-- ##### MACRO GST_EVENT_SEEK_ENDOFFSET ##### -->
257 The event stop position for a segment seek
260 @event: The event to query
263 <!-- ##### MACRO GST_EVENT_SIZE_FORMAT ##### -->
265 The format of the size event.
268 @event: The event to query
271 <!-- ##### MACRO GST_EVENT_SIZE_VALUE ##### -->
273 The value of the size event
276 @event: The event to query
279 <!-- ##### MACRO GST_EVENT_IS_INTERRUPT ##### -->
281 Check if the event is an interrupt event
284 @event: The event to check
287 <!-- ##### MACRO GST_EVENT_TRACE_NAME ##### -->
289 The name used for memory allocation tracing
294 <!-- ##### STRUCT GstEvent ##### -->
304 <!-- ##### FUNCTION gst_event_new ##### -->
313 <!-- ##### MACRO gst_event_copy ##### -->
315 Copy the event using the event specific copy function
318 @ev: The event to copy
319 @Returns: A new event that is a copy of the given input event
322 <!-- ##### MACRO gst_event_ref ##### -->
324 Increase the refcount of this event
327 @ev: The event to refcount
330 <!-- ##### MACRO gst_event_ref_by_count ##### -->
332 Increase the refcount of the event with the given value
335 @ev: The event to refcount
336 @c: The value to add to the refcount
339 <!-- ##### MACRO gst_event_unref ##### -->
341 Decrease the refcount of an event, freeing it if the refcount reaches 0
344 @ev: The event to unref
347 <!-- ##### FUNCTION gst_event_new_seek ##### -->
357 <!-- ##### FUNCTION gst_event_new_segment_seek ##### -->
368 <!-- ##### FUNCTION gst_event_new_size ##### -->
378 <!-- ##### FUNCTION gst_event_new_discontinuous ##### -->
389 <!-- ##### FUNCTION gst_event_discont_get_value ##### -->
400 <!-- ##### MACRO gst_event_new_filler ##### -->
402 Create a new dummy event that should be ignored
407 <!-- ##### MACRO gst_event_new_flush ##### -->
409 Create a new flush event.
414 <!-- ##### FUNCTION gst_event_masks_contains ##### -->
424 <!-- ##### MACRO GST_EVENT_MASK_FUNCTION ##### -->
426 A convenience macro to create event mask functions
429 @type: The type of the first argument of the function
430 @functionname: the name of the function
431 @...: event masks, the last element is marked with 0