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