Add new TOC message
[platform/upstream/gstreamer.git] / gst / gstmessage.h
1 /* GStreamer
2  * Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
3  *
4  * gstmessage.h: Header for GstMessage subsystem
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef __GST_MESSAGE_H__
23 #define __GST_MESSAGE_H__
24
25 G_BEGIN_DECLS
26
27 typedef struct _GstMessage GstMessage;
28 typedef struct _GstMessageClass GstMessageClass;
29
30 /**
31  * GstMessageType:
32  * @GST_MESSAGE_UNKNOWN: an undefined message
33  * @GST_MESSAGE_EOS: end-of-stream reached in a pipeline. The application will
34  * only receive this message in the PLAYING state and every time it sets a
35  * pipeline to PLAYING that is in the EOS state. The application can perform a
36  * flushing seek in the pipeline, which will undo the EOS state again.
37  * @GST_MESSAGE_ERROR: an error occured. When the application receives an error
38  * message it should stop playback of the pipeline and not assume that more
39  * data will be played.
40  * @GST_MESSAGE_WARNING: a warning occured.
41  * @GST_MESSAGE_INFO: an info message occured
42  * @GST_MESSAGE_TAG: a tag was found.
43  * @GST_MESSAGE_BUFFERING: the pipeline is buffering. When the application
44  * receives a buffering message in the PLAYING state for a non-live pipeline it
45  * must PAUSE the pipeline until the buffering completes, when the percentage
46  * field in the message is 100%. For live pipelines, no action must be
47  * performed and the buffering percentage can be used to inform the user about
48  * the progress.
49  * @GST_MESSAGE_STATE_CHANGED: a state change happened
50  * @GST_MESSAGE_STATE_DIRTY: an element changed state in a streaming thread.
51  * This message is deprecated.
52  * @GST_MESSAGE_STEP_DONE: a stepping operation finished.
53  * @GST_MESSAGE_CLOCK_PROVIDE: an element notifies its capability of providing
54  *                             a clock. This message is used internally and
55  *                             never forwarded to the application.
56  * @GST_MESSAGE_CLOCK_LOST: The current clock as selected by the pipeline became
57  *                          unusable. The pipeline will select a new clock on
58  *                          the next PLAYING state change. The application
59  *                          should set the pipeline to PAUSED and back to
60  *                          PLAYING when this message is received.
61  * @GST_MESSAGE_NEW_CLOCK: a new clock was selected in the pipeline.
62  * @GST_MESSAGE_STRUCTURE_CHANGE: the structure of the pipeline changed. This
63  * message is used internally and never forwarded to the application.
64  * @GST_MESSAGE_STREAM_STATUS: status about a stream, emitted when it starts,
65  *                             stops, errors, etc..
66  * @GST_MESSAGE_APPLICATION: message posted by the application, possibly
67  *                           via an application-specific element.
68  * @GST_MESSAGE_ELEMENT: element-specific message, see the specific element's
69  *                       documentation
70  * @GST_MESSAGE_SEGMENT_START: pipeline started playback of a segment. This
71  * message is used internally and never forwarded to the application.
72  * @GST_MESSAGE_SEGMENT_DONE: pipeline completed playback of a segment. This
73  * message is forwarded to the application after all elements that posted
74  * @GST_MESSAGE_SEGMENT_START posted a GST_MESSAGE_SEGMENT_DONE message.
75  * @GST_MESSAGE_DURATION: The duration of a pipeline changed. The application
76  * can get the new duration with a duration query.
77  * @GST_MESSAGE_ASYNC_START: Posted by elements when they start an ASYNC
78  * #GstStateChange. This message is not forwarded to the application but is used
79  * internally. Since: 0.10.13.
80  * @GST_MESSAGE_ASYNC_DONE: Posted by elements when they complete an ASYNC
81  * #GstStateChange. The application will only receive this message from the toplevel
82  * pipeline. Since: 0.10.13
83  * @GST_MESSAGE_LATENCY: Posted by elements when their latency changes. The
84  * application should recalculate and distribute a new latency. Since: 0.10.12
85  * @GST_MESSAGE_REQUEST_STATE: Posted by elements when they want the pipeline to
86  * change state. This message is a suggestion to the application which can
87  * decide to perform the state change on (part of) the pipeline. Since: 0.10.23.
88  * @GST_MESSAGE_STEP_START: A stepping operation was started. Since: 0.10.24
89  * @GST_MESSAGE_QOS: A buffer was dropped or an element changed its processing
90  * strategy for Quality of Service reasons. Since: 0.10.29
91  * @GST_MESSAGE_PROGRESS: A progress message. Since: 0.10.33
92  * @GST_MESSAGE_TOC: A new table of contents (TOC) was found or previously found TOC
93  * was updated. Since: 0.10.37
94  * @GST_MESSAGE_ANY: mask for all of the above messages.
95  *
96  * The different message types that are available.
97  */
98 /* NOTE: keep in sync with quark registration in gstmessage.c
99  * NOTE: keep GST_MESSAGE_ANY a valid gint to avoid compiler warnings.
100  */
101 typedef enum
102 {
103   GST_MESSAGE_UNKNOWN           = 0,
104   GST_MESSAGE_EOS               = (1 << 0),
105   GST_MESSAGE_ERROR             = (1 << 1),
106   GST_MESSAGE_WARNING           = (1 << 2),
107   GST_MESSAGE_INFO              = (1 << 3),
108   GST_MESSAGE_TAG               = (1 << 4),
109   GST_MESSAGE_BUFFERING         = (1 << 5),
110   GST_MESSAGE_STATE_CHANGED     = (1 << 6),
111   GST_MESSAGE_STATE_DIRTY       = (1 << 7),
112   GST_MESSAGE_STEP_DONE         = (1 << 8),
113   GST_MESSAGE_CLOCK_PROVIDE     = (1 << 9),
114   GST_MESSAGE_CLOCK_LOST        = (1 << 10),
115   GST_MESSAGE_NEW_CLOCK         = (1 << 11),
116   GST_MESSAGE_STRUCTURE_CHANGE  = (1 << 12),
117   GST_MESSAGE_STREAM_STATUS     = (1 << 13),
118   GST_MESSAGE_APPLICATION       = (1 << 14),
119   GST_MESSAGE_ELEMENT           = (1 << 15),
120   GST_MESSAGE_SEGMENT_START     = (1 << 16),
121   GST_MESSAGE_SEGMENT_DONE      = (1 << 17),
122   GST_MESSAGE_DURATION          = (1 << 18),
123   GST_MESSAGE_LATENCY           = (1 << 19),
124   GST_MESSAGE_ASYNC_START       = (1 << 20),
125   GST_MESSAGE_ASYNC_DONE        = (1 << 21),
126   GST_MESSAGE_REQUEST_STATE     = (1 << 22),
127   GST_MESSAGE_STEP_START        = (1 << 23),
128   GST_MESSAGE_QOS               = (1 << 24),
129   GST_MESSAGE_PROGRESS          = (1 << 25),
130   GST_MESSAGE_TOC               = (1 << 26),
131   GST_MESSAGE_ANY               = ~0
132 } GstMessageType;
133
134 #include <gst/gstminiobject.h>
135 #include <gst/gstobject.h>
136 #include <gst/gstelement.h>
137 #include <gst/gsttaglist.h>
138 #include <gst/gststructure.h>
139 #include <gst/gsttoc.h>
140
141 /**
142  * GST_MESSAGE_TRACE_NAME:
143  *
144  * The name used for memory allocation tracing
145  */
146 #define GST_MESSAGE_TRACE_NAME  "GstMessage"
147
148 #define GST_TYPE_MESSAGE                         (gst_message_get_type())
149 #define GST_IS_MESSAGE(obj)                      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MESSAGE))
150 #define GST_IS_MESSAGE_CLASS(klass)              (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MESSAGE))
151 #define GST_MESSAGE_GET_CLASS(obj)               (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MESSAGE, GstMessageClass))
152 #define GST_MESSAGE(obj)                         (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MESSAGE, GstMessage))
153 #define GST_MESSAGE_CLASS(klass)                 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MESSAGE, GstMessageClass))
154 #define GST_MESSAGE_CAST(obj)                    ((GstMessage*)(obj))
155
156 /* the lock is used to handle the synchronous handling of messages,
157  * the emiting thread is block until the handling thread processed
158  * the message using this mutex/cond pair */
159 #define GST_MESSAGE_GET_LOCK(message)   (GST_MESSAGE_CAST(message)->lock)
160 #define GST_MESSAGE_LOCK(message)       g_mutex_lock(GST_MESSAGE_GET_LOCK(message))
161 #define GST_MESSAGE_UNLOCK(message)     g_mutex_unlock(GST_MESSAGE_GET_LOCK(message))
162 #define GST_MESSAGE_COND(message)       (GST_MESSAGE_CAST(message)->cond)
163 #define GST_MESSAGE_WAIT(message)       g_cond_wait(GST_MESSAGE_COND(message),GST_MESSAGE_GET_LOCK(message))
164 #define GST_MESSAGE_SIGNAL(message)     g_cond_signal(GST_MESSAGE_COND(message))
165
166 /**
167  * GST_MESSAGE_TYPE:
168  * @message: a #GstMessage
169  *
170  * Get the #GstMessageType of @message.
171  */
172 #define GST_MESSAGE_TYPE(message)       (GST_MESSAGE_CAST(message)->type)
173 /**
174  * GST_MESSAGE_TYPE_NAME:
175  * @message: a #GstMessage
176  *
177  * Get a constant string representation of the #GstMessageType of @message.
178  *
179  * Since: 0.10.4
180  */
181 #define GST_MESSAGE_TYPE_NAME(message)  gst_message_type_get_name(GST_MESSAGE_TYPE(message))
182 /**
183  * GST_MESSAGE_TIMESTAMP:
184  * @message: a #GstMessage
185  *
186  * Get the timestamp of @message. This is the timestamp when the message
187  * was created.
188  */
189 #define GST_MESSAGE_TIMESTAMP(message)  (GST_MESSAGE_CAST(message)->timestamp)
190 /**
191  * GST_MESSAGE_SRC:
192  * @message: a #GstMessage
193  *
194  * Get the object that posted @message.
195  */
196 #define GST_MESSAGE_SRC(message)        (GST_MESSAGE_CAST(message)->src)
197 /**
198  * GST_MESSAGE_SRC_NAME:
199  * @message: a #GstMessage
200  *
201  * Get the name of the object that posted @message. Returns "(NULL)" if
202  * the message has no source object set.
203  *
204  * Since: 0.10.24
205  */
206 #define GST_MESSAGE_SRC_NAME(message)   (GST_MESSAGE_SRC(message) ? \
207     GST_OBJECT_NAME (GST_MESSAGE_SRC(message)) : "(NULL)")
208
209 /**
210  * GstStructureChangeType:
211  * @GST_STRUCTURE_CHANGE_TYPE_PAD_LINK: Pad linking is starting or done.
212  * @GST_STRUCTURE_CHANGE_TYPE_PAD_UNLINK: Pad unlinking is starting or done.
213  *
214  * The type of a %GST_MESSAGE_STRUCTURE_CHANGE.
215  *
216  * Since: 0.10.22
217  */
218 typedef enum {
219   GST_STRUCTURE_CHANGE_TYPE_PAD_LINK   = 0,
220   GST_STRUCTURE_CHANGE_TYPE_PAD_UNLINK = 1
221 } GstStructureChangeType;
222
223 /**
224  * GstStreamStatusType:
225  * @GST_STREAM_STATUS_TYPE_CREATE: A new thread need to be created.
226  * @GST_STREAM_STATUS_TYPE_ENTER: a thread entered its loop function
227  * @GST_STREAM_STATUS_TYPE_LEAVE: a thread left its loop function
228  * @GST_STREAM_STATUS_TYPE_DESTROY: a thread is destroyed
229  * @GST_STREAM_STATUS_TYPE_START: a thread is started
230  * @GST_STREAM_STATUS_TYPE_PAUSE: a thread is paused
231  * @GST_STREAM_STATUS_TYPE_STOP: a thread is stopped
232  *
233  * The type of a %GST_MESSAGE_STREAM_STATUS. The stream status messages inform the
234  * application of new streaming threads and their status.
235  *
236  * Since: 0.10.24
237  */
238 typedef enum {
239   GST_STREAM_STATUS_TYPE_CREATE   = 0,
240   GST_STREAM_STATUS_TYPE_ENTER    = 1,
241   GST_STREAM_STATUS_TYPE_LEAVE    = 2,
242   GST_STREAM_STATUS_TYPE_DESTROY  = 3,
243
244   GST_STREAM_STATUS_TYPE_START    = 8,
245   GST_STREAM_STATUS_TYPE_PAUSE    = 9,
246   GST_STREAM_STATUS_TYPE_STOP     = 10
247 } GstStreamStatusType;
248
249 /**
250  * GstProgressType:
251  * @GST_PROGRESS_TYPE_START: A new task started.
252  * @GST_PROGRESS_TYPE_CONTINUE: A task completed and a new one continues.
253  * @GST_PROGRESS_TYPE_COMPLETE: A task completed.
254  * @GST_PROGRESS_TYPE_CANCELED: A task was canceled.
255  * @GST_PROGRESS_TYPE_ERROR: A task caused an error. An error message is also
256  *          posted on the bus.
257  *
258  * The type of a %GST_MESSAGE_PROGRESS. The progress messages inform the
259  * application of the status of assynchronous tasks.
260  *
261  * Since: 0.10.33
262  */
263 typedef enum {
264   GST_PROGRESS_TYPE_START    = 0,
265   GST_PROGRESS_TYPE_CONTINUE = 1,
266   GST_PROGRESS_TYPE_COMPLETE = 2,
267   GST_PROGRESS_TYPE_CANCELED = 3,
268   GST_PROGRESS_TYPE_ERROR    = 4,
269 } GstProgressType;
270
271 /**
272  * GstMessage:
273  * @mini_object: the parent structure
274  * @type: the #GstMessageType of the message
275  * @timestamp: the timestamp of the message
276  * @src: the src of the message
277  * @structure: the #GstStructure containing the message info.
278  *
279  * A #GstMessage.
280  */
281 struct _GstMessage
282 {
283   GstMiniObject mini_object;
284
285   /*< private >*//* with MESSAGE_LOCK */
286   GMutex *lock;                 /* lock and cond for async delivery */
287   GCond *cond;
288
289   /*< public > *//* with COW */
290   GstMessageType type;
291   guint64 timestamp;
292   GstObject *src;
293
294   GstStructure *structure;
295
296   /*< private >*/
297   union {
298     struct {
299       guint32 seqnum;
300     } ABI;
301     /* + 0 to mark ABI change for future greppage */
302     gpointer _gst_reserved[GST_PADDING + 0];
303   } abidata;
304 };
305
306 struct _GstMessageClass {
307   GstMiniObjectClass mini_object_class;
308
309   /*< private >*/
310   gpointer _gst_reserved[GST_PADDING];
311 };
312
313 GType           gst_message_get_type            (void);
314
315 const gchar*    gst_message_type_get_name       (GstMessageType type);
316 GQuark          gst_message_type_to_quark       (GstMessageType type);
317
318 /* refcounting */
319 /**
320  * gst_message_ref:
321  * @msg: the message to ref
322  *
323  * Convenience macro to increase the reference count of the message.
324  *
325  * Returns: @msg (for convenience when doing assignments)
326  */
327 #ifdef _FOOL_GTK_DOC_
328 G_INLINE_FUNC GstMessage * gst_message_ref (GstMessage * msg);
329 #endif
330
331 static inline GstMessage *
332 gst_message_ref (GstMessage * msg)
333 {
334   return (GstMessage *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (msg));
335 }
336
337 /**
338  * gst_message_unref:
339  * @msg: the message to unref
340  *
341  * Convenience macro to decrease the reference count of the message, possibly
342  * freeing it.
343  */
344 #ifdef _FOOL_GTK_DOC_
345 G_INLINE_FUNC void gst_message_unref (GstMessage * msg);
346 #endif
347
348 static inline void
349 gst_message_unref (GstMessage * msg)
350 {
351   gst_mini_object_unref (GST_MINI_OBJECT_CAST (msg));
352 }
353
354 /* copy message */
355 /**
356  * gst_message_copy:
357  * @msg: the message to copy
358  *
359  * Creates a copy of the message. Returns a copy of the message.
360  *
361  * Returns: (transfer full): a new copy of @msg.
362  *
363  * MT safe
364  */
365 #ifdef _FOOL_GTK_DOC_
366 G_INLINE_FUNC GstMessage * gst_message_copy (const GstMessage * msg);
367 #endif
368
369 static inline GstMessage *
370 gst_message_copy (const GstMessage * msg)
371 {
372   return GST_MESSAGE_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (msg)));
373 }
374
375 /**
376  * gst_message_make_writable:
377  * @msg: (transfer full): the message to make writable
378  *
379  * Checks if a message is writable. If not, a writable copy is made and
380  * returned.
381  *
382  * Returns: (transfer full): a message (possibly a duplicate) that is writable.
383  *
384  * MT safe
385  */
386 #define         gst_message_make_writable(msg)  GST_MESSAGE_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (msg)))
387
388 /* identifiers for events and messages */
389 guint32         gst_message_get_seqnum          (GstMessage *message);
390 void            gst_message_set_seqnum          (GstMessage *message, guint32 seqnum);
391
392 /* EOS */
393 GstMessage *    gst_message_new_eos             (GstObject * src) G_GNUC_MALLOC;
394
395 /* ERROR */
396
397 GstMessage *    gst_message_new_error           (GstObject * src, GError * error, const gchar * debug) G_GNUC_MALLOC;
398 void            gst_message_parse_error         (GstMessage *message, GError **gerror, gchar **debug);
399
400 /* WARNING */
401 GstMessage *    gst_message_new_warning         (GstObject * src, GError * error, const gchar * debug) G_GNUC_MALLOC;
402 void            gst_message_parse_warning       (GstMessage *message, GError **gerror, gchar **debug);
403
404 /* INFO */
405 GstMessage *    gst_message_new_info            (GstObject * src, GError * error, const gchar * debug) G_GNUC_MALLOC;
406 void            gst_message_parse_info          (GstMessage *message, GError **gerror, gchar **debug);
407
408 /* TAG */
409 GstMessage *    gst_message_new_tag             (GstObject * src, GstTagList * tag_list) G_GNUC_MALLOC;
410 GstMessage *    gst_message_new_tag_full        (GstObject * src, GstPad *pad, GstTagList * tag_list) G_GNUC_MALLOC;
411 void            gst_message_parse_tag           (GstMessage *message, GstTagList **tag_list);
412 void            gst_message_parse_tag_full      (GstMessage *message, GstPad **pad, GstTagList **tag_list);
413
414 /* BUFFERING */
415 GstMessage *    gst_message_new_buffering         (GstObject * src, gint percent) G_GNUC_MALLOC;
416 void            gst_message_parse_buffering       (GstMessage *message, gint *percent);
417 void            gst_message_set_buffering_stats   (GstMessage *message, GstBufferingMode mode,
418                                                    gint avg_in, gint avg_out,
419                                                    gint64 buffering_left);
420 void            gst_message_parse_buffering_stats (GstMessage *message, GstBufferingMode *mode,
421                                                    gint *avg_in, gint *avg_out,
422                                                    gint64 *buffering_left);
423
424 /* STATE_CHANGED */
425 GstMessage *    gst_message_new_state_changed   (GstObject * src, GstState oldstate,
426                                                  GstState newstate, GstState pending) G_GNUC_MALLOC;
427 void            gst_message_parse_state_changed (GstMessage *message, GstState *oldstate,
428                                                  GstState *newstate, GstState *pending);
429
430 /* STATE_DIRTY */
431 GstMessage *    gst_message_new_state_dirty     (GstObject * src) G_GNUC_MALLOC;
432
433 /* STEP_DONE */
434 GstMessage *    gst_message_new_step_done       (GstObject * src, GstFormat format, guint64 amount,
435                                                  gdouble rate, gboolean flush, gboolean intermediate,
436                                                  guint64 duration, gboolean eos) G_GNUC_MALLOC;
437 void            gst_message_parse_step_done     (GstMessage * message, GstFormat *format, guint64 *amount,
438                                                  gdouble *rate, gboolean *flush, gboolean *intermediate,
439                                                  guint64 *duration, gboolean *eos);
440 /* CLOCK_PROVIDE */
441 GstMessage *    gst_message_new_clock_provide   (GstObject * src, GstClock *clock, gboolean ready) G_GNUC_MALLOC;
442 void            gst_message_parse_clock_provide (GstMessage *message, GstClock **clock,
443                                                  gboolean *ready);
444
445 /* CLOCK_LOST */
446 GstMessage *    gst_message_new_clock_lost      (GstObject * src, GstClock *clock) G_GNUC_MALLOC;
447 void            gst_message_parse_clock_lost    (GstMessage *message, GstClock **clock);
448
449 /* NEW_CLOCK */
450 GstMessage *    gst_message_new_new_clock       (GstObject * src, GstClock *clock) G_GNUC_MALLOC;
451 void            gst_message_parse_new_clock     (GstMessage *message, GstClock **clock);
452
453 /* APPLICATION */
454 GstMessage *    gst_message_new_application     (GstObject * src, GstStructure * structure) G_GNUC_MALLOC;
455
456 /* ELEMENT */
457 GstMessage *    gst_message_new_element         (GstObject * src, GstStructure * structure) G_GNUC_MALLOC;
458
459 /* SEGMENT_START */
460 GstMessage *    gst_message_new_segment_start   (GstObject * src, GstFormat format, gint64 position) G_GNUC_MALLOC;
461 void            gst_message_parse_segment_start (GstMessage *message, GstFormat *format,
462                                                  gint64 *position);
463
464 /* SEGMENT_DONE */
465 GstMessage *    gst_message_new_segment_done    (GstObject * src, GstFormat format, gint64 position) G_GNUC_MALLOC;
466 void            gst_message_parse_segment_done  (GstMessage *message, GstFormat *format,
467                                                  gint64 *position);
468
469 /* DURATION */
470 GstMessage *    gst_message_new_duration        (GstObject * src, GstFormat format, gint64 duration) G_GNUC_MALLOC;
471 void            gst_message_parse_duration      (GstMessage *message, GstFormat *format,
472                                                  gint64 *duration);
473
474 /* LATENCY */
475 GstMessage *    gst_message_new_latency         (GstObject * src) G_GNUC_MALLOC;
476
477 /* ASYNC_START */
478 GstMessage *    gst_message_new_async_start     (GstObject * src, gboolean new_base_time) G_GNUC_MALLOC;
479 void            gst_message_parse_async_start   (GstMessage *message, gboolean *new_base_time);
480
481 /* ASYNC_DONE */
482 GstMessage *    gst_message_new_async_done      (GstObject * src) G_GNUC_MALLOC;
483
484 /* STRUCTURE CHANGE */
485 GstMessage *    gst_message_new_structure_change   (GstObject * src, GstStructureChangeType type,
486                                                     GstElement *owner, gboolean busy) G_GNUC_MALLOC;
487 void            gst_message_parse_structure_change (GstMessage *message, GstStructureChangeType *type,
488                                                     GstElement **owner, gboolean *busy);
489
490 /* STREAM STATUS */
491 GstMessage *    gst_message_new_stream_status        (GstObject * src, GstStreamStatusType type,
492                                                       GstElement *owner) G_GNUC_MALLOC;
493 void            gst_message_parse_stream_status      (GstMessage *message, GstStreamStatusType *type,
494                                                       GstElement **owner);
495 void            gst_message_set_stream_status_object (GstMessage *message, const GValue *object);
496 const GValue *  gst_message_get_stream_status_object (GstMessage *message);
497
498 /* REQUEST_STATE */
499 GstMessage *    gst_message_new_request_state   (GstObject * src, GstState state) G_GNUC_MALLOC;
500 void            gst_message_parse_request_state (GstMessage * message, GstState *state);
501
502 /* STEP_START */
503 GstMessage *    gst_message_new_step_start      (GstObject * src, gboolean active, GstFormat format,
504                                                  guint64 amount, gdouble rate, gboolean flush,
505                                                  gboolean intermediate) G_GNUC_MALLOC;
506 void            gst_message_parse_step_start    (GstMessage * message, gboolean *active, GstFormat *format,
507                                                  guint64 *amount, gdouble *rate, gboolean *flush,
508                                                  gboolean *intermediate);
509
510 /* QOS */
511 GstMessage *    gst_message_new_qos             (GstObject * src, gboolean live, guint64 running_time,
512                                                  guint64 stream_time, guint64 timestamp, guint64 duration) G_GNUC_MALLOC;
513 void            gst_message_set_qos_values      (GstMessage * message, gint64 jitter, gdouble proportion,
514                                                  gint quality);
515 void            gst_message_set_qos_stats       (GstMessage * message, GstFormat format, guint64 processed,
516                                                  guint64 dropped);
517 void            gst_message_parse_qos           (GstMessage * message, gboolean * live, guint64 * running_time,
518                                                  guint64 * stream_time, guint64 * timestamp, guint64 * duration);
519 void            gst_message_parse_qos_values    (GstMessage * message, gint64 * jitter, gdouble * proportion,
520                                                  gint * quality);
521 void            gst_message_parse_qos_stats     (GstMessage * message, GstFormat * format, guint64 * processed,
522                                                  guint64 * dropped);
523 /* PROGRESS */
524 GstMessage *    gst_message_new_progress           (GstObject * src, GstProgressType type, const gchar *code,
525                                                     const gchar *text) G_GNUC_MALLOC;
526 void            gst_message_parse_progress         (GstMessage * message, GstProgressType * type, gchar ** code,
527                                                     gchar ** text);
528
529 /* TOC */
530 GstMessage *    gst_message_new_toc             (GstObject *src, GstToc *toc, gboolean updated);
531 void            gst_message_parse_toc           (GstMessage *message, GstToc **toc, gboolean *updated);
532
533 /* custom messages */
534 GstMessage *    gst_message_new_custom          (GstMessageType type,
535                                                  GstObject    * src,
536                                                  GstStructure * structure) G_GNUC_MALLOC;
537 const GstStructure *  gst_message_get_structure (GstMessage *message);
538
539 G_END_DECLS
540
541 #endif /* __GST_MESSAGE_H__ */