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:
52 <!-- ##### MACRO GST_EVENT_TYPE ##### -->
57 @event: The event to query.
60 <!-- ##### MACRO GST_EVENT_SRC ##### -->
62 The source object that generated this event
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 <!-- ##### ENUM GstEventFlag ##### -->
78 Event flags are used when querying for supported events
81 @GST_EVENT_FLAG_NONE: no value
82 @GST_RATE_FLAG_NEGATIVE: indicates negative rates are supported
84 <!-- ##### ENUM GstSeekType ##### -->
86 The different types of seek events. When constructing a seek event a format,
87 a seek method and optional flags are OR-ed together. The seek event is then
88 inserted into the graph with #gst_pad_send_event() or #gst_element_send_event().
91 Following example illustrates how to insert a seek event (1 second in the stream)
98 event = gst_event_new_seek (
99 GST_FORMAT_TIME | /* seek on time */
100 GST_SEEK_METHOD_SET | /* set the absolute position */
101 GST_SEEK_FLAG_FLUSH, /* flush any pending data */
102 1 * GST_SECOND); /* the seek offset (1 second) */
104 res = gst_element_send_event (GST_ELEMENT (osssink), event);
106 g_warning ("seek failed");
112 @GST_SEEK_METHOD_CUR: Seek to an relative position
113 @GST_SEEK_METHOD_SET: Seek to an absolute position
114 @GST_SEEK_METHOD_END: Seek relative to the end of the stream
115 @GST_SEEK_FLAG_FLUSH: Flush any pending data while seeking
116 @GST_SEEK_FLAG_ACCURATE: Seek as accuratly as possible
117 @GST_SEEK_FLAG_KEY_UNIT: Seek to a nearby key unit
118 @GST_SEEK_FLAG_SEGMENT_LOOP: Loop between start and stop in a segmented seek
120 <!-- ##### ENUM GstSeekAccuracy ##### -->
122 The seekaccuracy gives more information of how the seek was performed,
123 if the seek was accurate or fuzzy.
126 @GST_SEEK_CERTAIN: The seek was exact
127 @GST_SEEK_FUZZY: The seek was fuzzy, exact position can not be guaranteed
129 <!-- ##### MACRO GST_EVENT_SEEK_TYPE ##### -->
131 Get the seektype of the GST_EVENT_SEEK.
134 @event: The event to query.
137 <!-- ##### MACRO GST_EVENT_SEEK_FORMAT ##### -->
139 The format of the seek value
142 @event: The event operate on
145 <!-- ##### MACRO GST_EVENT_SEEK_METHOD ##### -->
147 The seek method to use as one of #GstSeekType
150 @event: The event operate on
153 <!-- ##### MACRO GST_EVENT_SEEK_FLAGS ##### -->
155 The optional seek flags
158 @event: The event operate on
161 <!-- ##### MACRO GST_EVENT_SEEK_OFFSET ##### -->
163 Get the offset of the seek event.
166 @event: The event to query.
169 <!-- ##### MACRO GST_EVENT_SEEK_ACCURACY ##### -->
171 Indicates how accurate the event was performed.
174 @event: The event to query
177 <!-- ##### MACRO GST_SEEK_FLAGS_MASK ##### -->
179 Mask for the flags in the GstSeekType
184 <!-- ##### MACRO GST_SEEK_FLAGS_SHIFT ##### -->
186 Shift for the flags in the GstSeekType
191 <!-- ##### MACRO GST_SEEK_FORMAT_MASK ##### -->
193 Mask for the format in the GstSeekType
198 <!-- ##### MACRO GST_SEEK_FORMAT_SHIFT ##### -->
200 Shift for the format in the GstSeekType
205 <!-- ##### MACRO GST_SEEK_METHOD_MASK ##### -->
207 Mask for the method in the GstSeekType
212 <!-- ##### MACRO GST_SEEK_METHOD_SHIFT ##### -->
214 Shift for the method in the GstSeekType
219 <!-- ##### MACRO GST_EVENT_DISCONT_NEW_MEDIA ##### -->
221 Flag that indicates the discont event was because of a new media
225 @event: The event to operate on
228 <!-- ##### MACRO GST_EVENT_DISCONT_OFFSET ##### -->
230 The offset of the discont event. A discont evetn can hold up to 8 different
234 @event: The event to query
235 @i: The offset/value pair.
238 <!-- ##### MACRO GST_EVENT_DISCONT_OFFSET_LEN ##### -->
240 Get the number of offset/value pairs this event has.
243 @event: The event to query.
246 <!-- ##### MACRO GST_EVENT_RATE_VALUE ##### -->
248 Get access to the rate vale field
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_SIZE_FORMAT ##### -->
264 The format of the size event.
267 @event: The event to query
270 <!-- ##### MACRO GST_EVENT_SIZE_VALUE ##### -->
272 The value of the size event
275 @event: The event to query
278 <!-- ##### MACRO GST_EVENT_IS_INTERRUPT ##### -->
280 Check if the event is an interrupt event
283 @event: The event to check
286 <!-- ##### MACRO GST_EVENT_TRACE_NAME ##### -->
288 The name used for memory allocation tracing
293 <!-- ##### STRUCT GstEvent ##### -->
303 <!-- ##### FUNCTION gst_event_new ##### -->
312 <!-- ##### MACRO gst_event_copy ##### -->
314 Copy the event using the event specific copy function
317 @ev: The event to copy
318 @Returns: A new event that is a copy of the given input event
321 <!-- ##### MACRO gst_event_ref ##### -->
323 Increase the refcount of this event
326 @ev: The event to refcount
329 <!-- ##### MACRO gst_event_ref_by_count ##### -->
331 Increase the refcount of the event with the given value
334 @ev: The event to refcount
335 @c: The value to add to the refcount
338 <!-- ##### MACRO gst_event_unref ##### -->
340 Decrease the refcount of an event, freeing it if the refcount reaches 0
343 @ev: The event to unref
346 <!-- ##### FUNCTION gst_event_new_seek ##### -->
356 <!-- ##### FUNCTION gst_event_new_segment_seek ##### -->
367 <!-- ##### FUNCTION gst_event_new_size ##### -->
377 <!-- ##### FUNCTION gst_event_new_discontinuous ##### -->
388 <!-- ##### FUNCTION gst_event_discont_get_value ##### -->
399 <!-- ##### MACRO gst_event_new_filler ##### -->
401 Create a new dummy event that should be ignored
406 <!-- ##### MACRO gst_event_new_flush ##### -->
408 Create a new flush event.
413 <!-- ##### FUNCTION gst_event_masks_contains ##### -->
423 <!-- ##### MACRO GST_EVENT_MASK_FUNCTION ##### -->
425 A convenience macro to create event mask functions
428 @type: The type of the first argument of the function
429 @functionname: the name of the function
430 @...: event masks, the last element is marked with 0