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 <!-- ##### 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_TRACE_NAME ##### -->
55 The name used for memory allocation tracing
60 <!-- ##### MACRO GST_EVENT_TYPE ##### -->
65 @event: The event to query.
68 <!-- ##### MACRO GST_EVENT_TIMESTAMP ##### -->
70 Get the timestamp of the event.
73 @event: The event to query.
76 <!-- ##### MACRO GST_EVENT_SRC ##### -->
78 The source object that generated this event
81 @event: The event to query
84 <!-- ##### MACRO GST_EVENT_IS_INTERRUPT ##### -->
86 Check if the event is an interrupt event
89 @event: The event to check
92 <!-- ##### MACRO GST_SEEK_FORMAT_SHIFT ##### -->
94 Shift for the format in the GstSeekType
99 <!-- ##### MACRO GST_SEEK_METHOD_SHIFT ##### -->
101 Shift for the method in the GstSeekType
106 <!-- ##### MACRO GST_SEEK_FLAGS_SHIFT ##### -->
108 Shift for the flags in the GstSeekType
113 <!-- ##### MACRO GST_SEEK_FORMAT_MASK ##### -->
115 Mask for the format in the GstSeekType
120 <!-- ##### MACRO GST_SEEK_METHOD_MASK ##### -->
122 Mask for the method in the GstSeekType
127 <!-- ##### MACRO GST_SEEK_FLAGS_MASK ##### -->
129 Mask for the flags in the GstSeekType
134 <!-- ##### ENUM GstEventFlag ##### -->
136 Event flags are used when querying for supported events
139 @GST_EVENT_FLAG_NONE: no value
140 @GST_RATE_FLAG_NEGATIVE: indicates negative rates are supported
142 <!-- ##### MACRO GST_EVENT_MASK_FUNCTION ##### -->
144 A convenience macro to create event mask functions
147 @type: The type of the first argument of the function
148 @functionname: the name of the function
149 @...: event masks, the last element is marked with 0
152 <!-- ##### ENUM GstSeekType ##### -->
154 The different types of seek events. When constructing a seek event a format,
155 a seek method and optional flags are OR-ed together. The seek event is then
156 inserted into the graph with #gst_pad_send_event() or #gst_element_send_event().
159 Following example illustrates how to insert a seek event (1 second in the stream)
166 event = gst_event_new_seek (
167 GST_FORMAT_TIME | /* seek on time */
168 GST_SEEK_METHOD_SET | /* set the absolute position */
169 GST_SEEK_FLAG_FLUSH, /* flush any pending data */
170 1 * GST_SECOND); /* the seek offset (1 second) */
172 res = gst_element_send_event (GST_ELEMENT (osssink), event);
174 g_warning ("seek failed");
180 @GST_SEEK_METHOD_CUR: Seek to an relative position
181 @GST_SEEK_METHOD_SET: Seek to an absolute position
182 @GST_SEEK_METHOD_END: Seek relative to the end of the stream
183 @GST_SEEK_FLAG_FLUSH: Flush any pending data while seeking
184 @GST_SEEK_FLAG_ACCURATE: Seek as accuratly as possible
185 @GST_SEEK_FLAG_KEY_UNIT: Seek to a nearby key unit
186 @GST_SEEK_FLAG_SEGMENT_LOOP: Loop between start and stop in a segmented seek
188 <!-- ##### ENUM GstSeekAccuracy ##### -->
190 The seekaccuracy gives more information of how the seek was performed,
191 if the seek was accurate or fuzzy.
194 @GST_SEEK_CERTAIN: The seek was exact
195 @GST_SEEK_FUZZY: The seek was fuzzy, exact position can not be guaranteed
197 <!-- ##### MACRO GST_EVENT_SEEK_TYPE ##### -->
199 Get the seektype of the GST_EVENT_SEEK.
202 @event: The event to query.
205 <!-- ##### MACRO GST_EVENT_SEEK_FORMAT ##### -->
207 The format of the seek value
210 @event: The event operate on
213 <!-- ##### MACRO GST_EVENT_SEEK_METHOD ##### -->
215 The seek method to use as one of #GstSeekType
218 @event: The event operate on
221 <!-- ##### MACRO GST_EVENT_SEEK_FLAGS ##### -->
223 The optional seek flags
226 @event: The event operate on
229 <!-- ##### MACRO GST_EVENT_SEEK_OFFSET ##### -->
231 Get the offset of the seek event.
234 @event: The event to query.
237 <!-- ##### MACRO GST_EVENT_SEEK_ENDOFFSET ##### -->
239 The event stop position for a segment seek
242 @event: The event to query
245 <!-- ##### MACRO GST_EVENT_SEEK_ACCURACY ##### -->
247 Indicates how accurate the event was performed.
250 @event: The event to query
253 <!-- ##### MACRO GST_EVENT_DISCONT_NEW_MEDIA ##### -->
255 Flag that indicates the discont event was because of a new media
259 @event: The event to operate on
262 <!-- ##### MACRO GST_EVENT_DISCONT_OFFSET ##### -->
264 The offset of the discont event. A discont evetn can hold up to 8 different
268 @event: The event to query
269 @i: The offset/value pair.
272 <!-- ##### MACRO GST_EVENT_DISCONT_OFFSET_LEN ##### -->
274 Get the number of offset/value pairs this event has.
277 @event: The event to query.
280 <!-- ##### MACRO GST_EVENT_SIZE_FORMAT ##### -->
282 The format of the size event.
285 @event: The event to query
288 <!-- ##### MACRO GST_EVENT_SIZE_VALUE ##### -->
290 The value of the size event
293 @event: The event to query
296 <!-- ##### MACRO GST_EVENT_RATE_VALUE ##### -->
298 Get access to the rate vale field
301 @event: The event to query
304 <!-- ##### STRUCT GstEvent ##### -->
314 <!-- ##### FUNCTION gst_event_new ##### -->
323 <!-- ##### MACRO gst_event_ref ##### -->
325 Increase the refcount of this event
328 @ev: The event to refcount
331 <!-- ##### MACRO gst_event_ref_by_count ##### -->
333 Increase the refcount of the event with the given value
336 @ev: The event to refcount
337 @c: The value to add to the refcount
340 <!-- ##### MACRO gst_event_unref ##### -->
342 Decrease the refcount of an event, freeing it if the refcount reaches 0
345 @ev: The event to unref
348 <!-- ##### MACRO gst_event_copy ##### -->
350 Copy the event using the event specific copy function
353 @ev: The event to copy
354 @Returns: A new event that is a copy of the given input event
357 <!-- ##### FUNCTION gst_event_masks_contains ##### -->
367 <!-- ##### FUNCTION gst_event_new_seek ##### -->
377 <!-- ##### FUNCTION gst_event_new_segment_seek ##### -->
388 <!-- ##### FUNCTION gst_event_new_size ##### -->
398 <!-- ##### FUNCTION gst_event_new_discontinuous ##### -->
409 <!-- ##### FUNCTION gst_event_new_discontinuous_valist ##### -->
420 <!-- ##### FUNCTION gst_event_discont_get_value ##### -->
431 <!-- ##### MACRO gst_event_new_filler ##### -->
433 Create a new dummy event that should be ignored
438 <!-- ##### MACRO gst_event_new_flush ##### -->
440 Create a new flush event.