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 |
|
96 * @GST_EVENT_CUSTOM_UPSTREAM: Upstream custom event |
95 * @GST_EVENT_CUSTOM_UPSTREAM: Upstream custom event |
97 * @GST_EVENT_CUSTOM_DOWNSTREAM: Downstream custom event that travels in the |
96 * @GST_EVENT_CUSTOM_DOWNSTREAM: Downstream custom event that travels in the |
98 * data flow. |
97 * data flow. |
99 * @GST_EVENT_CUSTOM_DOWNSTREAM_OOB: Custom out-of-band downstream event. |
98 * @GST_EVENT_CUSTOM_DOWNSTREAM_OOB: Custom out-of-band downstream event. |
100 * @GST_EVENT_CUSTOM_BOTH: Custom upstream or downstream event. |
99 * @GST_EVENT_CUSTOM_BOTH: Custom upstream or downstream event. |
123 /* upstream events */ |
122 /* upstream events */ |
124 GST_EVENT_QOS = GST_EVENT_MAKE_TYPE (15, FLAG(UPSTREAM)), |
123 GST_EVENT_QOS = GST_EVENT_MAKE_TYPE (15, FLAG(UPSTREAM)), |
125 GST_EVENT_SEEK = GST_EVENT_MAKE_TYPE (16, FLAG(UPSTREAM)), |
124 GST_EVENT_SEEK = GST_EVENT_MAKE_TYPE (16, FLAG(UPSTREAM)), |
126 GST_EVENT_NAVIGATION = GST_EVENT_MAKE_TYPE (17, FLAG(UPSTREAM)), |
125 GST_EVENT_NAVIGATION = GST_EVENT_MAKE_TYPE (17, FLAG(UPSTREAM)), |
127 GST_EVENT_LATENCY = GST_EVENT_MAKE_TYPE (18, FLAG(UPSTREAM)), |
126 GST_EVENT_LATENCY = GST_EVENT_MAKE_TYPE (18, FLAG(UPSTREAM)), |
128 GST_EVENT_STEP = GST_EVENT_MAKE_TYPE (19, FLAG(UPSTREAM)), |
|
129 |
127 |
130 /* custom events start here */ |
128 /* custom events start here */ |
131 GST_EVENT_CUSTOM_UPSTREAM = GST_EVENT_MAKE_TYPE (32, FLAG(UPSTREAM)), |
129 GST_EVENT_CUSTOM_UPSTREAM = GST_EVENT_MAKE_TYPE (32, FLAG(UPSTREAM)), |
132 GST_EVENT_CUSTOM_DOWNSTREAM = GST_EVENT_MAKE_TYPE (32, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)), |
130 GST_EVENT_CUSTOM_DOWNSTREAM = GST_EVENT_MAKE_TYPE (32, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)), |
133 GST_EVENT_CUSTOM_DOWNSTREAM_OOB = GST_EVENT_MAKE_TYPE (32, FLAG(DOWNSTREAM)), |
131 GST_EVENT_CUSTOM_DOWNSTREAM_OOB = GST_EVENT_MAKE_TYPE (32, FLAG(DOWNSTREAM)), |
228 gst_mini_object_replace ((GstMiniObject **)(old_event), GST_MINI_OBJECT (new_event)) |
226 gst_mini_object_replace ((GstMiniObject **)(old_event), GST_MINI_OBJECT (new_event)) |
229 |
227 |
230 /** |
228 /** |
231 * GstSeekType: |
229 * GstSeekType: |
232 * @GST_SEEK_TYPE_NONE: no change in position is required |
230 * @GST_SEEK_TYPE_NONE: no change in position is required |
233 * @GST_SEEK_TYPE_CUR: change relative to currently configured segment. This |
231 * @GST_SEEK_TYPE_CUR: change relative to current position |
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. |
|
237 * @GST_SEEK_TYPE_SET: absolute position is requested |
232 * @GST_SEEK_TYPE_SET: absolute position is requested |
238 * @GST_SEEK_TYPE_END: relative position to duration is requested |
233 * @GST_SEEK_TYPE_END: relative position to duration is requested |
239 * |
234 * |
240 * The different types of seek events. When constructing a seek event with |
235 * The different types of seek events. When constructing a seek event with |
241 * gst_event_new_seek(), a format, a seek method and optional flags are to |
236 * gst_event_new_seek(), a format, a seek method and optional flags are to |
257 * @GST_SEEK_FLAG_ACCURATE: accurate position is requested, this might |
252 * @GST_SEEK_FLAG_ACCURATE: accurate position is requested, this might |
258 * be considerably slower for some formats. |
253 * be considerably slower for some formats. |
259 * @GST_SEEK_FLAG_KEY_UNIT: seek to the nearest keyframe. This might be |
254 * @GST_SEEK_FLAG_KEY_UNIT: seek to the nearest keyframe. This might be |
260 * faster but less accurate. |
255 * faster but less accurate. |
261 * @GST_SEEK_FLAG_SEGMENT: perform a segment seek. |
256 * @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. |
|
265 * |
257 * |
266 * Flags to be used with gst_element_seek() or gst_event_new_seek(). All flags |
258 * Flags to be used with gst_element_seek() or gst_event_new_seek(). All flags |
267 * can be used together. |
259 * can be used together. |
268 * |
260 * |
269 * A non flushing seek might take some time to perform as the currently |
261 * A non flushing seek might take some time to perform as the currently |
277 * no EOS will be emmited by the element that performed the seek, but a |
269 * no EOS will be emmited by the element that performed the seek, but a |
278 * #GST_MESSAGE_SEGMENT_DONE message will be posted on the bus by the element. |
270 * #GST_MESSAGE_SEGMENT_DONE message will be posted on the bus by the element. |
279 * When this message is posted, it is possible to send a new seek event to |
271 * When this message is posted, it is possible to send a new seek event to |
280 * continue playback. With this seek method it is possible to perform seemless |
272 * continue playback. With this seek method it is possible to perform seemless |
281 * looping or simple linear editing. |
273 * 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. |
|
287 */ |
274 */ |
288 typedef enum { |
275 typedef enum { |
289 GST_SEEK_FLAG_NONE = 0, |
276 GST_SEEK_FLAG_NONE = 0, |
290 GST_SEEK_FLAG_FLUSH = (1 << 0), |
277 GST_SEEK_FLAG_FLUSH = (1 << 0), |
291 GST_SEEK_FLAG_ACCURATE = (1 << 1), |
278 GST_SEEK_FLAG_ACCURATE = (1 << 1), |
292 GST_SEEK_FLAG_KEY_UNIT = (1 << 2), |
279 GST_SEEK_FLAG_KEY_UNIT = (1 << 2), |
293 GST_SEEK_FLAG_SEGMENT = (1 << 3), |
280 GST_SEEK_FLAG_SEGMENT = (1 << 3) |
294 GST_SEEK_FLAG_SKIP = (1 << 4) |
|
295 } GstSeekFlags; |
281 } GstSeekFlags; |
|
282 |
296 |
283 |
297 /** |
284 /** |
298 * GstEvent: |
285 * GstEvent: |
299 * @mini_object: the parent structure |
286 * @mini_object: the parent structure |
300 * @type: the #GstEventType of the event |
287 * @type: the #GstEventType of the event |
364 #ifdef _FOOL_GTK_DOC_ |
348 #ifdef _FOOL_GTK_DOC_ |
365 G_INLINE_FUNC GstEvent * gst_event_ref (GstEvent * event); |
349 G_INLINE_FUNC GstEvent * gst_event_ref (GstEvent * event); |
366 #endif |
350 #endif |
367 |
351 |
368 static inline GstEvent * |
352 static inline GstEvent * |
369 gst_event_ref (GstEvent * event) |
353 gst_event_ref (GstEvent * ev) |
370 { |
354 { |
371 return (GstEvent *) gst_mini_object_ref (GST_MINI_OBJECT (event)); |
355 /* not using a macro here because gcc-4.1 will complain |
|
356 * if the return value isn't used (because of the cast) */ |
|
357 return (GstEvent *) gst_mini_object_ref (GST_MINI_OBJECT (ev)); |
372 } |
358 } |
373 |
359 |
374 /** |
360 /** |
375 * gst_event_unref: |
361 * gst_event_unref: |
376 * @event: The event to refcount |
362 * @ev: The event to refcount |
377 * |
363 * |
378 * Decrease the refcount of an event, freeing it if the refcount reaches 0. |
364 * Decrease the refcount of an event, freeing it if the refcount reaches 0. |
379 */ |
365 */ |
380 #ifdef _FOOL_GTK_DOC_ |
366 #define gst_event_unref(ev) gst_mini_object_unref (GST_MINI_OBJECT (ev)) |
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 } |
|
389 |
367 |
390 /* copy event */ |
368 /* copy event */ |
391 /** |
369 /** |
392 * gst_event_copy: |
370 * gst_event_copy: |
393 * @event: The event to copy |
371 * @ev: The event to copy |
394 * |
372 * |
395 * Copy the event using the event specific copy function. |
373 * Copy the event using the event specific copy function. |
396 */ |
374 */ |
397 #ifdef _FOOL_GTK_DOC_ |
375 #define gst_event_copy(ev) GST_EVENT_CAST (gst_mini_object_copy (GST_MINI_OBJECT (ev))) |
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 |
|
407 |
376 |
408 /* custom event */ |
377 /* custom event */ |
409 #ifdef __SYMBIAN32__ |
378 #ifdef __SYMBIAN32__ |
410 IMPORT_C |
379 IMPORT_C |
411 #endif |
380 #endif |
568 IMPORT_C |
519 IMPORT_C |
569 #endif |
520 #endif |
570 |
521 |
571 void gst_event_parse_latency (GstEvent *event, GstClockTime *latency); |
522 void gst_event_parse_latency (GstEvent *event, GstClockTime *latency); |
572 |
523 |
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 |
|
587 G_END_DECLS |
524 G_END_DECLS |
588 |
525 |
589 #endif /* __GST_EVENT_H__ */ |
526 #endif /* __GST_EVENT_H__ */ |