90 * @GST_EVENT_SEEK: A request for a new playback position and rate. |
90 * @GST_EVENT_SEEK: A request for a new playback position and rate. |
91 * @GST_EVENT_NAVIGATION: Navigation events are usually used for communicating |
91 * @GST_EVENT_NAVIGATION: Navigation events are usually used for communicating |
92 * user requests, such as mouse or keyboard movements, |
92 * user requests, such as mouse or keyboard movements, |
93 * to upstream elements. |
93 * to upstream elements. |
94 * @GST_EVENT_LATENCY: Notification of new latency adjustment. Since: 0.10.12 |
94 * @GST_EVENT_LATENCY: Notification of new latency adjustment. Since: 0.10.12 |
|
95 * @GST_EVENT_STEP: A request for stepping through the media. Since: 0.10.24 |
95 * @GST_EVENT_CUSTOM_UPSTREAM: Upstream custom event |
96 * @GST_EVENT_CUSTOM_UPSTREAM: Upstream custom event |
96 * @GST_EVENT_CUSTOM_DOWNSTREAM: Downstream custom event that travels in the |
97 * @GST_EVENT_CUSTOM_DOWNSTREAM: Downstream custom event that travels in the |
97 * data flow. |
98 * data flow. |
98 * @GST_EVENT_CUSTOM_DOWNSTREAM_OOB: Custom out-of-band downstream event. |
99 * @GST_EVENT_CUSTOM_DOWNSTREAM_OOB: Custom out-of-band downstream event. |
99 * @GST_EVENT_CUSTOM_BOTH: Custom upstream or downstream event. |
100 * @GST_EVENT_CUSTOM_BOTH: Custom upstream or downstream event. |
122 /* upstream events */ |
123 /* upstream events */ |
123 GST_EVENT_QOS = GST_EVENT_MAKE_TYPE (15, FLAG(UPSTREAM)), |
124 GST_EVENT_QOS = GST_EVENT_MAKE_TYPE (15, FLAG(UPSTREAM)), |
124 GST_EVENT_SEEK = GST_EVENT_MAKE_TYPE (16, FLAG(UPSTREAM)), |
125 GST_EVENT_SEEK = GST_EVENT_MAKE_TYPE (16, FLAG(UPSTREAM)), |
125 GST_EVENT_NAVIGATION = GST_EVENT_MAKE_TYPE (17, FLAG(UPSTREAM)), |
126 GST_EVENT_NAVIGATION = GST_EVENT_MAKE_TYPE (17, FLAG(UPSTREAM)), |
126 GST_EVENT_LATENCY = GST_EVENT_MAKE_TYPE (18, FLAG(UPSTREAM)), |
127 GST_EVENT_LATENCY = GST_EVENT_MAKE_TYPE (18, FLAG(UPSTREAM)), |
|
128 GST_EVENT_STEP = GST_EVENT_MAKE_TYPE (19, FLAG(UPSTREAM)), |
127 |
129 |
128 /* custom events start here */ |
130 /* custom events start here */ |
129 GST_EVENT_CUSTOM_UPSTREAM = GST_EVENT_MAKE_TYPE (32, FLAG(UPSTREAM)), |
131 GST_EVENT_CUSTOM_UPSTREAM = GST_EVENT_MAKE_TYPE (32, FLAG(UPSTREAM)), |
130 GST_EVENT_CUSTOM_DOWNSTREAM = GST_EVENT_MAKE_TYPE (32, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)), |
132 GST_EVENT_CUSTOM_DOWNSTREAM = GST_EVENT_MAKE_TYPE (32, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)), |
131 GST_EVENT_CUSTOM_DOWNSTREAM_OOB = GST_EVENT_MAKE_TYPE (32, FLAG(DOWNSTREAM)), |
133 GST_EVENT_CUSTOM_DOWNSTREAM_OOB = GST_EVENT_MAKE_TYPE (32, FLAG(DOWNSTREAM)), |
226 gst_mini_object_replace ((GstMiniObject **)(old_event), GST_MINI_OBJECT (new_event)) |
228 gst_mini_object_replace ((GstMiniObject **)(old_event), GST_MINI_OBJECT (new_event)) |
227 |
229 |
228 /** |
230 /** |
229 * GstSeekType: |
231 * GstSeekType: |
230 * @GST_SEEK_TYPE_NONE: no change in position is required |
232 * @GST_SEEK_TYPE_NONE: no change in position is required |
231 * @GST_SEEK_TYPE_CUR: change relative to current position |
233 * @GST_SEEK_TYPE_CUR: change relative to currently configured segment. This |
|
234 * can't be used to seek relative to the current playback position - do a |
|
235 * position query, calculate the desired position and then do an absolute |
|
236 * position seek instead if that's what you want to do. |
232 * @GST_SEEK_TYPE_SET: absolute position is requested |
237 * @GST_SEEK_TYPE_SET: absolute position is requested |
233 * @GST_SEEK_TYPE_END: relative position to duration is requested |
238 * @GST_SEEK_TYPE_END: relative position to duration is requested |
234 * |
239 * |
235 * The different types of seek events. When constructing a seek event with |
240 * The different types of seek events. When constructing a seek event with |
236 * gst_event_new_seek(), a format, a seek method and optional flags are to |
241 * gst_event_new_seek(), a format, a seek method and optional flags are to |
252 * @GST_SEEK_FLAG_ACCURATE: accurate position is requested, this might |
257 * @GST_SEEK_FLAG_ACCURATE: accurate position is requested, this might |
253 * be considerably slower for some formats. |
258 * be considerably slower for some formats. |
254 * @GST_SEEK_FLAG_KEY_UNIT: seek to the nearest keyframe. This might be |
259 * @GST_SEEK_FLAG_KEY_UNIT: seek to the nearest keyframe. This might be |
255 * faster but less accurate. |
260 * faster but less accurate. |
256 * @GST_SEEK_FLAG_SEGMENT: perform a segment seek. |
261 * @GST_SEEK_FLAG_SEGMENT: perform a segment seek. |
|
262 * @GST_SEEK_FLAG_SKIP: when doing fast foward or fast reverse playback, allow |
|
263 * elements to skip frames instead of generating all |
|
264 * frames. Since 0.10.22. |
257 * |
265 * |
258 * Flags to be used with gst_element_seek() or gst_event_new_seek(). All flags |
266 * Flags to be used with gst_element_seek() or gst_event_new_seek(). All flags |
259 * can be used together. |
267 * can be used together. |
260 * |
268 * |
261 * A non flushing seek might take some time to perform as the currently |
269 * A non flushing seek might take some time to perform as the currently |
269 * no EOS will be emmited by the element that performed the seek, but a |
277 * no EOS will be emmited by the element that performed the seek, but a |
270 * #GST_MESSAGE_SEGMENT_DONE message will be posted on the bus by the element. |
278 * #GST_MESSAGE_SEGMENT_DONE message will be posted on the bus by the element. |
271 * When this message is posted, it is possible to send a new seek event to |
279 * When this message is posted, it is possible to send a new seek event to |
272 * continue playback. With this seek method it is possible to perform seemless |
280 * continue playback. With this seek method it is possible to perform seemless |
273 * looping or simple linear editing. |
281 * looping or simple linear editing. |
|
282 * |
|
283 * When doing fast forward (rate > 1.0) or fast reverse (rate < -1.0) trickmode |
|
284 * playback, the @GST_SEEK_FLAG_SKIP flag can be used to instruct decoders |
|
285 * and demuxers to adjust the playback rate by skipping frames. This can improve |
|
286 * performance and decrease CPU usage because not all frames need to be decoded. |
274 */ |
287 */ |
275 typedef enum { |
288 typedef enum { |
276 GST_SEEK_FLAG_NONE = 0, |
289 GST_SEEK_FLAG_NONE = 0, |
277 GST_SEEK_FLAG_FLUSH = (1 << 0), |
290 GST_SEEK_FLAG_FLUSH = (1 << 0), |
278 GST_SEEK_FLAG_ACCURATE = (1 << 1), |
291 GST_SEEK_FLAG_ACCURATE = (1 << 1), |
279 GST_SEEK_FLAG_KEY_UNIT = (1 << 2), |
292 GST_SEEK_FLAG_KEY_UNIT = (1 << 2), |
280 GST_SEEK_FLAG_SEGMENT = (1 << 3) |
293 GST_SEEK_FLAG_SEGMENT = (1 << 3), |
|
294 GST_SEEK_FLAG_SKIP = (1 << 4) |
281 } GstSeekFlags; |
295 } GstSeekFlags; |
282 |
|
283 |
296 |
284 /** |
297 /** |
285 * GstEvent: |
298 * GstEvent: |
286 * @mini_object: the parent structure |
299 * @mini_object: the parent structure |
287 * @type: the #GstEventType of the event |
300 * @type: the #GstEventType of the event |
348 #ifdef _FOOL_GTK_DOC_ |
364 #ifdef _FOOL_GTK_DOC_ |
349 G_INLINE_FUNC GstEvent * gst_event_ref (GstEvent * event); |
365 G_INLINE_FUNC GstEvent * gst_event_ref (GstEvent * event); |
350 #endif |
366 #endif |
351 |
367 |
352 static inline GstEvent * |
368 static inline GstEvent * |
353 gst_event_ref (GstEvent * ev) |
369 gst_event_ref (GstEvent * event) |
354 { |
370 { |
355 /* not using a macro here because gcc-4.1 will complain |
371 return (GstEvent *) gst_mini_object_ref (GST_MINI_OBJECT (event)); |
356 * if the return value isn't used (because of the cast) */ |
|
357 return (GstEvent *) gst_mini_object_ref (GST_MINI_OBJECT (ev)); |
|
358 } |
372 } |
359 |
373 |
360 /** |
374 /** |
361 * gst_event_unref: |
375 * gst_event_unref: |
362 * @ev: The event to refcount |
376 * @event: The event to refcount |
363 * |
377 * |
364 * Decrease the refcount of an event, freeing it if the refcount reaches 0. |
378 * Decrease the refcount of an event, freeing it if the refcount reaches 0. |
365 */ |
379 */ |
366 #define gst_event_unref(ev) gst_mini_object_unref (GST_MINI_OBJECT (ev)) |
380 #ifdef _FOOL_GTK_DOC_ |
|
381 G_INLINE_FUNC void gst_event_unref (GstEvent * event); |
|
382 #endif |
|
383 |
|
384 static inline void |
|
385 gst_event_unref (GstEvent * event) |
|
386 { |
|
387 gst_mini_object_unref (GST_MINI_OBJECT (event)); |
|
388 } |
367 |
389 |
368 /* copy event */ |
390 /* copy event */ |
369 /** |
391 /** |
370 * gst_event_copy: |
392 * gst_event_copy: |
371 * @ev: The event to copy |
393 * @event: The event to copy |
372 * |
394 * |
373 * Copy the event using the event specific copy function. |
395 * Copy the event using the event specific copy function. |
374 */ |
396 */ |
375 #define gst_event_copy(ev) GST_EVENT_CAST (gst_mini_object_copy (GST_MINI_OBJECT (ev))) |
397 #ifdef _FOOL_GTK_DOC_ |
|
398 G_INLINE_FUNC void gst_event_copy (GstEvent * event); |
|
399 #endif |
|
400 |
|
401 static inline GstEvent * |
|
402 gst_event_copy (const GstEvent * event) |
|
403 { |
|
404 return GST_EVENT_CAST (gst_mini_object_copy (GST_MINI_OBJECT (event))); |
|
405 } |
|
406 |
376 |
407 |
377 /* custom event */ |
408 /* custom event */ |
378 #ifdef __SYMBIAN32__ |
409 #ifdef __SYMBIAN32__ |
379 IMPORT_C |
410 IMPORT_C |
380 #endif |
411 #endif |
519 IMPORT_C |
568 IMPORT_C |
520 #endif |
569 #endif |
521 |
570 |
522 void gst_event_parse_latency (GstEvent *event, GstClockTime *latency); |
571 void gst_event_parse_latency (GstEvent *event, GstClockTime *latency); |
523 |
572 |
|
573 /* step event */ |
|
574 #ifdef __SYMBIAN32__ |
|
575 IMPORT_C |
|
576 #endif |
|
577 |
|
578 GstEvent* gst_event_new_step (GstFormat format, guint64 amount, gdouble rate, |
|
579 gboolean flush, gboolean intermediate); |
|
580 #ifdef __SYMBIAN32__ |
|
581 IMPORT_C |
|
582 #endif |
|
583 |
|
584 void gst_event_parse_step (GstEvent *event, GstFormat *format, guint64 *amount, |
|
585 gdouble *rate, gboolean *flush, gboolean *intermediate); |
|
586 |
524 G_END_DECLS |
587 G_END_DECLS |
525 |
588 |
526 #endif /* __GST_EVENT_H__ */ |
589 #endif /* __GST_EVENT_H__ */ |