1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gstreamer.Message;
26 
27 private import glib.ConstructionException;
28 private import glib.ErrorG;
29 private import glib.Str;
30 private import gobject.ObjectG;
31 private import gobject.Value;
32 private import gstreamer.Clock;
33 private import gstreamer.Context;
34 private import gstreamer.Device;
35 private import gstreamer.Element;
36 private import gstreamer.ObjectGst;
37 private import gstreamer.Stream;
38 private import gstreamer.StreamCollection;
39 private import gstreamer.Structure;
40 private import gstreamer.TagList;
41 private import gstreamer.Toc;
42 private import gstreamer.c.functions;
43 public  import gstreamer.c.types;
44 public  import gstreamerc.gstreamertypes;
45 
46 
47 /**
48  * Messages are implemented as a subclass of #GstMiniObject with a generic
49  * #GstStructure as the content. This allows for writing custom messages without
50  * requiring an API change while allowing a wide range of different types
51  * of messages.
52  * 
53  * Messages are posted by objects in the pipeline and are passed to the
54  * application using the #GstBus.
55  * 
56  * The basic use pattern of posting a message on a #GstBus is as follows:
57  * |[<!-- language="C" -->
58  * gst_bus_post (bus, gst_message_new_eos());
59  * ]|
60  * 
61  * A #GstElement usually posts messages on the bus provided by the parent
62  * container using gst_element_post_message().
63  */
64 public class Message
65 {
66 	/** the main Gtk struct */
67 	protected GstMessage* gstMessage;
68 	protected bool ownedRef;
69 
70 	/** Get the main Gtk struct */
71 	public GstMessage* getMessageStruct(bool transferOwnership = false)
72 	{
73 		if (transferOwnership)
74 			ownedRef = false;
75 		return gstMessage;
76 	}
77 
78 	/** the main Gtk struct as a void* */
79 	protected void* getStruct()
80 	{
81 		return cast(void*)gstMessage;
82 	}
83 
84 	/**
85 	 * Sets our main struct and passes it to the parent class.
86 	 */
87 	public this (GstMessage* gstMessage, bool ownedRef = false)
88 	{
89 		this.gstMessage = gstMessage;
90 		this.ownedRef = ownedRef;
91 	}
92 
93 	/**
94 	 * Get the type of the message.
95 	 */
96 	public GstMessageType type()
97 	{
98 		return cast(GstMessageType)getMessageStruct().type;
99 	}
100 
101 	/**
102 	 * Get the src (the element that originated the message) of the message.
103 	 */
104 	public ObjectGst src()
105 	{
106 		return new ObjectGst( cast(GstObject*)getMessageStruct().src );
107 	}
108 
109 	/**
110 	 * Create a new element-specific message. This is meant as a generic way of
111 	 * allowing one-way communication from an element to an application, for example
112 	 * "the firewire cable was unplugged". The format of the message should be
113 	 * documented in the element's documentation. The structure field can be NULL.
114 	 * MT safe.
115 	 * Params:
116 	 *  src = The object originating the message.
117 	 *  structure = The structure for the message. The message will take ownership of
118 	 *  the structure.
119 	 * Returns:
120 	 *  The new element message.
121 	 */
122 	public static Message newElement(ObjectGst src, Structure structure)
123 	{
124 		// GstMessage* gst_message_new_element (GstObject *src,  GstStructure *structure);
125 		auto p = gst_message_new_element((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct());
126 
127 		if(p is null)
128 		{
129 			throw new ConstructionException("null returned by gst_message_new_element");
130 		}
131 
132 		return new Message(cast(GstMessage*)p); //, true);
133 	}
134 
135 	/**
136 	 * Create a new clock message. This message is posted whenever the
137 	 * pipeline selectes a new clock for the pipeline.
138 	 * MT safe.
139 	 * Params:
140 	 *  src = The object originating the message.
141 	 *  clock = the new selected clock
142 	 * Returns:
143 	 *  The new new clock message.
144 	 */
145 	public static Message newNewClock(ObjectGst src, Clock clock)
146 	{
147 		// GstMessage* gst_message_new_new_clock (GstObject *src,  GstClock *clock);
148 		auto p = gst_message_new_new_clock((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct());
149 
150 		if(p is null)
151 		{
152 			throw new ConstructionException("null returned by gst_message_new_new_clock");
153 		}
154 
155 		return new Message(cast(GstMessage*)p); //, true);
156 	}
157 
158 	/**
159 	 * Create a new segment done message. This message is posted by elements that
160 	 * finish playback of a segment as a result of a segment seek. This message
161 	 * is received by the application after all elements that posted a segment_start
162 	 * have posted the segment_done.
163 	 * MT safe.
164 	 * Params:
165 	 *  src = The object originating the message.
166 	 *  format = The format of the position being done
167 	 *  position = The position of the segment being done
168 	 * Returns:
169 	 *  The new segment done message.
170 	 */
171 	public static Message newSegmentDone(ObjectGst src, GstFormat format, long position)
172 	{
173 		// GstMessage* gst_message_new_segment_done (GstObject *src,  GstFormat format,  gint64 position);
174 		auto p = gst_message_new_segment_done((src is null) ? null : src.getObjectGstStruct(), format, position);
175 
176 		if(p is null)
177 		{
178 			throw new ConstructionException("null returned by gst_message_new_segment_done");
179 		}
180 
181 		return new Message(cast(GstMessage*)p); //, true);
182 	}
183 
184 	/**
185 	 * Create a new segment message. This message is posted by elements that
186 	 * start playback of a segment as a result of a segment seek. This message
187 	 * is not received by the application but is used for maintenance reasons in
188 	 * container elements.
189 	 * MT safe.
190 	 * Params:
191 	 *  src = The object originating the message.
192 	 *  format = The format of the position being played
193 	 *  position = The position of the segment being played
194 	 * Returns:
195 	 *  The new segment start message.
196 	 */
197 	public static Message newSegmentStart(ObjectGst src, GstFormat format, long position)
198 	{
199 		// GstMessage* gst_message_new_segment_start (GstObject *src,  GstFormat format,  gint64 position);
200 		auto p = gst_message_new_segment_start((src is null) ? null : src.getObjectGstStruct(), format, position);
201 
202 		if(p is null)
203 		{
204 			throw new ConstructionException("null returned by gst_message_new_segment_start");
205 		}
206 
207 		return new Message(cast(GstMessage*)p); //, true);
208 	}
209 
210 	/**
211 	 * Create a new warning message. The message will make copies of error and
212 	 * debug.
213 	 * MT safe.
214 	 * Params:
215 	 *  src = The object originating the message.
216 	 *  error = The GError for this message.
217 	 *  debug = A debugging string for something or other.
218 	 * Returns:
219 	 *  The new warning message.
220 	 */
221 	public static Message newWarning(ObjectGst src, ErrorG error, string dbug)
222 	{
223 		// GstMessage* gst_message_new_warning (GstObject *src,  GError *error,  gchar *debug);
224 		auto p = gst_message_new_warning((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug));
225 
226 		if(p is null)
227 		{
228 			throw new ConstructionException("null returned by gst_message_new_warning");
229 		}
230 
231 		return new Message(cast(GstMessage*)p); //, true);
232 	}
233 
234 	/**
235 	 * Create a state dirty message. This message is posted whenever an element
236 	 * changed its state asynchronously and is used internally to update the
237 	 * states of container objects.
238 	 * MT safe.
239 	 * Params:
240 	 *  src = the object originating the message
241 	 * Returns:
242 	 *  The new state dirty message.
243 	 */
244 	public static Message newStateDirty(ObjectGst src)
245 	{
246 		// GstMessage* gst_message_new_state_dirty (GstObject *src);
247 		auto p = gst_message_new_state_dirty((src is null) ? null : src.getObjectGstStruct());
248 
249 		if(p is null)
250 		{
251 			throw new ConstructionException("null returned by gst_message_new_state_dirty");
252 		}
253 
254 		return new Message(cast(GstMessage*)p); //, true);
255 	}
256 
257 	/**
258 	 * Create a new eos message. This message is generated and posted in
259 	 * the sink elements of a GstBin. The bin will only forward the EOS
260 	 * message to the application if all sinks have posted an EOS message.
261 	 * MT safe.
262 	 * Params:
263 	 *  src = The object originating the message.
264 	 * Returns:
265 	 *  The new eos message.
266 	 */
267 	public static Message newEOS(ObjectGst src)
268 	{
269 		// GstMessage* gst_message_new_eos (GstObject *src);
270 		auto p = gst_message_new_eos((src is null) ? null : src.getObjectGstStruct());
271 
272 		if(p is null)
273 		{
274 			throw new ConstructionException("null returned by gst_message_new_eos");
275 		}
276 
277 		return new Message(cast(GstMessage*)p); //, true);
278 	}
279 
280 	/**
281 	 * Create a new error message. The message will copy error and
282 	 * debug. This message is posted by element when a fatal event
283 	 * occured. The pipeline will probably (partially) stop. The application
284 	 * receiving this message should stop the pipeline.
285 	 * MT safe.
286 	 * Params:
287 	 *  src = The object originating the message.
288 	 *  error = The GError for this message.
289 	 *  debug = A debugging string for something or other.
290 	 * Returns:
291 	 *  The new error message.
292 	 */
293 	public static Message newError(ObjectGst src, ErrorG error, string dbug)
294 	{
295 		// GstMessage* gst_message_new_error (GstObject *src,  GError *error,  gchar *debug);
296 		auto p = gst_message_new_error((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug));
297 
298 		if(p is null)
299 		{
300 			throw new ConstructionException("null returned by gst_message_new_error");
301 		}
302 
303 		return new Message(cast(GstMessage*)p); //, true);
304 	}
305 
306 	/**
307 	 * Create a new info message. The message will make copies of error and
308 	 * debug.
309 	 * MT safe.
310 	 * Since 0.10.12
311 	 * Params:
312 	 *  src = The object originating the message.
313 	 *  error = The GError for this message.
314 	 *  debug = A debugging string for something or other.
315 	 * Returns:
316 	 *  The new info message.
317 	 */
318 	public static Message newInfo(ObjectGst src, ErrorG error, string dbug)
319 	{
320 		// GstMessage* gst_message_new_info (GstObject *src,  GError *error,  gchar *debug);
321 		auto p = gst_message_new_info((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug));
322 
323 		if(p is null)
324 		{
325 			throw new ConstructionException("null returned by gst_message_new_info");
326 		}
327 
328 		return new Message(cast(GstMessage*)p); //, true);
329 	}
330 
331 	/**
332 	 * This message can be posted by elements when their latency requirements
333 	 * have changed.
334 	 * Params:
335 	 *     src = The object originating the message.
336 	 * Returns:
337 	 * The new latency message. MT safe.
338 	 */
339 	public static Message newLatency(ObjectGst src)
340 	{
341 		// GstMessage* gst_message_new_latency (GstObject *src);
342 		auto p = gst_message_new_latency((src is null) ? null : src.getObjectGstStruct());
343 
344 		if(p is null)
345 		{
346 			throw new ConstructionException("null returned by gst_message_new_latency");
347 		}
348 
349 		return new Message(cast(GstMessage*)p); //, true);
350 	}
351 
352 	/**
353 	 * Create a new duration changed message. This message is posted by elements
354 	 * that know the duration of a stream when the duration changes. This message
355 	 * is received by bins and is used to calculate the total duration of a
356 	 * pipeline. Elements may post a duration message with a duration of
357 	 * GST_CLOCK_TIME_NONE to indicate that the duration has changed and the
358 	 * cached duration should be discarded. The new duration can then be
359 	 * retrieved via a query.
360 	 * Params:
361 	 *    src = The object originating the message. [transfer none]
362 	 * Throws: ConstructionException GTK+ fails to create the object.
363 	 */
364 	public static Message newDurationChanged(ObjectGst src)
365 	{
366 		// GstMessage * gst_message_new_duration_changed (GstObject *src);
367 		auto p = gst_message_new_duration_changed((src is null) ? null : src.getObjectGstStruct());
368 
369 		if(p is null)
370 		{
371 			throw new ConstructionException("null returned by gst_message_new_duration_changed((src is null) ? null : src.getObjectGstStruct())");
372 		}
373 
374 		return new Message(cast(GstMessage*)p); //, true);
375 	}
376 
377 	/**
378 	 * This message is posted by elements when they start an ASYNC state change.
379 	 * Params:
380 	 * src = The object originating the message. [transfer none]
381 	 * Throws: ConstructionException GTK+ fails to create the object.
382 	 */
383 	public static Message newAsyncStart(ObjectGst src)
384 	{
385 		// GstMessage * gst_message_new_async_start (GstObject *src);
386 		auto p = gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct());
387 		if(p is null)
388 		{
389 			throw new ConstructionException("null returned by gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct())");
390 		}
391 		return new Message(cast(GstMessage*)p); //, true);
392 	}
393 
394 	/**
395 	 * The message is posted when elements completed an ASYNC state change.
396 	 * running_time contains the time of the desired running_time when this
397 	 * elements goes to PLAYING. A value of GST_CLOCK_TIME_NONE for running_time
398 	 * means that the element has no clock interaction and thus doesn't care about
399 	 * the running_time of the pipeline.
400 	 * Params:
401 	 * src = The object originating the message. [transfer none]
402 	 * runningTime = the desired running_time
403 	 * Throws: ConstructionException GTK+ fails to create the object.
404 	 */
405 	public static Message newAsyncDone(ObjectGst src, GstClockTime runningTime)
406 	{
407 		// GstMessage * gst_message_new_async_done (GstObject *src,  GstClockTime running_time);
408 		auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime);
409 		if(p is null)
410 		{
411 			throw new ConstructionException("null returned by gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime)");
412 		}
413 		return new Message(cast(GstMessage*)p); //, true);
414 	}
415 
416 	/**
417 	 * Creates a new device-added message. The device-added message is produced by
418 	 * #GstDeviceProvider or a #GstDeviceMonitor. They announce the appearance
419 	 * of monitored devices.
420 	 *
421 	 * Params:
422 	 *     src = The #GstObject that created the message
423 	 *     device = The new #GstDevice
424 	 *
425 	 * Return: a newly allocated #GstMessage
426 	 *
427 	 * Since: 1.4
428 	 *
429 	 * Throws: ConstructionException GTK+ fails to create the object.
430 	 */
431 	public static Message newDeviceAdded(ObjectGst src, Device device)
432 	{
433 		auto p = gst_message_new_device_added((src is null) ? null : src.getObjectGstStruct(), (device is null) ? null : device.getDeviceStruct());
434 
435 		if(p is null)
436 		{
437 			throw new ConstructionException("null returned by new_device_added");
438 		}
439 
440 		return new Message(cast(GstMessage*)p); //, true);
441 	}
442 
443 	/**
444 	 * Creates a new device-removed message. The device-removed message is produced
445 	 * by #GstDeviceProvider or a #GstDeviceMonitor. They announce the
446 	 * disappearance of monitored devices.
447 	 *
448 	 * Params:
449 	 *     src = The #GstObject that created the message
450 	 *     device = The removed #GstDevice
451 	 *
452 	 * Return: a newly allocated #GstMessage
453 	 *
454 	 * Since: 1.4
455 	 *
456 	 * Throws: ConstructionException GTK+ fails to create the object.
457 	 */
458 	public  static Message newDeviceRemoved(ObjectGst src, Device device)
459 	{
460 		auto p = gst_message_new_device_removed((src is null) ? null : src.getObjectGstStruct(), (device is null) ? null : device.getDeviceStruct());
461 
462 		if(p is null)
463 		{
464 			throw new ConstructionException("null returned by new_device_removed");
465 		}
466 
467 		return new Message(cast(GstMessage*)p); //, true);
468 	}
469 
470 	/**
471 	 * Create a new error message. The message will copy @error and
472 	 * @debug. This message is posted by element when a fatal event
473 	 * occurred. The pipeline will probably (partially) stop. The application
474 	 * receiving this message should stop the pipeline.
475 	 *
476 	 * Params:
477 	 *     src = The object originating the message.
478 	 *     error = The GError for this message.
479 	 *     dbg = A debugging string.
480 	 *     details = (allow-none): A GstStructure with details
481 	 *
482 	 * Return: the new error message.
483 	 *
484 	 * Since: 1.10
485 	 *
486 	 * Throws: ConstructionException GTK+ fails to create the object.
487 	 */
488 	public static Message newErrorWithDetails(ObjectGst src, ErrorG error, string dbg, Structure details)
489 	{
490 		auto p = gst_message_new_error_with_details((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbg), (details is null) ? null : details.getStructureStruct());
491 
492 		if(p is null)
493 		{
494 			throw new ConstructionException("null returned by new_error_with_details");
495 		}
496 
497 		return new Message(cast(GstMessage*)p, true);
498 	}
499 
500 	/**
501 	 * Create a new info message. The message will make copies of @error and
502 	 * @debug.
503 	 *
504 	 * Params:
505 	 *     src = The object originating the message.
506 	 *     error = The GError for this message.
507 	 *     dbg = A debugging string.
508 	 *     details = (allow-none): A GstStructure with details
509 	 *
510 	 * Return: the new warning message.
511 	 *
512 	 * Since: 1.10
513 	 *
514 	 * Throws: ConstructionException GTK+ fails to create the object.
515 	 */
516 	public static Message newInfoWithDetails(ObjectGst src, ErrorG error, string dbg, Structure details)
517 	{
518 		auto p = gst_message_new_info_with_details((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbg), (details is null) ? null : details.getStructureStruct());
519 
520 		if(p is null)
521 		{
522 			throw new ConstructionException("null returned by new_info_with_details");
523 		}
524 
525 		return new Message(cast(GstMessage*)p, true);
526 	}
527 
528 	/**
529 	 * Create a new warning message. The message will make copies of @error and
530 	 * @debug.
531 	 *
532 	 * Params:
533 	 *     src = The object originating the message.
534 	 *     error = The GError for this message.
535 	 *     dbg = A debugging string.
536 	 *     details = (allow-none): A GstStructure with details
537 	 *
538 	 * Return: the new warning message.
539 	 *
540 	 * Since: 1.10
541 	 *
542 	 * Throws: ConstructionException GTK+ fails to create the object.
543 	 */
544 	public static Message newWarningWithDetails(ObjectGst src, ErrorG error, string dbg, Structure details)
545 	{
546 		auto p = gst_message_new_warning_with_details((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbg), (details is null) ? null : details.getStructureStruct());
547 
548 		if(p is null)
549 		{
550 			throw new ConstructionException("null returned by new_warning_with_details");
551 		}
552 
553 		return new Message(cast(GstMessage*)p, true);
554 	}
555 
556 	/**
557 	 * Creates a new stream-collection message. The message is used to announce new
558 	 * #GstStreamCollection
559 	 *
560 	 * Params:
561 	 *     src = The #GstObject that created the message
562 	 *     collection = The #GstStreamCollection
563 	 *
564 	 * Return: a newly allocated #GstMessage
565 	 *
566 	 * Since: 1.10
567 	 *
568 	 * Throws: ConstructionException GTK+ fails to create the object.
569 	 */
570 	public static Message newStreamCollection(ObjectGst src, StreamCollection collection)
571 	{
572 		auto p = gst_message_new_stream_collection((src is null) ? null : src.getObjectGstStruct(), (collection is null) ? null : collection.getStreamCollectionStruct());
573 
574 		if(p is null)
575 		{
576 			throw new ConstructionException("null returned by new_stream_collection");
577 		}
578 
579 		return new Message(cast(GstMessage*)p, true);
580 	}
581 
582 	/**
583 	 * Creates a new steams-selected message. The message is used to announce
584 	 * that an array of streams has been selected. This is generally in response
585 	 * to a #GST_EVENT_SELECT_STREAMS event, or when an element (such as decodebin3)
586 	 * makes an initial selection of streams.
587 	 *
588 	 * The message also contains the #GstStreamCollection to which the various streams
589 	 * belong to.
590 	 *
591 	 * Users of gst_message_new_streams_selected() can add the selected streams with
592 	 * gst_message_streams_selected_add().
593 	 *
594 	 * Params:
595 	 *     src = The #GstObject that created the message
596 	 *     collection = The #GstStreamCollection
597 	 *
598 	 * Return: a newly allocated #GstMessage
599 	 *
600 	 * Since: 1.10
601 	 *
602 	 * Throws: ConstructionException GTK+ fails to create the object.
603 	 */
604 	public static Message newStreamsSelected(ObjectGst src, StreamCollection collection)
605 	{
606 		auto p = gst_message_new_streams_selected((src is null) ? null : src.getObjectGstStruct(), (collection is null) ? null : collection.getStreamCollectionStruct());
607 
608 		if(p is null)
609 		{
610 			throw new ConstructionException("null returned by new_streams_selected");
611 		}
612 
613 		return new Message(cast(GstMessage*)p, true);
614 	}
615 
616 	/**
617 	 */
618 
619 	/** */
620 	public static GType getType()
621 	{
622 		return gst_message_get_type();
623 	}
624 
625 	/**
626 	 * Create a new application-typed message. GStreamer will never create these
627 	 * messages; they are a gift from us to you. Enjoy.
628 	 *
629 	 * Params:
630 	 *     src = The object originating the message.
631 	 *     structure = the structure for the message. The message
632 	 *         will take ownership of the structure.
633 	 *
634 	 * Returns: The new application message.
635 	 *
636 	 *     MT safe.
637 	 *
638 	 * Throws: ConstructionException GTK+ fails to create the object.
639 	 */
640 	public this(ObjectGst src, Structure structure)
641 	{
642 		auto p = gst_message_new_application((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct(true));
643 
644 		if(p is null)
645 		{
646 			throw new ConstructionException("null returned by new_application");
647 		}
648 
649 		this(cast(GstMessage*) p);
650 	}
651 
652 	/**
653 	 * The message is posted when elements completed an ASYNC state change.
654 	 * @running_time contains the time of the desired running_time when this
655 	 * elements goes to PLAYING. A value of #GST_CLOCK_TIME_NONE for @running_time
656 	 * means that the element has no clock interaction and thus doesn't care about
657 	 * the running_time of the pipeline.
658 	 *
659 	 * Params:
660 	 *     src = The object originating the message.
661 	 *     runningTime = the desired running_time
662 	 *
663 	 * Returns: The new async_done message.
664 	 *
665 	 *     MT safe.
666 	 *
667 	 * Throws: ConstructionException GTK+ fails to create the object.
668 	 */
669 	public this(ObjectGst src, GstClockTime runningTime)
670 	{
671 		auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime);
672 
673 		if(p is null)
674 		{
675 			throw new ConstructionException("null returned by new_async_done");
676 		}
677 
678 		this(cast(GstMessage*) p);
679 	}
680 
681 	/**
682 	 * Create a new buffering message. This message can be posted by an element that
683 	 * needs to buffer data before it can continue processing. @percent should be a
684 	 * value between 0 and 100. A value of 100 means that the buffering completed.
685 	 *
686 	 * When @percent is < 100 the application should PAUSE a PLAYING pipeline. When
687 	 * @percent is 100, the application can set the pipeline (back) to PLAYING.
688 	 * The application must be prepared to receive BUFFERING messages in the
689 	 * PREROLLING state and may only set the pipeline to PLAYING after receiving a
690 	 * message with @percent set to 100, which can happen after the pipeline
691 	 * completed prerolling.
692 	 *
693 	 * MT safe.
694 	 *
695 	 * Params:
696 	 *     src = The object originating the message.
697 	 *     percent = The buffering percent
698 	 *
699 	 * Returns: The new buffering message.
700 	 *
701 	 * Throws: ConstructionException GTK+ fails to create the object.
702 	 */
703 	public this(ObjectGst src, int percent)
704 	{
705 		auto p = gst_message_new_buffering((src is null) ? null : src.getObjectGstStruct(), percent);
706 
707 		if(p is null)
708 		{
709 			throw new ConstructionException("null returned by new_buffering");
710 		}
711 
712 		this(cast(GstMessage*) p);
713 	}
714 
715 	/**
716 	 * Create a clock lost message. This message is posted whenever the
717 	 * clock is not valid anymore.
718 	 *
719 	 * If this message is posted by the pipeline, the pipeline will
720 	 * select a new clock again when it goes to PLAYING. It might therefore
721 	 * be needed to set the pipeline to PAUSED and PLAYING again.
722 	 *
723 	 * Params:
724 	 *     src = The object originating the message.
725 	 *     clock = the clock that was lost
726 	 *
727 	 * Returns: The new clock lost message.
728 	 *
729 	 *     MT safe.
730 	 *
731 	 * Throws: ConstructionException GTK+ fails to create the object.
732 	 */
733 	public this(ObjectGst src, Clock clock)
734 	{
735 		auto p = gst_message_new_clock_lost((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct());
736 
737 		if(p is null)
738 		{
739 			throw new ConstructionException("null returned by new_clock_lost");
740 		}
741 
742 		this(cast(GstMessage*) p);
743 	}
744 
745 	/**
746 	 * Create a clock provide message. This message is posted whenever an
747 	 * element is ready to provide a clock or lost its ability to provide
748 	 * a clock (maybe because it paused or became EOS).
749 	 *
750 	 * This message is mainly used internally to manage the clock
751 	 * selection.
752 	 *
753 	 * Params:
754 	 *     src = The object originating the message.
755 	 *     clock = the clock it provides
756 	 *     ready = %TRUE if the sender can provide a clock
757 	 *
758 	 * Returns: the new provide clock message.
759 	 *
760 	 *     MT safe.
761 	 *
762 	 * Throws: ConstructionException GTK+ fails to create the object.
763 	 */
764 	public this(ObjectGst src, Clock clock, bool ready)
765 	{
766 		auto p = gst_message_new_clock_provide((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct(), ready);
767 
768 		if(p is null)
769 		{
770 			throw new ConstructionException("null returned by new_clock_provide");
771 		}
772 
773 		this(cast(GstMessage*) p);
774 	}
775 
776 	/**
777 	 * Create a new custom-typed message. This can be used for anything not
778 	 * handled by other message-specific functions to pass a message to the
779 	 * app. The structure field can be %NULL.
780 	 *
781 	 * Params:
782 	 *     type = The #GstMessageType to distinguish messages
783 	 *     src = The object originating the message.
784 	 *     structure = the structure for the
785 	 *         message. The message will take ownership of the structure.
786 	 *
787 	 * Returns: The new message.
788 	 *
789 	 *     MT safe.
790 	 *
791 	 * Throws: ConstructionException GTK+ fails to create the object.
792 	 */
793 	public this(GstMessageType type, ObjectGst src, Structure structure)
794 	{
795 		auto p = gst_message_new_custom(type, (src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct(true));
796 
797 		if(p is null)
798 		{
799 			throw new ConstructionException("null returned by new_custom");
800 		}
801 
802 		this(cast(GstMessage*) p);
803 	}
804 
805 	/**
806 	 * Creates a new device-changed message. The device-changed message is produced
807 	 * by #GstDeviceProvider or a #GstDeviceMonitor. They announce that a device
808 	 * properties has changed and @device represent the new modified version of @changed_device.
809 	 *
810 	 * Params:
811 	 *     src = The #GstObject that created the message
812 	 *     device = The newly created device representing @replaced_device
813 	 *         with its new configuration.
814 	 *
815 	 * Returns: a newly allocated #GstMessage
816 	 *
817 	 * Since: 1.16
818 	 *
819 	 * Throws: ConstructionException GTK+ fails to create the object.
820 	 */
821 	public this(ObjectGst src, Device device, Device changedDevice)
822 	{
823 		auto p = gst_message_new_device_changed((src is null) ? null : src.getObjectGstStruct(), (device is null) ? null : device.getDeviceStruct(), (changedDevice is null) ? null : changedDevice.getDeviceStruct());
824 
825 		if(p is null)
826 		{
827 			throw new ConstructionException("null returned by new_device_changed");
828 		}
829 
830 		this(cast(GstMessage*) p);
831 	}
832 
833 	/**
834 	 * This message is posted when an element has a new local #GstContext.
835 	 *
836 	 * Params:
837 	 *     src = The object originating the message.
838 	 *     context = the context
839 	 *
840 	 * Returns: The new have-context message.
841 	 *
842 	 *     MT safe.
843 	 *
844 	 * Since: 1.2
845 	 *
846 	 * Throws: ConstructionException GTK+ fails to create the object.
847 	 */
848 	public this(ObjectGst src, Context context)
849 	{
850 		auto p = gst_message_new_have_context((src is null) ? null : src.getObjectGstStruct(), (context is null) ? null : context.getContextStruct());
851 
852 		if(p is null)
853 		{
854 			throw new ConstructionException("null returned by new_have_context");
855 		}
856 
857 		this(cast(GstMessage*) p);
858 	}
859 
860 	/**
861 	 * This message is posted when an element needs a specific #GstContext.
862 	 *
863 	 * Params:
864 	 *     src = The object originating the message.
865 	 *     contextType = The context type that is needed
866 	 *
867 	 * Returns: The new need-context message.
868 	 *
869 	 *     MT safe.
870 	 *
871 	 * Since: 1.2
872 	 *
873 	 * Throws: ConstructionException GTK+ fails to create the object.
874 	 */
875 	public this(ObjectGst src, string contextType)
876 	{
877 		auto p = gst_message_new_need_context((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(contextType));
878 
879 		if(p is null)
880 		{
881 			throw new ConstructionException("null returned by new_need_context");
882 		}
883 
884 		this(cast(GstMessage*) p);
885 	}
886 
887 	/**
888 	 * Progress messages are posted by elements when they use an asynchronous task
889 	 * to perform actions triggered by a state change.
890 	 *
891 	 * @code contains a well defined string describing the action.
892 	 * @text should contain a user visible string detailing the current action.
893 	 *
894 	 * Params:
895 	 *     src = The object originating the message.
896 	 *     type = a #GstProgressType
897 	 *     code = a progress code
898 	 *     text = free, user visible text describing the progress
899 	 *
900 	 * Returns: The new qos message.
901 	 *
902 	 * Throws: ConstructionException GTK+ fails to create the object.
903 	 */
904 	public this(ObjectGst src, GstProgressType type, string code, string text)
905 	{
906 		auto p = gst_message_new_progress((src is null) ? null : src.getObjectGstStruct(), type, Str.toStringz(code), Str.toStringz(text));
907 
908 		if(p is null)
909 		{
910 			throw new ConstructionException("null returned by new_progress");
911 		}
912 
913 		this(cast(GstMessage*) p);
914 	}
915 
916 	/**
917 	 *
918 	 * Params:
919 	 *     src = The #GstObject whose property changed (may or may not be a #GstElement)
920 	 *     propertyName = name of the property that changed
921 	 *     val = new property value, or %NULL
922 	 * Returns: a newly allocated #GstMessage
923 	 *
924 	 * Since: 1.10
925 	 *
926 	 * Throws: ConstructionException GTK+ fails to create the object.
927 	 */
928 	public this(ObjectGst src, string propertyName, Value val)
929 	{
930 		auto p = gst_message_new_property_notify((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(propertyName), (val is null) ? null : val.getValueStruct());
931 
932 		if(p is null)
933 		{
934 			throw new ConstructionException("null returned by new_property_notify");
935 		}
936 
937 		this(cast(GstMessage*) p);
938 	}
939 
940 	/**
941 	 * A QOS message is posted on the bus whenever an element decides to drop a
942 	 * buffer because of QoS reasons or whenever it changes its processing strategy
943 	 * because of QoS reasons (quality adjustments such as processing at lower
944 	 * accuracy).
945 	 *
946 	 * This message can be posted by an element that performs synchronisation against the
947 	 * clock (live) or it could be dropped by an element that performs QoS because of QOS
948 	 * events received from a downstream element (!live).
949 	 *
950 	 * @running_time, @stream_time, @timestamp, @duration should be set to the
951 	 * respective running-time, stream-time, timestamp and duration of the (dropped)
952 	 * buffer that generated the QoS event. Values can be left to
953 	 * GST_CLOCK_TIME_NONE when unknown.
954 	 *
955 	 * Params:
956 	 *     src = The object originating the message.
957 	 *     live = if the message was generated by a live element
958 	 *     runningTime = the running time of the buffer that generated the message
959 	 *     streamTime = the stream time of the buffer that generated the message
960 	 *     timestamp = the timestamps of the buffer that generated the message
961 	 *     duration = the duration of the buffer that generated the message
962 	 *
963 	 * Returns: The new qos message.
964 	 *
965 	 *     MT safe.
966 	 *
967 	 * Throws: ConstructionException GTK+ fails to create the object.
968 	 */
969 	public this(ObjectGst src, bool live, ulong runningTime, ulong streamTime, ulong timestamp, ulong duration)
970 	{
971 		auto p = gst_message_new_qos((src is null) ? null : src.getObjectGstStruct(), live, runningTime, streamTime, timestamp, duration);
972 
973 		if(p is null)
974 		{
975 			throw new ConstructionException("null returned by new_qos");
976 		}
977 
978 		this(cast(GstMessage*) p);
979 	}
980 
981 	/**
982 	 * Creates a new redirect message and adds a new entry to it. Redirect messages
983 	 * are posted when an element detects that the actual data has to be retrieved
984 	 * from a different location. This is useful if such a redirection cannot be
985 	 * handled inside a source element, for example when HTTP 302/303 redirects
986 	 * return a non-HTTP URL.
987 	 *
988 	 * The redirect message can hold multiple entries. The first one is added
989 	 * when the redirect message is created, with the given location, tag_list,
990 	 * entry_struct arguments. Use gst_message_add_redirect_entry() to add more
991 	 * entries.
992 	 *
993 	 * Each entry has a location, a tag list, and a structure. All of these are
994 	 * optional. The tag list and structure are useful for additional metadata,
995 	 * such as bitrate statistics for the given location.
996 	 *
997 	 * By default, message recipients should treat entries in the order they are
998 	 * stored. The recipient should therefore try entry #0 first, and if this
999 	 * entry is not acceptable or working, try entry #1 etc. Senders must make
1000 	 * sure that they add entries in this order. However, recipients are free to
1001 	 * ignore the order and pick an entry that is "best" for them. One example
1002 	 * would be a recipient that scans the entries for the one with the highest
1003 	 * bitrate tag.
1004 	 *
1005 	 * The specified location string is copied. However, ownership over the tag
1006 	 * list and structure are transferred to the message.
1007 	 *
1008 	 * Params:
1009 	 *     src = The #GstObject whose property changed (may or may not be a #GstElement)
1010 	 *     location = location string for the new entry
1011 	 *     tagList = tag list for the new entry
1012 	 *     entryStruct = structure for the new entry
1013 	 *
1014 	 * Returns: a newly allocated #GstMessage
1015 	 *
1016 	 * Since: 1.10
1017 	 *
1018 	 * Throws: ConstructionException GTK+ fails to create the object.
1019 	 */
1020 	public this(ObjectGst src, string location, TagList tagList, Structure entryStruct)
1021 	{
1022 		auto p = gst_message_new_redirect((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(location), (tagList is null) ? null : tagList.getTagListStruct(), (entryStruct is null) ? null : entryStruct.getStructureStruct(true));
1023 
1024 		if(p is null)
1025 		{
1026 			throw new ConstructionException("null returned by new_redirect");
1027 		}
1028 
1029 		this(cast(GstMessage*) p);
1030 	}
1031 
1032 	/**
1033 	 * This message can be posted by elements when they want to have their state
1034 	 * changed. A typical use case would be an audio server that wants to pause the
1035 	 * pipeline because a higher priority stream is being played.
1036 	 *
1037 	 * Params:
1038 	 *     src = The object originating the message.
1039 	 *     state = The new requested state
1040 	 *
1041 	 * Returns: the new request state message.
1042 	 *
1043 	 *     MT safe.
1044 	 *
1045 	 * Throws: ConstructionException GTK+ fails to create the object.
1046 	 */
1047 	public this(ObjectGst src, GstState state)
1048 	{
1049 		auto p = gst_message_new_request_state((src is null) ? null : src.getObjectGstStruct(), state);
1050 
1051 		if(p is null)
1052 		{
1053 			throw new ConstructionException("null returned by new_request_state");
1054 		}
1055 
1056 		this(cast(GstMessage*) p);
1057 	}
1058 
1059 	/**
1060 	 * Create a state change message. This message is posted whenever an element
1061 	 * changed its state.
1062 	 *
1063 	 * Params:
1064 	 *     src = The object originating the message.
1065 	 *     oldstate = the previous state
1066 	 *     newstate = the new (current) state
1067 	 *     pending = the pending (target) state
1068 	 *
1069 	 * Returns: the new state change message.
1070 	 *
1071 	 *     MT safe.
1072 	 *
1073 	 * Throws: ConstructionException GTK+ fails to create the object.
1074 	 */
1075 	public this(ObjectGst src, GstState oldstate, GstState newstate, GstState pending)
1076 	{
1077 		auto p = gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending);
1078 
1079 		if(p is null)
1080 		{
1081 			throw new ConstructionException("null returned by new_state_changed");
1082 		}
1083 
1084 		this(cast(GstMessage*) p);
1085 	}
1086 
1087 	/**
1088 	 * This message is posted by elements when they complete a part, when @intermediate set
1089 	 * to %TRUE, or a complete step operation.
1090 	 *
1091 	 * @duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped
1092 	 * @amount of media in format @format.
1093 	 *
1094 	 * Params:
1095 	 *     src = The object originating the message.
1096 	 *     format = the format of @amount
1097 	 *     amount = the amount of stepped data
1098 	 *     rate = the rate of the stepped amount
1099 	 *     flush = is this an flushing step
1100 	 *     intermediate = is this an intermediate step
1101 	 *     duration = the duration of the data
1102 	 *     eos = the step caused EOS
1103 	 *
1104 	 * Returns: the new step_done message.
1105 	 *
1106 	 *     MT safe.
1107 	 *
1108 	 * Throws: ConstructionException GTK+ fails to create the object.
1109 	 */
1110 	public this(ObjectGst src, GstFormat format, ulong amount, double rate, bool flush, bool intermediate, ulong duration, bool eos)
1111 	{
1112 		auto p = gst_message_new_step_done((src is null) ? null : src.getObjectGstStruct(), format, amount, rate, flush, intermediate, duration, eos);
1113 
1114 		if(p is null)
1115 		{
1116 			throw new ConstructionException("null returned by new_step_done");
1117 		}
1118 
1119 		this(cast(GstMessage*) p);
1120 	}
1121 
1122 	/**
1123 	 * This message is posted by elements when they accept or activate a new step
1124 	 * event for @amount in @format.
1125 	 *
1126 	 * @active is set to %FALSE when the element accepted the new step event and has
1127 	 * queued it for execution in the streaming threads.
1128 	 *
1129 	 * @active is set to %TRUE when the element has activated the step operation and
1130 	 * is now ready to start executing the step in the streaming thread. After this
1131 	 * message is emitted, the application can queue a new step operation in the
1132 	 * element.
1133 	 *
1134 	 * Params:
1135 	 *     src = The object originating the message.
1136 	 *     active = if the step is active or queued
1137 	 *     format = the format of @amount
1138 	 *     amount = the amount of stepped data
1139 	 *     rate = the rate of the stepped amount
1140 	 *     flush = is this an flushing step
1141 	 *     intermediate = is this an intermediate step
1142 	 *
1143 	 * Returns: The new step_start message.
1144 	 *
1145 	 *     MT safe.
1146 	 *
1147 	 * Throws: ConstructionException GTK+ fails to create the object.
1148 	 */
1149 	public this(ObjectGst src, bool active, GstFormat format, ulong amount, double rate, bool flush, bool intermediate)
1150 	{
1151 		auto p = gst_message_new_step_start((src is null) ? null : src.getObjectGstStruct(), active, format, amount, rate, flush, intermediate);
1152 
1153 		if(p is null)
1154 		{
1155 			throw new ConstructionException("null returned by new_step_start");
1156 		}
1157 
1158 		this(cast(GstMessage*) p);
1159 	}
1160 
1161 	/**
1162 	 * Create a new stream_start message. This message is generated and posted in
1163 	 * the sink elements of a GstBin. The bin will only forward the STREAM_START
1164 	 * message to the application if all sinks have posted an STREAM_START message.
1165 	 *
1166 	 * Params:
1167 	 *     src = The object originating the message.
1168 	 *
1169 	 * Returns: The new stream_start message.
1170 	 *
1171 	 *     MT safe.
1172 	 *
1173 	 * Throws: ConstructionException GTK+ fails to create the object.
1174 	 */
1175 	public this(ObjectGst src)
1176 	{
1177 		auto p = gst_message_new_stream_start((src is null) ? null : src.getObjectGstStruct());
1178 
1179 		if(p is null)
1180 		{
1181 			throw new ConstructionException("null returned by new_stream_start");
1182 		}
1183 
1184 		this(cast(GstMessage*) p);
1185 	}
1186 
1187 	/**
1188 	 * Create a new stream status message. This message is posted when a streaming
1189 	 * thread is created/destroyed or when the state changed.
1190 	 *
1191 	 * Params:
1192 	 *     src = The object originating the message.
1193 	 *     type = The stream status type.
1194 	 *     owner = the owner element of @src.
1195 	 *
1196 	 * Returns: the new stream status message.
1197 	 *
1198 	 *     MT safe.
1199 	 *
1200 	 * Throws: ConstructionException GTK+ fails to create the object.
1201 	 */
1202 	public this(ObjectGst src, GstStreamStatusType type, Element owner)
1203 	{
1204 		auto p = gst_message_new_stream_status((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct());
1205 
1206 		if(p is null)
1207 		{
1208 			throw new ConstructionException("null returned by new_stream_status");
1209 		}
1210 
1211 		this(cast(GstMessage*) p);
1212 	}
1213 
1214 	/**
1215 	 * Create a new structure change message. This message is posted when the
1216 	 * structure of a pipeline is in the process of being changed, for example
1217 	 * when pads are linked or unlinked.
1218 	 *
1219 	 * @src should be the sinkpad that unlinked or linked.
1220 	 *
1221 	 * Params:
1222 	 *     src = The object originating the message.
1223 	 *     type = The change type.
1224 	 *     owner = The owner element of @src.
1225 	 *     busy = Whether the structure change is busy.
1226 	 *
1227 	 * Returns: the new structure change message.
1228 	 *
1229 	 *     MT safe.
1230 	 *
1231 	 * Throws: ConstructionException GTK+ fails to create the object.
1232 	 */
1233 	public this(ObjectGst src, GstStructureChangeType type, Element owner, bool busy)
1234 	{
1235 		auto p = gst_message_new_structure_change((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct(), busy);
1236 
1237 		if(p is null)
1238 		{
1239 			throw new ConstructionException("null returned by new_structure_change");
1240 		}
1241 
1242 		this(cast(GstMessage*) p);
1243 	}
1244 
1245 	/**
1246 	 * Create a new tag message. The message will take ownership of the tag list.
1247 	 * The message is posted by elements that discovered a new taglist.
1248 	 *
1249 	 * Params:
1250 	 *     src = The object originating the message.
1251 	 *     tagList = the tag list for the message.
1252 	 *
1253 	 * Returns: the new tag message.
1254 	 *
1255 	 *     MT safe.
1256 	 *
1257 	 * Throws: ConstructionException GTK+ fails to create the object.
1258 	 */
1259 	public this(ObjectGst src, TagList tagList)
1260 	{
1261 		auto p = gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct());
1262 
1263 		if(p is null)
1264 		{
1265 			throw new ConstructionException("null returned by new_tag");
1266 		}
1267 
1268 		this(cast(GstMessage*) p);
1269 	}
1270 
1271 	/**
1272 	 * Create a new TOC message. The message is posted by elements
1273 	 * that discovered or updated a TOC.
1274 	 *
1275 	 * Params:
1276 	 *     src = the object originating the message.
1277 	 *     toc = #GstToc structure for the message.
1278 	 *     updated = whether TOC was updated or not.
1279 	 *
1280 	 * Returns: a new TOC message.
1281 	 *
1282 	 *     MT safe.
1283 	 *
1284 	 * Throws: ConstructionException GTK+ fails to create the object.
1285 	 */
1286 	public this(ObjectGst src, Toc toc, bool updated)
1287 	{
1288 		auto p = gst_message_new_toc((src is null) ? null : src.getObjectGstStruct(), (toc is null) ? null : toc.getTocStruct(), updated);
1289 
1290 		if(p is null)
1291 		{
1292 			throw new ConstructionException("null returned by new_toc");
1293 		}
1294 
1295 		this(cast(GstMessage*) p);
1296 	}
1297 
1298 	/**
1299 	 * Creates and appends a new entry.
1300 	 *
1301 	 * The specified location string is copied. However, ownership over the tag
1302 	 * list and structure are transferred to the message.
1303 	 *
1304 	 * Params:
1305 	 *     location = location string for the new entry
1306 	 *     tagList = tag list for the new entry
1307 	 *     entryStruct = structure for the new entry
1308 	 *
1309 	 * Since: 1.10
1310 	 */
1311 	public void addRedirectEntry(string location, TagList tagList, Structure entryStruct)
1312 	{
1313 		gst_message_add_redirect_entry(gstMessage, Str.toStringz(location), (tagList is null) ? null : tagList.getTagListStruct(), (entryStruct is null) ? null : entryStruct.getStructureStruct(true));
1314 	}
1315 
1316 	/**
1317 	 * Returns: the number of entries stored in the message
1318 	 *
1319 	 * Since: 1.10
1320 	 */
1321 	public size_t getNumRedirectEntries()
1322 	{
1323 		return gst_message_get_num_redirect_entries(gstMessage);
1324 	}
1325 
1326 	/**
1327 	 * Retrieve the sequence number of a message.
1328 	 *
1329 	 * Messages have ever-incrementing sequence numbers, which may also be set
1330 	 * explicitly via gst_message_set_seqnum(). Sequence numbers are typically used
1331 	 * to indicate that a message corresponds to some other set of messages or
1332 	 * events, for example a SEGMENT_DONE message corresponding to a SEEK event. It
1333 	 * is considered good practice to make this correspondence when possible, though
1334 	 * it is not required.
1335 	 *
1336 	 * Note that events and messages share the same sequence number incrementor;
1337 	 * two events or messages will never have the same sequence number unless
1338 	 * that correspondence was made explicitly.
1339 	 *
1340 	 * Returns: The message's sequence number.
1341 	 *
1342 	 *     MT safe.
1343 	 */
1344 	public uint getSeqnum()
1345 	{
1346 		return gst_message_get_seqnum(gstMessage);
1347 	}
1348 
1349 	/**
1350 	 * Extracts the object managing the streaming thread from @message.
1351 	 *
1352 	 * Returns: a GValue containing the object that manages the
1353 	 *     streaming thread. This object is usually of type GstTask but other types can
1354 	 *     be added in the future. The object remains valid as long as @message is
1355 	 *     valid.
1356 	 */
1357 	public Value getStreamStatusObject()
1358 	{
1359 		auto p = gst_message_get_stream_status_object(gstMessage);
1360 
1361 		if(p is null)
1362 		{
1363 			return null;
1364 		}
1365 
1366 		return ObjectG.getDObject!(Value)(cast(GValue*) p);
1367 	}
1368 
1369 	/**
1370 	 * Access the structure of the message.
1371 	 *
1372 	 * Returns: The structure of the message. The
1373 	 *     structure is still owned by the message, which means that you should not
1374 	 *     free it and that the pointer becomes invalid when you free the message.
1375 	 *
1376 	 *     MT safe.
1377 	 */
1378 	public Structure getStructure()
1379 	{
1380 		auto p = gst_message_get_structure(gstMessage);
1381 
1382 		if(p is null)
1383 		{
1384 			return null;
1385 		}
1386 
1387 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
1388 	}
1389 
1390 	/**
1391 	 * Checks if @message has the given @name. This function is usually used to
1392 	 * check the name of a custom message.
1393 	 *
1394 	 * Params:
1395 	 *     name = name to check
1396 	 *
1397 	 * Returns: %TRUE if @name matches the name of the message structure.
1398 	 */
1399 	public bool hasName(string name)
1400 	{
1401 		return gst_message_has_name(gstMessage, Str.toStringz(name)) != 0;
1402 	}
1403 
1404 	/**
1405 	 * Extract the running_time from the async_done message.
1406 	 *
1407 	 * MT safe.
1408 	 *
1409 	 * Params:
1410 	 *     runningTime = Result location for the running_time or %NULL
1411 	 */
1412 	public void parseAsyncDone(out GstClockTime runningTime)
1413 	{
1414 		gst_message_parse_async_done(gstMessage, &runningTime);
1415 	}
1416 
1417 	/**
1418 	 * Extracts the buffering percent from the GstMessage. see also
1419 	 * gst_message_new_buffering().
1420 	 *
1421 	 * MT safe.
1422 	 *
1423 	 * Params:
1424 	 *     percent = Return location for the percent.
1425 	 */
1426 	public void parseBuffering(out int percent)
1427 	{
1428 		gst_message_parse_buffering(gstMessage, &percent);
1429 	}
1430 
1431 	/**
1432 	 * Extracts the buffering stats values from @message.
1433 	 *
1434 	 * Params:
1435 	 *     mode = a buffering mode, or %NULL
1436 	 *     avgIn = the average input rate, or %NULL
1437 	 *     avgOut = the average output rate, or %NULL
1438 	 *     bufferingLeft = amount of buffering time left in
1439 	 *         milliseconds, or %NULL
1440 	 */
1441 	public void parseBufferingStats(out GstBufferingMode mode, out int avgIn, out int avgOut, out long bufferingLeft)
1442 	{
1443 		gst_message_parse_buffering_stats(gstMessage, &mode, &avgIn, &avgOut, &bufferingLeft);
1444 	}
1445 
1446 	/**
1447 	 * Extracts the lost clock from the GstMessage.
1448 	 * The clock object returned remains valid until the message is freed.
1449 	 *
1450 	 * MT safe.
1451 	 *
1452 	 * Params:
1453 	 *     clock = a pointer to hold the lost clock
1454 	 */
1455 	public void parseClockLost(out Clock clock)
1456 	{
1457 		GstClock* outclock = null;
1458 
1459 		gst_message_parse_clock_lost(gstMessage, &outclock);
1460 
1461 		clock = ObjectG.getDObject!(Clock)(outclock);
1462 	}
1463 
1464 	/**
1465 	 * Extracts the clock and ready flag from the GstMessage.
1466 	 * The clock object returned remains valid until the message is freed.
1467 	 *
1468 	 * MT safe.
1469 	 *
1470 	 * Params:
1471 	 *     clock = a pointer to  hold a clock
1472 	 *         object, or %NULL
1473 	 *     ready = a pointer to hold the ready flag, or %NULL
1474 	 */
1475 	public void parseClockProvide(out Clock clock, out bool ready)
1476 	{
1477 		GstClock* outclock = null;
1478 		int outready;
1479 
1480 		gst_message_parse_clock_provide(gstMessage, &outclock, &outready);
1481 
1482 		clock = ObjectG.getDObject!(Clock)(outclock);
1483 		ready = (outready == 1);
1484 	}
1485 
1486 	/**
1487 	 * Parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message.
1488 	 *
1489 	 * Params:
1490 	 *     contextType = the context type, or %NULL
1491 	 *
1492 	 * Returns: a #gboolean indicating if the parsing succeeded.
1493 	 *
1494 	 * Since: 1.2
1495 	 */
1496 	public bool parseContextType(out string contextType)
1497 	{
1498 		char* outcontextType = null;
1499 
1500 		auto p = gst_message_parse_context_type(gstMessage, &outcontextType) != 0;
1501 
1502 		contextType = Str.toString(outcontextType);
1503 
1504 		return p;
1505 	}
1506 
1507 	/**
1508 	 * Parses a device-added message. The device-added message is produced by
1509 	 * #GstDeviceProvider or a #GstDeviceMonitor. It announces the appearance
1510 	 * of monitored devices.
1511 	 *
1512 	 * Params:
1513 	 *     device = A location where to store a
1514 	 *         pointer to the new #GstDevice, or %NULL
1515 	 *
1516 	 * Since: 1.4
1517 	 */
1518 	public void parseDeviceAdded(out Device device)
1519 	{
1520 		GstDevice* outdevice = null;
1521 
1522 		gst_message_parse_device_added(gstMessage, &outdevice);
1523 
1524 		device = ObjectG.getDObject!(Device)(outdevice);
1525 	}
1526 
1527 	/**
1528 	 * Parses a device-changed message. The device-changed message is produced by
1529 	 * #GstDeviceProvider or a #GstDeviceMonitor. It announces the
1530 	 * disappearance of monitored devices. * It announce that a device properties has
1531 	 * changed and @device represents the new modified version of @changed_device.
1532 	 *
1533 	 * Params:
1534 	 *     device = A location where to store a
1535 	 *         pointer to the updated version of the #GstDevice, or %NULL
1536 	 *     changedDevice = A location where to store a
1537 	 *         pointer to the old version of the #GstDevice, or %NULL
1538 	 *
1539 	 * Since: 1.16
1540 	 */
1541 	public void parseDeviceChanged(out Device device, out Device changedDevice)
1542 	{
1543 		GstDevice* outdevice = null;
1544 		GstDevice* outchangedDevice = null;
1545 
1546 		gst_message_parse_device_changed(gstMessage, &outdevice, &outchangedDevice);
1547 
1548 		device = ObjectG.getDObject!(Device)(outdevice);
1549 		changedDevice = ObjectG.getDObject!(Device)(outchangedDevice);
1550 	}
1551 
1552 	/**
1553 	 * Parses a device-removed message. The device-removed message is produced by
1554 	 * #GstDeviceProvider or a #GstDeviceMonitor. It announces the
1555 	 * disappearance of monitored devices.
1556 	 *
1557 	 * Params:
1558 	 *     device = A location where to store a
1559 	 *         pointer to the removed #GstDevice, or %NULL
1560 	 *
1561 	 * Since: 1.4
1562 	 */
1563 	public void parseDeviceRemoved(out Device device)
1564 	{
1565 		GstDevice* outdevice = null;
1566 
1567 		gst_message_parse_device_removed(gstMessage, &outdevice);
1568 
1569 		device = ObjectG.getDObject!(Device)(outdevice);
1570 	}
1571 
1572 	/**
1573 	 * Extracts the GError and debug string from the GstMessage. The values returned
1574 	 * in the output arguments are copies; the caller must free them when done.
1575 	 *
1576 	 * Typical usage of this function might be:
1577 	 * |[<!-- language="C" -->
1578 	 * ...
1579 	 * switch (GST_MESSAGE_TYPE (msg)) {
1580 	 * case GST_MESSAGE_ERROR: {
1581 	 * GError *err = NULL;
1582 	 * gchar *dbg_info = NULL;
1583 	 *
1584 	 * gst_message_parse_error (msg, &amp;err, &amp;dbg_info);
1585 	 * g_printerr ("ERROR from element %s: %s\n",
1586 	 * GST_OBJECT_NAME (msg->src), err->message);
1587 	 * g_printerr ("Debugging info: %s\n", (dbg_info) ? dbg_info : "none");
1588 	 * g_error_free (err);
1589 	 * g_free (dbg_info);
1590 	 * break;
1591 	 * }
1592 	 * ...
1593 	 * }
1594 	 * ...
1595 	 * ]|
1596 	 *
1597 	 * MT safe.
1598 	 *
1599 	 * Params:
1600 	 *     gerror = location for the GError
1601 	 *     debug_ = location for the debug message,
1602 	 *         or %NULL
1603 	 */
1604 	public void parseError(out ErrorG gerror, out string debug_)
1605 	{
1606 		GError* outgerror = null;
1607 		char* outdebug_ = null;
1608 
1609 		gst_message_parse_error(gstMessage, &outgerror, &outdebug_);
1610 
1611 		gerror = new ErrorG(outgerror);
1612 		debug_ = Str.toString(outdebug_);
1613 	}
1614 
1615 	/**
1616 	 * Returns the optional details structure, may be NULL if none.
1617 	 * The returned structure must not be freed.
1618 	 *
1619 	 * Params:
1620 	 *     structure = A pointer to the returned details
1621 	 *
1622 	 * Since: 1.10
1623 	 */
1624 	public void parseErrorDetails(out Structure structure)
1625 	{
1626 		GstStructure* outstructure = null;
1627 
1628 		gst_message_parse_error_details(gstMessage, &outstructure);
1629 
1630 		structure = ObjectG.getDObject!(Structure)(outstructure);
1631 	}
1632 
1633 	/**
1634 	 * Extract the group from the STREAM_START message.
1635 	 *
1636 	 * Params:
1637 	 *     groupId = Result location for the group id or
1638 	 *         %NULL
1639 	 *
1640 	 * Returns: %TRUE if the message had a group id set, %FALSE otherwise
1641 	 *
1642 	 *     MT safe.
1643 	 *
1644 	 * Since: 1.2
1645 	 */
1646 	public bool parseGroupId(out uint groupId)
1647 	{
1648 		return gst_message_parse_group_id(gstMessage, &groupId) != 0;
1649 	}
1650 
1651 	/**
1652 	 * Extract the context from the HAVE_CONTEXT message.
1653 	 *
1654 	 * MT safe.
1655 	 *
1656 	 * Params:
1657 	 *     context = Result location for the
1658 	 *         context or %NULL
1659 	 *
1660 	 * Since: 1.2
1661 	 */
1662 	public void parseHaveContext(out Context context)
1663 	{
1664 		GstContext* outcontext = null;
1665 
1666 		gst_message_parse_have_context(gstMessage, &outcontext);
1667 
1668 		context = ObjectG.getDObject!(Context)(outcontext);
1669 	}
1670 
1671 	/**
1672 	 * Extracts the GError and debug string from the GstMessage. The values returned
1673 	 * in the output arguments are copies; the caller must free them when done.
1674 	 *
1675 	 * MT safe.
1676 	 *
1677 	 * Params:
1678 	 *     gerror = location for the GError
1679 	 *     debug_ = location for the debug message,
1680 	 *         or %NULL
1681 	 */
1682 	public void parseInfo(out ErrorG gerror, out string debug_)
1683 	{
1684 		GError* outgerror = null;
1685 		char* outdebug_ = null;
1686 
1687 		gst_message_parse_info(gstMessage, &outgerror, &outdebug_);
1688 
1689 		gerror = new ErrorG(outgerror);
1690 		debug_ = Str.toString(outdebug_);
1691 	}
1692 
1693 	/**
1694 	 * Returns the optional details structure, may be NULL if none
1695 	 * The returned structure must not be freed.
1696 	 *
1697 	 * Params:
1698 	 *     structure = A pointer to the returned details structure
1699 	 *
1700 	 * Since: 1.10
1701 	 */
1702 	public void parseInfoDetails(out Structure structure)
1703 	{
1704 		GstStructure* outstructure = null;
1705 
1706 		gst_message_parse_info_details(gstMessage, &outstructure);
1707 
1708 		structure = ObjectG.getDObject!(Structure)(outstructure);
1709 	}
1710 
1711 	/**
1712 	 * Extracts the new clock from the GstMessage.
1713 	 * The clock object returned remains valid until the message is freed.
1714 	 *
1715 	 * MT safe.
1716 	 *
1717 	 * Params:
1718 	 *     clock = a pointer to hold the selected
1719 	 *         new clock
1720 	 */
1721 	public void parseNewClock(out Clock clock)
1722 	{
1723 		GstClock* outclock = null;
1724 
1725 		gst_message_parse_new_clock(gstMessage, &outclock);
1726 
1727 		clock = ObjectG.getDObject!(Clock)(outclock);
1728 	}
1729 
1730 	/**
1731 	 * Parses the progress @type, @code and @text.
1732 	 *
1733 	 * Params:
1734 	 *     type = location for the type
1735 	 *     code = location for the code
1736 	 *     text = location for the text
1737 	 */
1738 	public void parseProgress(out GstProgressType type, out string code, out string text)
1739 	{
1740 		char* outcode = null;
1741 		char* outtext = null;
1742 
1743 		gst_message_parse_progress(gstMessage, &type, &outcode, &outtext);
1744 
1745 		code = Str.toString(outcode);
1746 		text = Str.toString(outtext);
1747 	}
1748 
1749 	/**
1750 	 * Parses a property-notify message. These will be posted on the bus only
1751 	 * when set up with gst_element_add_property_notify_watch() or
1752 	 * gst_element_add_property_deep_notify_watch().
1753 	 *
1754 	 * Params:
1755 	 *     object = location where to store a
1756 	 *         pointer to the object whose property got changed, or %NULL
1757 	 *     propertyName = return location for
1758 	 *         the name of the property that got changed, or %NULL
1759 	 *     propertyValue = return location for
1760 	 *         the new value of the property that got changed, or %NULL. This will
1761 	 *         only be set if the property notify watch was told to include the value
1762 	 *         when it was set up
1763 	 *
1764 	 * Since: 1.10
1765 	 */
1766 	public void parsePropertyNotify(out ObjectGst object, out string propertyName, out Value propertyValue)
1767 	{
1768 		GstObject* outobject = null;
1769 		char* outpropertyName = null;
1770 		GValue* outpropertyValue = null;
1771 
1772 		gst_message_parse_property_notify(gstMessage, &outobject, &outpropertyName, &outpropertyValue);
1773 
1774 		object = ObjectG.getDObject!(ObjectGst)(outobject);
1775 		propertyName = Str.toString(outpropertyName);
1776 		propertyValue = ObjectG.getDObject!(Value)(outpropertyValue);
1777 	}
1778 
1779 	/**
1780 	 * Extract the timestamps and live status from the QoS message.
1781 	 *
1782 	 * The returned values give the running_time, stream_time, timestamp and
1783 	 * duration of the dropped buffer. Values of GST_CLOCK_TIME_NONE mean unknown
1784 	 * values.
1785 	 *
1786 	 * MT safe.
1787 	 *
1788 	 * Params:
1789 	 *     live = if the message was generated by a live element
1790 	 *     runningTime = the running time of the buffer that
1791 	 *         generated the message
1792 	 *     streamTime = the stream time of the buffer that
1793 	 *         generated the message
1794 	 *     timestamp = the timestamps of the buffer that
1795 	 *         generated the message
1796 	 *     duration = the duration of the buffer that
1797 	 *         generated the message
1798 	 */
1799 	public void parseQos(out bool live, out ulong runningTime, out ulong streamTime, out ulong timestamp, out ulong duration)
1800 	{
1801 		int outlive;
1802 
1803 		gst_message_parse_qos(gstMessage, &outlive, &runningTime, &streamTime, &timestamp, &duration);
1804 
1805 		live = (outlive == 1);
1806 	}
1807 
1808 	/**
1809 	 * Extract the QoS stats representing the history of the current continuous
1810 	 * pipeline playback period.
1811 	 *
1812 	 * When @format is @GST_FORMAT_UNDEFINED both @dropped and @processed are
1813 	 * invalid. Values of -1 for either @processed or @dropped mean unknown values.
1814 	 *
1815 	 * MT safe.
1816 	 *
1817 	 * Params:
1818 	 *     format = Units of the 'processed' and 'dropped' fields.
1819 	 *         Video sinks and video filters will use GST_FORMAT_BUFFERS (frames).
1820 	 *         Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT
1821 	 *         (samples).
1822 	 *     processed = Total number of units correctly processed
1823 	 *         since the last state change to READY or a flushing operation.
1824 	 *     dropped = Total number of units dropped since the last
1825 	 *         state change to READY or a flushing operation.
1826 	 */
1827 	public void parseQosStats(out GstFormat format, out ulong processed, out ulong dropped)
1828 	{
1829 		gst_message_parse_qos_stats(gstMessage, &format, &processed, &dropped);
1830 	}
1831 
1832 	/**
1833 	 * Extract the QoS values that have been calculated/analysed from the QoS data
1834 	 *
1835 	 * MT safe.
1836 	 *
1837 	 * Params:
1838 	 *     jitter = The difference of the running-time against
1839 	 *         the deadline.
1840 	 *     proportion = Long term prediction of the ideal rate
1841 	 *         relative to normal rate to get optimal quality.
1842 	 *     quality = An element dependent integer value that
1843 	 *         specifies the current quality level of the element. The default
1844 	 *         maximum quality is 1000000.
1845 	 */
1846 	public void parseQosValues(out long jitter, out double proportion, out int quality)
1847 	{
1848 		gst_message_parse_qos_values(gstMessage, &jitter, &proportion, &quality);
1849 	}
1850 
1851 	/**
1852 	 * Parses the location and/or structure from the entry with the given index.
1853 	 * The index must be between 0 and gst_message_get_num_redirect_entries() - 1.
1854 	 * Returned pointers are valid for as long as this message exists.
1855 	 *
1856 	 * Params:
1857 	 *     entryIndex = index of the entry to parse
1858 	 *     location = return location for
1859 	 *         the pointer to the entry's location string, or %NULL
1860 	 *     tagList = return location for
1861 	 *         the pointer to the entry's tag list, or %NULL
1862 	 *     entryStruct = return location
1863 	 *         for the pointer to the entry's structure, or %NULL
1864 	 *
1865 	 * Since: 1.10
1866 	 */
1867 	public void parseRedirectEntry(size_t entryIndex, out string location, out TagList tagList, out Structure entryStruct)
1868 	{
1869 		char* outlocation = null;
1870 		GstTagList* outtagList = null;
1871 		GstStructure* outentryStruct = null;
1872 
1873 		gst_message_parse_redirect_entry(gstMessage, entryIndex, &outlocation, &outtagList, &outentryStruct);
1874 
1875 		location = Str.toString(outlocation);
1876 		tagList = ObjectG.getDObject!(TagList)(outtagList);
1877 		entryStruct = ObjectG.getDObject!(Structure)(outentryStruct);
1878 	}
1879 
1880 	/**
1881 	 * Extract the requested state from the request_state message.
1882 	 *
1883 	 * MT safe.
1884 	 *
1885 	 * Params:
1886 	 *     state = Result location for the requested state or %NULL
1887 	 */
1888 	public void parseRequestState(out GstState state)
1889 	{
1890 		gst_message_parse_request_state(gstMessage, &state);
1891 	}
1892 
1893 	/**
1894 	 * Extract the running-time from the RESET_TIME message.
1895 	 *
1896 	 * MT safe.
1897 	 *
1898 	 * Params:
1899 	 *     runningTime = Result location for the running_time or
1900 	 *         %NULL
1901 	 */
1902 	public void parseResetTime(out GstClockTime runningTime)
1903 	{
1904 		gst_message_parse_reset_time(gstMessage, &runningTime);
1905 	}
1906 
1907 	/**
1908 	 * Extracts the position and format from the segment done message.
1909 	 *
1910 	 * MT safe.
1911 	 *
1912 	 * Params:
1913 	 *     format = Result location for the format, or %NULL
1914 	 *     position = Result location for the position, or %NULL
1915 	 */
1916 	public void parseSegmentDone(out GstFormat format, out long position)
1917 	{
1918 		gst_message_parse_segment_done(gstMessage, &format, &position);
1919 	}
1920 
1921 	/**
1922 	 * Extracts the position and format from the segment start message.
1923 	 *
1924 	 * MT safe.
1925 	 *
1926 	 * Params:
1927 	 *     format = Result location for the format, or %NULL
1928 	 *     position = Result location for the position, or %NULL
1929 	 */
1930 	public void parseSegmentStart(out GstFormat format, out long position)
1931 	{
1932 		gst_message_parse_segment_start(gstMessage, &format, &position);
1933 	}
1934 
1935 	/**
1936 	 * Extracts the old and new states from the GstMessage.
1937 	 *
1938 	 * Typical usage of this function might be:
1939 	 * |[<!-- language="C" -->
1940 	 * ...
1941 	 * switch (GST_MESSAGE_TYPE (msg)) {
1942 	 * case GST_MESSAGE_STATE_CHANGED: {
1943 	 * GstState old_state, new_state;
1944 	 *
1945 	 * gst_message_parse_state_changed (msg, &amp;old_state, &amp;new_state, NULL);
1946 	 * g_print ("Element %s changed state from %s to %s.\n",
1947 	 * GST_OBJECT_NAME (msg->src),
1948 	 * gst_element_state_get_name (old_state),
1949 	 * gst_element_state_get_name (new_state));
1950 	 * break;
1951 	 * }
1952 	 * ...
1953 	 * }
1954 	 * ...
1955 	 * ]|
1956 	 *
1957 	 * MT safe.
1958 	 *
1959 	 * Params:
1960 	 *     oldstate = the previous state, or %NULL
1961 	 *     newstate = the new (current) state, or %NULL
1962 	 *     pending = the pending (target) state, or %NULL
1963 	 */
1964 	public void parseStateChanged(out GstState oldstate, out GstState newstate, out GstState pending)
1965 	{
1966 		gst_message_parse_state_changed(gstMessage, &oldstate, &newstate, &pending);
1967 	}
1968 
1969 	/**
1970 	 * Extract the values the step_done message.
1971 	 *
1972 	 * MT safe.
1973 	 *
1974 	 * Params:
1975 	 *     format = result location for the format
1976 	 *     amount = result location for the amount
1977 	 *     rate = result location for the rate
1978 	 *     flush = result location for the flush flag
1979 	 *     intermediate = result location for the intermediate flag
1980 	 *     duration = result location for the duration
1981 	 *     eos = result location for the EOS flag
1982 	 */
1983 	public void parseStepDone(out GstFormat format, out ulong amount, out double rate, out bool flush, out bool intermediate, out ulong duration, out bool eos)
1984 	{
1985 		int outflush;
1986 		int outintermediate;
1987 		int outeos;
1988 
1989 		gst_message_parse_step_done(gstMessage, &format, &amount, &rate, &outflush, &outintermediate, &duration, &outeos);
1990 
1991 		flush = (outflush == 1);
1992 		intermediate = (outintermediate == 1);
1993 		eos = (outeos == 1);
1994 	}
1995 
1996 	/**
1997 	 * Extract the values from step_start message.
1998 	 *
1999 	 * MT safe.
2000 	 *
2001 	 * Params:
2002 	 *     active = result location for the active flag
2003 	 *     format = result location for the format
2004 	 *     amount = result location for the amount
2005 	 *     rate = result location for the rate
2006 	 *     flush = result location for the flush flag
2007 	 *     intermediate = result location for the intermediate flag
2008 	 */
2009 	public void parseStepStart(out bool active, out GstFormat format, out ulong amount, out double rate, out bool flush, out bool intermediate)
2010 	{
2011 		int outactive;
2012 		int outflush;
2013 		int outintermediate;
2014 
2015 		gst_message_parse_step_start(gstMessage, &outactive, &format, &amount, &rate, &outflush, &outintermediate);
2016 
2017 		active = (outactive == 1);
2018 		flush = (outflush == 1);
2019 		intermediate = (outintermediate == 1);
2020 	}
2021 
2022 	/**
2023 	 * Parses a stream-collection message.
2024 	 *
2025 	 * Params:
2026 	 *     collection = A location where to store a
2027 	 *         pointer to the #GstStreamCollection, or %NULL
2028 	 *
2029 	 * Since: 1.10
2030 	 */
2031 	public void parseStreamCollection(out StreamCollection collection)
2032 	{
2033 		GstStreamCollection* outcollection = null;
2034 
2035 		gst_message_parse_stream_collection(gstMessage, &outcollection);
2036 
2037 		collection = ObjectG.getDObject!(StreamCollection)(outcollection);
2038 	}
2039 
2040 	/**
2041 	 * Extracts the stream status type and owner the GstMessage. The returned
2042 	 * owner remains valid for as long as the reference to @message is valid and
2043 	 * should thus not be unreffed.
2044 	 *
2045 	 * MT safe.
2046 	 *
2047 	 * Params:
2048 	 *     type = A pointer to hold the status type
2049 	 *     owner = The owner element of the message source
2050 	 */
2051 	public void parseStreamStatus(out GstStreamStatusType type, out Element owner)
2052 	{
2053 		GstElement* outowner = null;
2054 
2055 		gst_message_parse_stream_status(gstMessage, &type, &outowner);
2056 
2057 		owner = ObjectG.getDObject!(Element)(outowner);
2058 	}
2059 
2060 	/**
2061 	 * Parses a streams-selected message.
2062 	 *
2063 	 * Params:
2064 	 *     collection = A location where to store a
2065 	 *         pointer to the #GstStreamCollection, or %NULL
2066 	 *
2067 	 * Since: 1.10
2068 	 */
2069 	public void parseStreamsSelected(out StreamCollection collection)
2070 	{
2071 		GstStreamCollection* outcollection = null;
2072 
2073 		gst_message_parse_streams_selected(gstMessage, &outcollection);
2074 
2075 		collection = ObjectG.getDObject!(StreamCollection)(outcollection);
2076 	}
2077 
2078 	/**
2079 	 * Extracts the change type and completion status from the GstMessage.
2080 	 *
2081 	 * MT safe.
2082 	 *
2083 	 * Params:
2084 	 *     type = A pointer to hold the change type
2085 	 *     owner = The owner element of the
2086 	 *         message source
2087 	 *     busy = a pointer to hold whether the change is in
2088 	 *         progress or has been completed
2089 	 */
2090 	public void parseStructureChange(out GstStructureChangeType type, out Element owner, out bool busy)
2091 	{
2092 		GstElement* outowner = null;
2093 		int outbusy;
2094 
2095 		gst_message_parse_structure_change(gstMessage, &type, &outowner, &outbusy);
2096 
2097 		owner = ObjectG.getDObject!(Element)(outowner);
2098 		busy = (outbusy == 1);
2099 	}
2100 
2101 	/**
2102 	 * Extracts the tag list from the GstMessage. The tag list returned in the
2103 	 * output argument is a copy; the caller must free it when done.
2104 	 *
2105 	 * Typical usage of this function might be:
2106 	 * |[<!-- language="C" -->
2107 	 * ...
2108 	 * switch (GST_MESSAGE_TYPE (msg)) {
2109 	 * case GST_MESSAGE_TAG: {
2110 	 * GstTagList *tags = NULL;
2111 	 *
2112 	 * gst_message_parse_tag (msg, &amp;tags);
2113 	 * g_print ("Got tags from element %s\n", GST_OBJECT_NAME (msg->src));
2114 	 * handle_tags (tags);
2115 	 * gst_tag_list_unref (tags);
2116 	 * break;
2117 	 * }
2118 	 * ...
2119 	 * }
2120 	 * ...
2121 	 * ]|
2122 	 *
2123 	 * MT safe.
2124 	 *
2125 	 * Params:
2126 	 *     tagList = return location for the tag-list.
2127 	 */
2128 	public void parseTag(out TagList tagList)
2129 	{
2130 		GstTagList* outtagList = null;
2131 
2132 		gst_message_parse_tag(gstMessage, &outtagList);
2133 
2134 		tagList = ObjectG.getDObject!(TagList)(outtagList);
2135 	}
2136 
2137 	/**
2138 	 * Extract the TOC from the #GstMessage. The TOC returned in the
2139 	 * output argument is a copy; the caller must free it with
2140 	 * gst_toc_unref() when done.
2141 	 *
2142 	 * MT safe.
2143 	 *
2144 	 * Params:
2145 	 *     toc = return location for the TOC.
2146 	 *     updated = return location for the updated flag.
2147 	 */
2148 	public void parseToc(out Toc toc, out bool updated)
2149 	{
2150 		GstToc* outtoc = null;
2151 		int outupdated;
2152 
2153 		gst_message_parse_toc(gstMessage, &outtoc, &outupdated);
2154 
2155 		toc = ObjectG.getDObject!(Toc)(outtoc);
2156 		updated = (outupdated == 1);
2157 	}
2158 
2159 	/**
2160 	 * Extracts the GError and debug string from the GstMessage. The values returned
2161 	 * in the output arguments are copies; the caller must free them when done.
2162 	 *
2163 	 * MT safe.
2164 	 *
2165 	 * Params:
2166 	 *     gerror = location for the GError
2167 	 *     debug_ = location for the debug message,
2168 	 *         or %NULL
2169 	 */
2170 	public void parseWarning(out ErrorG gerror, out string debug_)
2171 	{
2172 		GError* outgerror = null;
2173 		char* outdebug_ = null;
2174 
2175 		gst_message_parse_warning(gstMessage, &outgerror, &outdebug_);
2176 
2177 		gerror = new ErrorG(outgerror);
2178 		debug_ = Str.toString(outdebug_);
2179 	}
2180 
2181 	/**
2182 	 * Returns the optional details structure, may be NULL if none
2183 	 * The returned structure must not be freed.
2184 	 *
2185 	 * Params:
2186 	 *     structure = A pointer to the returned details structure
2187 	 *
2188 	 * Since: 1.10
2189 	 */
2190 	public void parseWarningDetails(out Structure structure)
2191 	{
2192 		GstStructure* outstructure = null;
2193 
2194 		gst_message_parse_warning_details(gstMessage, &outstructure);
2195 
2196 		structure = ObjectG.getDObject!(Structure)(outstructure);
2197 	}
2198 
2199 	/**
2200 	 * Configures the buffering stats values in @message.
2201 	 *
2202 	 * Params:
2203 	 *     mode = a buffering mode
2204 	 *     avgIn = the average input rate
2205 	 *     avgOut = the average output rate
2206 	 *     bufferingLeft = amount of buffering time left in milliseconds
2207 	 */
2208 	public void setBufferingStats(GstBufferingMode mode, int avgIn, int avgOut, long bufferingLeft)
2209 	{
2210 		gst_message_set_buffering_stats(gstMessage, mode, avgIn, avgOut, bufferingLeft);
2211 	}
2212 
2213 	/**
2214 	 * Sets the group id on the stream-start message.
2215 	 *
2216 	 * All streams that have the same group id are supposed to be played
2217 	 * together, i.e. all streams inside a container file should have the
2218 	 * same group id but different stream ids. The group id should change
2219 	 * each time the stream is started, resulting in different group ids
2220 	 * each time a file is played for example.
2221 	 *
2222 	 * MT safe.
2223 	 *
2224 	 * Params:
2225 	 *     groupId = the group id
2226 	 *
2227 	 * Since: 1.2
2228 	 */
2229 	public void setGroupId(uint groupId)
2230 	{
2231 		gst_message_set_group_id(gstMessage, groupId);
2232 	}
2233 
2234 	/**
2235 	 * Set the QoS stats representing the history of the current continuous pipeline
2236 	 * playback period.
2237 	 *
2238 	 * When @format is @GST_FORMAT_UNDEFINED both @dropped and @processed are
2239 	 * invalid. Values of -1 for either @processed or @dropped mean unknown values.
2240 	 *
2241 	 * MT safe.
2242 	 *
2243 	 * Params:
2244 	 *     format = Units of the 'processed' and 'dropped' fields. Video sinks and video
2245 	 *         filters will use GST_FORMAT_BUFFERS (frames). Audio sinks and audio filters
2246 	 *         will likely use GST_FORMAT_DEFAULT (samples).
2247 	 *     processed = Total number of units correctly processed since the last state
2248 	 *         change to READY or a flushing operation.
2249 	 *     dropped = Total number of units dropped since the last state change to READY
2250 	 *         or a flushing operation.
2251 	 */
2252 	public void setQosStats(GstFormat format, ulong processed, ulong dropped)
2253 	{
2254 		gst_message_set_qos_stats(gstMessage, format, processed, dropped);
2255 	}
2256 
2257 	/**
2258 	 * Set the QoS values that have been calculated/analysed from the QoS data
2259 	 *
2260 	 * MT safe.
2261 	 *
2262 	 * Params:
2263 	 *     jitter = The difference of the running-time against the deadline.
2264 	 *     proportion = Long term prediction of the ideal rate relative to normal rate
2265 	 *         to get optimal quality.
2266 	 *     quality = An element dependent integer value that specifies the current
2267 	 *         quality level of the element. The default maximum quality is 1000000.
2268 	 */
2269 	public void setQosValues(long jitter, double proportion, int quality)
2270 	{
2271 		gst_message_set_qos_values(gstMessage, jitter, proportion, quality);
2272 	}
2273 
2274 	/**
2275 	 * Set the sequence number of a message.
2276 	 *
2277 	 * This function might be called by the creator of a message to indicate that
2278 	 * the message relates to other messages or events. See gst_message_get_seqnum()
2279 	 * for more information.
2280 	 *
2281 	 * MT safe.
2282 	 *
2283 	 * Params:
2284 	 *     seqnum = A sequence number.
2285 	 */
2286 	public void setSeqnum(uint seqnum)
2287 	{
2288 		gst_message_set_seqnum(gstMessage, seqnum);
2289 	}
2290 
2291 	/**
2292 	 * Configures the object handling the streaming thread. This is usually a
2293 	 * GstTask object but other objects might be added in the future.
2294 	 *
2295 	 * Params:
2296 	 *     object = the object controlling the streaming
2297 	 */
2298 	public void setStreamStatusObject(Value object)
2299 	{
2300 		gst_message_set_stream_status_object(gstMessage, (object is null) ? null : object.getValueStruct());
2301 	}
2302 
2303 	/**
2304 	 * Adds the @stream to the @message.
2305 	 *
2306 	 * Params:
2307 	 *     stream = a #GstStream to add to @message
2308 	 *
2309 	 * Since: 1.10
2310 	 */
2311 	public void streamsSelectedAdd(Stream stream)
2312 	{
2313 		gst_message_streams_selected_add(gstMessage, (stream is null) ? null : stream.getStreamStruct());
2314 	}
2315 
2316 	/**
2317 	 * Returns the number of streams contained in the @message.
2318 	 *
2319 	 * Returns: The number of streams contained within.
2320 	 *
2321 	 * Since: 1.10
2322 	 */
2323 	public uint streamsSelectedGetSize()
2324 	{
2325 		return gst_message_streams_selected_get_size(gstMessage);
2326 	}
2327 
2328 	/**
2329 	 * Retrieves the #GstStream with index @index from the @message.
2330 	 *
2331 	 * Params:
2332 	 *     idx = Index of the stream to retrieve
2333 	 *
2334 	 * Returns: A #GstStream
2335 	 *
2336 	 * Since: 1.10
2337 	 */
2338 	public Stream streamsSelectedGetStream(uint idx)
2339 	{
2340 		auto p = gst_message_streams_selected_get_stream(gstMessage, idx);
2341 
2342 		if(p is null)
2343 		{
2344 			return null;
2345 		}
2346 
2347 		return ObjectG.getDObject!(Stream)(cast(GstStream*) p, true);
2348 	}
2349 
2350 	/**
2351 	 * Get a writable version of the structure.
2352 	 *
2353 	 * Returns: The structure of the message. The structure
2354 	 *     is still owned by the message, which means that you should not free
2355 	 *     it and that the pointer becomes invalid when you free the message.
2356 	 *     This function checks if @message is writable and will never return
2357 	 *     %NULL.
2358 	 *
2359 	 *     MT safe.
2360 	 *
2361 	 * Since: 1.14
2362 	 */
2363 	public Structure writableStructure()
2364 	{
2365 		auto p = gst_message_writable_structure(gstMessage);
2366 
2367 		if(p is null)
2368 		{
2369 			return null;
2370 		}
2371 
2372 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
2373 	}
2374 
2375 	/**
2376 	 * Get a printable name for the given message type. Do not modify or free.
2377 	 *
2378 	 * Params:
2379 	 *     type = the message type
2380 	 *
2381 	 * Returns: a reference to the static name of the message.
2382 	 */
2383 	public static string typeGetName(GstMessageType type)
2384 	{
2385 		return Str.toString(gst_message_type_get_name(type));
2386 	}
2387 
2388 	/**
2389 	 * Get the unique quark for the given message type.
2390 	 *
2391 	 * Params:
2392 	 *     type = the message type
2393 	 *
2394 	 * Returns: the quark associated with the message type
2395 	 */
2396 	public static GQuark typeToQuark(GstMessageType type)
2397 	{
2398 		return gst_message_type_to_quark(type);
2399 	}
2400 }