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 	 * This message is posted when an element has a new local #GstContext.
807 	 *
808 	 * Params:
809 	 *     src = The object originating the message.
810 	 *     context = the context
811 	 *
812 	 * Returns: The new have-context message.
813 	 *
814 	 *     MT safe.
815 	 *
816 	 * Since: 1.2
817 	 *
818 	 * Throws: ConstructionException GTK+ fails to create the object.
819 	 */
820 	public this(ObjectGst src, Context context)
821 	{
822 		auto p = gst_message_new_have_context((src is null) ? null : src.getObjectGstStruct(), (context is null) ? null : context.getContextStruct());
823 
824 		if(p is null)
825 		{
826 			throw new ConstructionException("null returned by new_have_context");
827 		}
828 
829 		this(cast(GstMessage*) p);
830 	}
831 
832 	/**
833 	 * This message is posted when an element needs a specific #GstContext.
834 	 *
835 	 * Params:
836 	 *     src = The object originating the message.
837 	 *     contextType = The context type that is needed
838 	 *
839 	 * Returns: The new need-context message.
840 	 *
841 	 *     MT safe.
842 	 *
843 	 * Since: 1.2
844 	 *
845 	 * Throws: ConstructionException GTK+ fails to create the object.
846 	 */
847 	public this(ObjectGst src, string contextType)
848 	{
849 		auto p = gst_message_new_need_context((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(contextType));
850 
851 		if(p is null)
852 		{
853 			throw new ConstructionException("null returned by new_need_context");
854 		}
855 
856 		this(cast(GstMessage*) p);
857 	}
858 
859 	/**
860 	 * Progress messages are posted by elements when they use an asynchronous task
861 	 * to perform actions triggered by a state change.
862 	 *
863 	 * @code contains a well defined string describing the action.
864 	 * @text should contain a user visible string detailing the current action.
865 	 *
866 	 * Params:
867 	 *     src = The object originating the message.
868 	 *     type = a #GstProgressType
869 	 *     code = a progress code
870 	 *     text = free, user visible text describing the progress
871 	 *
872 	 * Returns: The new qos message.
873 	 *
874 	 * Throws: ConstructionException GTK+ fails to create the object.
875 	 */
876 	public this(ObjectGst src, GstProgressType type, string code, string text)
877 	{
878 		auto p = gst_message_new_progress((src is null) ? null : src.getObjectGstStruct(), type, Str.toStringz(code), Str.toStringz(text));
879 
880 		if(p is null)
881 		{
882 			throw new ConstructionException("null returned by new_progress");
883 		}
884 
885 		this(cast(GstMessage*) p);
886 	}
887 
888 	/**
889 	 *
890 	 * Params:
891 	 *     src = The #GstObject whose property changed (may or may not be a #GstElement)
892 	 *     propertyName = name of the property that changed
893 	 *     val = new property value, or %NULL
894 	 * Returns: a newly allocated #GstMessage
895 	 *
896 	 * Since: 1.10
897 	 *
898 	 * Throws: ConstructionException GTK+ fails to create the object.
899 	 */
900 	public this(ObjectGst src, string propertyName, Value val)
901 	{
902 		auto p = gst_message_new_property_notify((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(propertyName), (val is null) ? null : val.getValueStruct());
903 
904 		if(p is null)
905 		{
906 			throw new ConstructionException("null returned by new_property_notify");
907 		}
908 
909 		this(cast(GstMessage*) p);
910 	}
911 
912 	/**
913 	 * A QOS message is posted on the bus whenever an element decides to drop a
914 	 * buffer because of QoS reasons or whenever it changes its processing strategy
915 	 * because of QoS reasons (quality adjustments such as processing at lower
916 	 * accuracy).
917 	 *
918 	 * This message can be posted by an element that performs synchronisation against the
919 	 * clock (live) or it could be dropped by an element that performs QoS because of QOS
920 	 * events received from a downstream element (!live).
921 	 *
922 	 * @running_time, @stream_time, @timestamp, @duration should be set to the
923 	 * respective running-time, stream-time, timestamp and duration of the (dropped)
924 	 * buffer that generated the QoS event. Values can be left to
925 	 * GST_CLOCK_TIME_NONE when unknown.
926 	 *
927 	 * Params:
928 	 *     src = The object originating the message.
929 	 *     live = if the message was generated by a live element
930 	 *     runningTime = the running time of the buffer that generated the message
931 	 *     streamTime = the stream time of the buffer that generated the message
932 	 *     timestamp = the timestamps of the buffer that generated the message
933 	 *     duration = the duration of the buffer that generated the message
934 	 *
935 	 * Returns: The new qos message.
936 	 *
937 	 *     MT safe.
938 	 *
939 	 * Throws: ConstructionException GTK+ fails to create the object.
940 	 */
941 	public this(ObjectGst src, bool live, ulong runningTime, ulong streamTime, ulong timestamp, ulong duration)
942 	{
943 		auto p = gst_message_new_qos((src is null) ? null : src.getObjectGstStruct(), live, runningTime, streamTime, timestamp, duration);
944 
945 		if(p is null)
946 		{
947 			throw new ConstructionException("null returned by new_qos");
948 		}
949 
950 		this(cast(GstMessage*) p);
951 	}
952 
953 	/**
954 	 * Creates a new redirect message and adds a new entry to it. Redirect messages
955 	 * are posted when an element detects that the actual data has to be retrieved
956 	 * from a different location. This is useful if such a redirection cannot be
957 	 * handled inside a source element, for example when HTTP 302/303 redirects
958 	 * return a non-HTTP URL.
959 	 *
960 	 * The redirect message can hold multiple entries. The first one is added
961 	 * when the redirect message is created, with the given location, tag_list,
962 	 * entry_struct arguments. Use gst_message_add_redirect_entry() to add more
963 	 * entries.
964 	 *
965 	 * Each entry has a location, a tag list, and a structure. All of these are
966 	 * optional. The tag list and structure are useful for additional metadata,
967 	 * such as bitrate statistics for the given location.
968 	 *
969 	 * By default, message recipients should treat entries in the order they are
970 	 * stored. The recipient should therefore try entry #0 first, and if this
971 	 * entry is not acceptable or working, try entry #1 etc. Senders must make
972 	 * sure that they add entries in this order. However, recipients are free to
973 	 * ignore the order and pick an entry that is "best" for them. One example
974 	 * would be a recipient that scans the entries for the one with the highest
975 	 * bitrate tag.
976 	 *
977 	 * The specified location string is copied. However, ownership over the tag
978 	 * list and structure are transferred to the message.
979 	 *
980 	 * Params:
981 	 *     src = The #GstObject whose property changed (may or may not be a #GstElement)
982 	 *     location = location string for the new entry
983 	 *     tagList = tag list for the new entry
984 	 *     entryStruct = structure for the new entry
985 	 *
986 	 * Returns: a newly allocated #GstMessage
987 	 *
988 	 * Since: 1.10
989 	 *
990 	 * Throws: ConstructionException GTK+ fails to create the object.
991 	 */
992 	public this(ObjectGst src, string location, TagList tagList, Structure entryStruct)
993 	{
994 		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));
995 
996 		if(p is null)
997 		{
998 			throw new ConstructionException("null returned by new_redirect");
999 		}
1000 
1001 		this(cast(GstMessage*) p);
1002 	}
1003 
1004 	/**
1005 	 * This message can be posted by elements when they want to have their state
1006 	 * changed. A typical use case would be an audio server that wants to pause the
1007 	 * pipeline because a higher priority stream is being played.
1008 	 *
1009 	 * Params:
1010 	 *     src = The object originating the message.
1011 	 *     state = The new requested state
1012 	 *
1013 	 * Returns: the new request state message.
1014 	 *
1015 	 *     MT safe.
1016 	 *
1017 	 * Throws: ConstructionException GTK+ fails to create the object.
1018 	 */
1019 	public this(ObjectGst src, GstState state)
1020 	{
1021 		auto p = gst_message_new_request_state((src is null) ? null : src.getObjectGstStruct(), state);
1022 
1023 		if(p is null)
1024 		{
1025 			throw new ConstructionException("null returned by new_request_state");
1026 		}
1027 
1028 		this(cast(GstMessage*) p);
1029 	}
1030 
1031 	/**
1032 	 * Create a state change message. This message is posted whenever an element
1033 	 * changed its state.
1034 	 *
1035 	 * Params:
1036 	 *     src = The object originating the message.
1037 	 *     oldstate = the previous state
1038 	 *     newstate = the new (current) state
1039 	 *     pending = the pending (target) state
1040 	 *
1041 	 * Returns: the new state change message.
1042 	 *
1043 	 *     MT safe.
1044 	 *
1045 	 * Throws: ConstructionException GTK+ fails to create the object.
1046 	 */
1047 	public this(ObjectGst src, GstState oldstate, GstState newstate, GstState pending)
1048 	{
1049 		auto p = gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending);
1050 
1051 		if(p is null)
1052 		{
1053 			throw new ConstructionException("null returned by new_state_changed");
1054 		}
1055 
1056 		this(cast(GstMessage*) p);
1057 	}
1058 
1059 	/**
1060 	 * This message is posted by elements when they complete a part, when @intermediate set
1061 	 * to %TRUE, or a complete step operation.
1062 	 *
1063 	 * @duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped
1064 	 * @amount of media in format @format.
1065 	 *
1066 	 * Params:
1067 	 *     src = The object originating the message.
1068 	 *     format = the format of @amount
1069 	 *     amount = the amount of stepped data
1070 	 *     rate = the rate of the stepped amount
1071 	 *     flush = is this an flushing step
1072 	 *     intermediate = is this an intermediate step
1073 	 *     duration = the duration of the data
1074 	 *     eos = the step caused EOS
1075 	 *
1076 	 * Returns: the new step_done message.
1077 	 *
1078 	 *     MT safe.
1079 	 *
1080 	 * Throws: ConstructionException GTK+ fails to create the object.
1081 	 */
1082 	public this(ObjectGst src, GstFormat format, ulong amount, double rate, bool flush, bool intermediate, ulong duration, bool eos)
1083 	{
1084 		auto p = gst_message_new_step_done((src is null) ? null : src.getObjectGstStruct(), format, amount, rate, flush, intermediate, duration, eos);
1085 
1086 		if(p is null)
1087 		{
1088 			throw new ConstructionException("null returned by new_step_done");
1089 		}
1090 
1091 		this(cast(GstMessage*) p);
1092 	}
1093 
1094 	/**
1095 	 * This message is posted by elements when they accept or activate a new step
1096 	 * event for @amount in @format.
1097 	 *
1098 	 * @active is set to %FALSE when the element accepted the new step event and has
1099 	 * queued it for execution in the streaming threads.
1100 	 *
1101 	 * @active is set to %TRUE when the element has activated the step operation and
1102 	 * is now ready to start executing the step in the streaming thread. After this
1103 	 * message is emitted, the application can queue a new step operation in the
1104 	 * element.
1105 	 *
1106 	 * Params:
1107 	 *     src = The object originating the message.
1108 	 *     active = if the step is active or queued
1109 	 *     format = the format of @amount
1110 	 *     amount = the amount of stepped data
1111 	 *     rate = the rate of the stepped amount
1112 	 *     flush = is this an flushing step
1113 	 *     intermediate = is this an intermediate step
1114 	 *
1115 	 * Returns: The new step_start message.
1116 	 *
1117 	 *     MT safe.
1118 	 *
1119 	 * Throws: ConstructionException GTK+ fails to create the object.
1120 	 */
1121 	public this(ObjectGst src, bool active, GstFormat format, ulong amount, double rate, bool flush, bool intermediate)
1122 	{
1123 		auto p = gst_message_new_step_start((src is null) ? null : src.getObjectGstStruct(), active, format, amount, rate, flush, intermediate);
1124 
1125 		if(p is null)
1126 		{
1127 			throw new ConstructionException("null returned by new_step_start");
1128 		}
1129 
1130 		this(cast(GstMessage*) p);
1131 	}
1132 
1133 	/**
1134 	 * Create a new stream_start message. This message is generated and posted in
1135 	 * the sink elements of a GstBin. The bin will only forward the STREAM_START
1136 	 * message to the application if all sinks have posted an STREAM_START message.
1137 	 *
1138 	 * Params:
1139 	 *     src = The object originating the message.
1140 	 *
1141 	 * Returns: The new stream_start message.
1142 	 *
1143 	 *     MT safe.
1144 	 *
1145 	 * Throws: ConstructionException GTK+ fails to create the object.
1146 	 */
1147 	public this(ObjectGst src)
1148 	{
1149 		auto p = gst_message_new_stream_start((src is null) ? null : src.getObjectGstStruct());
1150 
1151 		if(p is null)
1152 		{
1153 			throw new ConstructionException("null returned by new_stream_start");
1154 		}
1155 
1156 		this(cast(GstMessage*) p);
1157 	}
1158 
1159 	/**
1160 	 * Create a new stream status message. This message is posted when a streaming
1161 	 * thread is created/destroyed or when the state changed.
1162 	 *
1163 	 * Params:
1164 	 *     src = The object originating the message.
1165 	 *     type = The stream status type.
1166 	 *     owner = the owner element of @src.
1167 	 *
1168 	 * Returns: the new stream status message.
1169 	 *
1170 	 *     MT safe.
1171 	 *
1172 	 * Throws: ConstructionException GTK+ fails to create the object.
1173 	 */
1174 	public this(ObjectGst src, GstStreamStatusType type, Element owner)
1175 	{
1176 		auto p = gst_message_new_stream_status((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct());
1177 
1178 		if(p is null)
1179 		{
1180 			throw new ConstructionException("null returned by new_stream_status");
1181 		}
1182 
1183 		this(cast(GstMessage*) p);
1184 	}
1185 
1186 	/**
1187 	 * Create a new structure change message. This message is posted when the
1188 	 * structure of a pipeline is in the process of being changed, for example
1189 	 * when pads are linked or unlinked.
1190 	 *
1191 	 * @src should be the sinkpad that unlinked or linked.
1192 	 *
1193 	 * Params:
1194 	 *     src = The object originating the message.
1195 	 *     type = The change type.
1196 	 *     owner = The owner element of @src.
1197 	 *     busy = Whether the structure change is busy.
1198 	 *
1199 	 * Returns: the new structure change message.
1200 	 *
1201 	 *     MT safe.
1202 	 *
1203 	 * Throws: ConstructionException GTK+ fails to create the object.
1204 	 */
1205 	public this(ObjectGst src, GstStructureChangeType type, Element owner, bool busy)
1206 	{
1207 		auto p = gst_message_new_structure_change((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct(), busy);
1208 
1209 		if(p is null)
1210 		{
1211 			throw new ConstructionException("null returned by new_structure_change");
1212 		}
1213 
1214 		this(cast(GstMessage*) p);
1215 	}
1216 
1217 	/**
1218 	 * Create a new tag message. The message will take ownership of the tag list.
1219 	 * The message is posted by elements that discovered a new taglist.
1220 	 *
1221 	 * Params:
1222 	 *     src = The object originating the message.
1223 	 *     tagList = the tag list for the message.
1224 	 *
1225 	 * Returns: the new tag message.
1226 	 *
1227 	 *     MT safe.
1228 	 *
1229 	 * Throws: ConstructionException GTK+ fails to create the object.
1230 	 */
1231 	public this(ObjectGst src, TagList tagList)
1232 	{
1233 		auto p = gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct());
1234 
1235 		if(p is null)
1236 		{
1237 			throw new ConstructionException("null returned by new_tag");
1238 		}
1239 
1240 		this(cast(GstMessage*) p);
1241 	}
1242 
1243 	/**
1244 	 * Create a new TOC message. The message is posted by elements
1245 	 * that discovered or updated a TOC.
1246 	 *
1247 	 * Params:
1248 	 *     src = the object originating the message.
1249 	 *     toc = #GstToc structure for the message.
1250 	 *     updated = whether TOC was updated or not.
1251 	 *
1252 	 * Returns: a new TOC message.
1253 	 *
1254 	 *     MT safe.
1255 	 *
1256 	 * Throws: ConstructionException GTK+ fails to create the object.
1257 	 */
1258 	public this(ObjectGst src, Toc toc, bool updated)
1259 	{
1260 		auto p = gst_message_new_toc((src is null) ? null : src.getObjectGstStruct(), (toc is null) ? null : toc.getTocStruct(), updated);
1261 
1262 		if(p is null)
1263 		{
1264 			throw new ConstructionException("null returned by new_toc");
1265 		}
1266 
1267 		this(cast(GstMessage*) p);
1268 	}
1269 
1270 	/**
1271 	 * Creates and appends a new entry.
1272 	 *
1273 	 * The specified location string is copied. However, ownership over the tag
1274 	 * list and structure are transferred to the message.
1275 	 *
1276 	 * Params:
1277 	 *     location = location string for the new entry
1278 	 *     tagList = tag list for the new entry
1279 	 *     entryStruct = structure for the new entry
1280 	 *
1281 	 * Since: 1.10
1282 	 */
1283 	public void addRedirectEntry(string location, TagList tagList, Structure entryStruct)
1284 	{
1285 		gst_message_add_redirect_entry(gstMessage, Str.toStringz(location), (tagList is null) ? null : tagList.getTagListStruct(), (entryStruct is null) ? null : entryStruct.getStructureStruct(true));
1286 	}
1287 
1288 	/**
1289 	 * Returns: the number of entries stored in the message
1290 	 *
1291 	 * Since: 1.10
1292 	 */
1293 	public size_t getNumRedirectEntries()
1294 	{
1295 		return gst_message_get_num_redirect_entries(gstMessage);
1296 	}
1297 
1298 	/**
1299 	 * Retrieve the sequence number of a message.
1300 	 *
1301 	 * Messages have ever-incrementing sequence numbers, which may also be set
1302 	 * explicitly via gst_message_set_seqnum(). Sequence numbers are typically used
1303 	 * to indicate that a message corresponds to some other set of messages or
1304 	 * events, for example a SEGMENT_DONE message corresponding to a SEEK event. It
1305 	 * is considered good practice to make this correspondence when possible, though
1306 	 * it is not required.
1307 	 *
1308 	 * Note that events and messages share the same sequence number incrementor;
1309 	 * two events or messages will never have the same sequence number unless
1310 	 * that correspondence was made explicitly.
1311 	 *
1312 	 * Returns: The message's sequence number.
1313 	 *
1314 	 *     MT safe.
1315 	 */
1316 	public uint getSeqnum()
1317 	{
1318 		return gst_message_get_seqnum(gstMessage);
1319 	}
1320 
1321 	/**
1322 	 * Extracts the object managing the streaming thread from @message.
1323 	 *
1324 	 * Returns: a GValue containing the object that manages the
1325 	 *     streaming thread. This object is usually of type GstTask but other types can
1326 	 *     be added in the future. The object remains valid as long as @message is
1327 	 *     valid.
1328 	 */
1329 	public Value getStreamStatusObject()
1330 	{
1331 		auto p = gst_message_get_stream_status_object(gstMessage);
1332 
1333 		if(p is null)
1334 		{
1335 			return null;
1336 		}
1337 
1338 		return ObjectG.getDObject!(Value)(cast(GValue*) p);
1339 	}
1340 
1341 	/**
1342 	 * Access the structure of the message.
1343 	 *
1344 	 * Returns: The structure of the message. The
1345 	 *     structure is still owned by the message, which means that you should not
1346 	 *     free it and that the pointer becomes invalid when you free the message.
1347 	 *
1348 	 *     MT safe.
1349 	 */
1350 	public Structure getStructure()
1351 	{
1352 		auto p = gst_message_get_structure(gstMessage);
1353 
1354 		if(p is null)
1355 		{
1356 			return null;
1357 		}
1358 
1359 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
1360 	}
1361 
1362 	/**
1363 	 * Checks if @message has the given @name. This function is usually used to
1364 	 * check the name of a custom message.
1365 	 *
1366 	 * Params:
1367 	 *     name = name to check
1368 	 *
1369 	 * Returns: %TRUE if @name matches the name of the message structure.
1370 	 */
1371 	public bool hasName(string name)
1372 	{
1373 		return gst_message_has_name(gstMessage, Str.toStringz(name)) != 0;
1374 	}
1375 
1376 	/**
1377 	 * Extract the running_time from the async_done message.
1378 	 *
1379 	 * MT safe.
1380 	 *
1381 	 * Params:
1382 	 *     runningTime = Result location for the running_time or %NULL
1383 	 */
1384 	public void parseAsyncDone(out GstClockTime runningTime)
1385 	{
1386 		gst_message_parse_async_done(gstMessage, &runningTime);
1387 	}
1388 
1389 	/**
1390 	 * Extracts the buffering percent from the GstMessage. see also
1391 	 * gst_message_new_buffering().
1392 	 *
1393 	 * MT safe.
1394 	 *
1395 	 * Params:
1396 	 *     percent = Return location for the percent.
1397 	 */
1398 	public void parseBuffering(out int percent)
1399 	{
1400 		gst_message_parse_buffering(gstMessage, &percent);
1401 	}
1402 
1403 	/**
1404 	 * Extracts the buffering stats values from @message.
1405 	 *
1406 	 * Params:
1407 	 *     mode = a buffering mode, or %NULL
1408 	 *     avgIn = the average input rate, or %NULL
1409 	 *     avgOut = the average output rate, or %NULL
1410 	 *     bufferingLeft = amount of buffering time left in
1411 	 *         milliseconds, or %NULL
1412 	 */
1413 	public void parseBufferingStats(out GstBufferingMode mode, out int avgIn, out int avgOut, out long bufferingLeft)
1414 	{
1415 		gst_message_parse_buffering_stats(gstMessage, &mode, &avgIn, &avgOut, &bufferingLeft);
1416 	}
1417 
1418 	/**
1419 	 * Extracts the lost clock from the GstMessage.
1420 	 * The clock object returned remains valid until the message is freed.
1421 	 *
1422 	 * MT safe.
1423 	 *
1424 	 * Params:
1425 	 *     clock = a pointer to hold the lost clock
1426 	 */
1427 	public void parseClockLost(out Clock clock)
1428 	{
1429 		GstClock* outclock = null;
1430 
1431 		gst_message_parse_clock_lost(gstMessage, &outclock);
1432 
1433 		clock = ObjectG.getDObject!(Clock)(outclock);
1434 	}
1435 
1436 	/**
1437 	 * Extracts the clock and ready flag from the GstMessage.
1438 	 * The clock object returned remains valid until the message is freed.
1439 	 *
1440 	 * MT safe.
1441 	 *
1442 	 * Params:
1443 	 *     clock = a pointer to  hold a clock
1444 	 *         object, or %NULL
1445 	 *     ready = a pointer to hold the ready flag, or %NULL
1446 	 */
1447 	public void parseClockProvide(out Clock clock, out bool ready)
1448 	{
1449 		GstClock* outclock = null;
1450 		int outready;
1451 
1452 		gst_message_parse_clock_provide(gstMessage, &outclock, &outready);
1453 
1454 		clock = ObjectG.getDObject!(Clock)(outclock);
1455 		ready = (outready == 1);
1456 	}
1457 
1458 	/**
1459 	 * Parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message.
1460 	 *
1461 	 * Params:
1462 	 *     contextType = the context type, or %NULL
1463 	 *
1464 	 * Returns: a #gboolean indicating if the parsing succeeded.
1465 	 *
1466 	 * Since: 1.2
1467 	 */
1468 	public bool parseContextType(out string contextType)
1469 	{
1470 		char* outcontextType = null;
1471 
1472 		auto p = gst_message_parse_context_type(gstMessage, &outcontextType) != 0;
1473 
1474 		contextType = Str.toString(outcontextType);
1475 
1476 		return p;
1477 	}
1478 
1479 	/**
1480 	 * Parses a device-added message. The device-added message is produced by
1481 	 * #GstDeviceProvider or a #GstDeviceMonitor. It announces the appearance
1482 	 * of monitored devices.
1483 	 *
1484 	 * Params:
1485 	 *     device = A location where to store a
1486 	 *         pointer to the new #GstDevice, or %NULL
1487 	 *
1488 	 * Since: 1.4
1489 	 */
1490 	public void parseDeviceAdded(out Device device)
1491 	{
1492 		GstDevice* outdevice = null;
1493 
1494 		gst_message_parse_device_added(gstMessage, &outdevice);
1495 
1496 		device = ObjectG.getDObject!(Device)(outdevice);
1497 	}
1498 
1499 	/**
1500 	 * Parses a device-removed message. The device-removed message is produced by
1501 	 * #GstDeviceProvider or a #GstDeviceMonitor. It announces the
1502 	 * disappearance of monitored devices.
1503 	 *
1504 	 * Params:
1505 	 *     device = A location where to store a
1506 	 *         pointer to the removed #GstDevice, or %NULL
1507 	 *
1508 	 * Since: 1.4
1509 	 */
1510 	public void parseDeviceRemoved(out Device device)
1511 	{
1512 		GstDevice* outdevice = null;
1513 
1514 		gst_message_parse_device_removed(gstMessage, &outdevice);
1515 
1516 		device = ObjectG.getDObject!(Device)(outdevice);
1517 	}
1518 
1519 	/**
1520 	 * Extracts the GError and debug string from the GstMessage. The values returned
1521 	 * in the output arguments are copies; the caller must free them when done.
1522 	 *
1523 	 * Typical usage of this function might be:
1524 	 * |[<!-- language="C" -->
1525 	 * ...
1526 	 * switch (GST_MESSAGE_TYPE (msg)) {
1527 	 * case GST_MESSAGE_ERROR: {
1528 	 * GError *err = NULL;
1529 	 * gchar *dbg_info = NULL;
1530 	 *
1531 	 * gst_message_parse_error (msg, &amp;err, &amp;dbg_info);
1532 	 * g_printerr ("ERROR from element %s: %s\n",
1533 	 * GST_OBJECT_NAME (msg->src), err->message);
1534 	 * g_printerr ("Debugging info: %s\n", (dbg_info) ? dbg_info : "none");
1535 	 * g_error_free (err);
1536 	 * g_free (dbg_info);
1537 	 * break;
1538 	 * }
1539 	 * ...
1540 	 * }
1541 	 * ...
1542 	 * ]|
1543 	 *
1544 	 * MT safe.
1545 	 *
1546 	 * Params:
1547 	 *     gerror = location for the GError
1548 	 *     dbg = location for the debug message,
1549 	 *         or %NULL
1550 	 */
1551 	public void parseError(out ErrorG gerror, out string dbg)
1552 	{
1553 		GError* outgerror = null;
1554 		char* outdbg = null;
1555 
1556 		gst_message_parse_error(gstMessage, &outgerror, &outdbg);
1557 
1558 		gerror = new ErrorG(outgerror);
1559 		dbg = Str.toString(outdbg);
1560 	}
1561 
1562 	/**
1563 	 * Returns the optional details structure, may be NULL if none.
1564 	 * The returned structure must not be freed.
1565 	 *
1566 	 * Params:
1567 	 *     structure = A pointer to the returned details
1568 	 *
1569 	 * Since: 1.10
1570 	 */
1571 	public void parseErrorDetails(out Structure structure)
1572 	{
1573 		GstStructure* outstructure = null;
1574 
1575 		gst_message_parse_error_details(gstMessage, &outstructure);
1576 
1577 		structure = ObjectG.getDObject!(Structure)(outstructure);
1578 	}
1579 
1580 	/**
1581 	 * Extract the group from the STREAM_START message.
1582 	 *
1583 	 * Params:
1584 	 *     groupId = Result location for the group id or
1585 	 *         %NULL
1586 	 *
1587 	 * Returns: %TRUE if the message had a group id set, %FALSE otherwise
1588 	 *
1589 	 *     MT safe.
1590 	 *
1591 	 * Since: 1.2
1592 	 */
1593 	public bool parseGroupId(out uint groupId)
1594 	{
1595 		return gst_message_parse_group_id(gstMessage, &groupId) != 0;
1596 	}
1597 
1598 	/**
1599 	 * Extract the context from the HAVE_CONTEXT message.
1600 	 *
1601 	 * MT safe.
1602 	 *
1603 	 * Params:
1604 	 *     context = Result location for the
1605 	 *         context or %NULL
1606 	 *
1607 	 * Since: 1.2
1608 	 */
1609 	public void parseHaveContext(out Context context)
1610 	{
1611 		GstContext* outcontext = null;
1612 
1613 		gst_message_parse_have_context(gstMessage, &outcontext);
1614 
1615 		context = ObjectG.getDObject!(Context)(outcontext);
1616 	}
1617 
1618 	/**
1619 	 * Extracts the GError and debug string from the GstMessage. The values returned
1620 	 * in the output arguments are copies; the caller must free them when done.
1621 	 *
1622 	 * MT safe.
1623 	 *
1624 	 * Params:
1625 	 *     gerror = location for the GError
1626 	 *     dbg = location for the debug message,
1627 	 *         or %NULL
1628 	 */
1629 	public void parseInfo(out ErrorG gerror, out string dbg)
1630 	{
1631 		GError* outgerror = null;
1632 		char* outdbg = null;
1633 
1634 		gst_message_parse_info(gstMessage, &outgerror, &outdbg);
1635 
1636 		gerror = new ErrorG(outgerror);
1637 		dbg = Str.toString(outdbg);
1638 	}
1639 
1640 	/**
1641 	 * Returns the optional details structure, may be NULL if none
1642 	 * The returned structure must not be freed.
1643 	 *
1644 	 * Params:
1645 	 *     structure = A pointer to the returned details structure
1646 	 *
1647 	 * Since: 1.10
1648 	 */
1649 	public void parseInfoDetails(out Structure structure)
1650 	{
1651 		GstStructure* outstructure = null;
1652 
1653 		gst_message_parse_info_details(gstMessage, &outstructure);
1654 
1655 		structure = ObjectG.getDObject!(Structure)(outstructure);
1656 	}
1657 
1658 	/**
1659 	 * Extracts the new clock from the GstMessage.
1660 	 * The clock object returned remains valid until the message is freed.
1661 	 *
1662 	 * MT safe.
1663 	 *
1664 	 * Params:
1665 	 *     clock = a pointer to hold the selected
1666 	 *         new clock
1667 	 */
1668 	public void parseNewClock(out Clock clock)
1669 	{
1670 		GstClock* outclock = null;
1671 
1672 		gst_message_parse_new_clock(gstMessage, &outclock);
1673 
1674 		clock = ObjectG.getDObject!(Clock)(outclock);
1675 	}
1676 
1677 	/**
1678 	 * Parses the progress @type, @code and @text.
1679 	 *
1680 	 * Params:
1681 	 *     type = location for the type
1682 	 *     code = location for the code
1683 	 *     text = location for the text
1684 	 */
1685 	public void parseProgress(out GstProgressType type, out string code, out string text)
1686 	{
1687 		char* outcode = null;
1688 		char* outtext = null;
1689 
1690 		gst_message_parse_progress(gstMessage, &type, &outcode, &outtext);
1691 
1692 		code = Str.toString(outcode);
1693 		text = Str.toString(outtext);
1694 	}
1695 
1696 	/**
1697 	 * Parses a property-notify message. These will be posted on the bus only
1698 	 * when set up with gst_element_add_property_notify_watch() or
1699 	 * gst_element_add_property_deep_notify_watch().
1700 	 *
1701 	 * Params:
1702 	 *     object = location where to store a
1703 	 *         pointer to the object whose property got changed, or %NULL
1704 	 *     propertyName = return location for
1705 	 *         the name of the property that got changed, or %NULL
1706 	 *     propertyValue = return location for
1707 	 *         the new value of the property that got changed, or %NULL. This will
1708 	 *         only be set if the property notify watch was told to include the value
1709 	 *         when it was set up
1710 	 *
1711 	 * Since: 1.10
1712 	 */
1713 	public void parsePropertyNotify(out ObjectGst object, out string propertyName, out Value propertyValue)
1714 	{
1715 		GstObject* outobject = null;
1716 		char* outpropertyName = null;
1717 		GValue* outpropertyValue = null;
1718 
1719 		gst_message_parse_property_notify(gstMessage, &outobject, &outpropertyName, &outpropertyValue);
1720 
1721 		object = ObjectG.getDObject!(ObjectGst)(outobject);
1722 		propertyName = Str.toString(outpropertyName);
1723 		propertyValue = ObjectG.getDObject!(Value)(outpropertyValue);
1724 	}
1725 
1726 	/**
1727 	 * Extract the timestamps and live status from the QoS message.
1728 	 *
1729 	 * The returned values give the running_time, stream_time, timestamp and
1730 	 * duration of the dropped buffer. Values of GST_CLOCK_TIME_NONE mean unknown
1731 	 * values.
1732 	 *
1733 	 * MT safe.
1734 	 *
1735 	 * Params:
1736 	 *     live = if the message was generated by a live element
1737 	 *     runningTime = the running time of the buffer that
1738 	 *         generated the message
1739 	 *     streamTime = the stream time of the buffer that
1740 	 *         generated the message
1741 	 *     timestamp = the timestamps of the buffer that
1742 	 *         generated the message
1743 	 *     duration = the duration of the buffer that
1744 	 *         generated the message
1745 	 */
1746 	public void parseQos(out bool live, out ulong runningTime, out ulong streamTime, out ulong timestamp, out ulong duration)
1747 	{
1748 		int outlive;
1749 
1750 		gst_message_parse_qos(gstMessage, &outlive, &runningTime, &streamTime, &timestamp, &duration);
1751 
1752 		live = (outlive == 1);
1753 	}
1754 
1755 	/**
1756 	 * Extract the QoS stats representing the history of the current continuous
1757 	 * pipeline playback period.
1758 	 *
1759 	 * When @format is @GST_FORMAT_UNDEFINED both @dropped and @processed are
1760 	 * invalid. Values of -1 for either @processed or @dropped mean unknown values.
1761 	 *
1762 	 * MT safe.
1763 	 *
1764 	 * Params:
1765 	 *     format = Units of the 'processed' and 'dropped' fields.
1766 	 *         Video sinks and video filters will use GST_FORMAT_BUFFERS (frames).
1767 	 *         Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT
1768 	 *         (samples).
1769 	 *     processed = Total number of units correctly processed
1770 	 *         since the last state change to READY or a flushing operation.
1771 	 *     dropped = Total number of units dropped since the last
1772 	 *         state change to READY or a flushing operation.
1773 	 */
1774 	public void parseQosStats(out GstFormat format, out ulong processed, out ulong dropped)
1775 	{
1776 		gst_message_parse_qos_stats(gstMessage, &format, &processed, &dropped);
1777 	}
1778 
1779 	/**
1780 	 * Extract the QoS values that have been calculated/analysed from the QoS data
1781 	 *
1782 	 * MT safe.
1783 	 *
1784 	 * Params:
1785 	 *     jitter = The difference of the running-time against
1786 	 *         the deadline.
1787 	 *     proportion = Long term prediction of the ideal rate
1788 	 *         relative to normal rate to get optimal quality.
1789 	 *     quality = An element dependent integer value that
1790 	 *         specifies the current quality level of the element. The default
1791 	 *         maximum quality is 1000000.
1792 	 */
1793 	public void parseQosValues(out long jitter, out double proportion, out int quality)
1794 	{
1795 		gst_message_parse_qos_values(gstMessage, &jitter, &proportion, &quality);
1796 	}
1797 
1798 	/**
1799 	 * Parses the location and/or structure from the entry with the given index.
1800 	 * The index must be between 0 and gst_message_get_num_redirect_entries() - 1.
1801 	 * Returned pointers are valid for as long as this message exists.
1802 	 *
1803 	 * Params:
1804 	 *     entryIndex = index of the entry to parse
1805 	 *     location = return location for
1806 	 *         the pointer to the entry's location string, or %NULL
1807 	 *     tagList = return location for
1808 	 *         the pointer to the entry's tag list, or %NULL
1809 	 *     entryStruct = return location
1810 	 *         for the pointer to the entry's structure, or %NULL
1811 	 *
1812 	 * Since: 1.10
1813 	 */
1814 	public void parseRedirectEntry(size_t entryIndex, out string location, out TagList tagList, out Structure entryStruct)
1815 	{
1816 		char* outlocation = null;
1817 		GstTagList* outtagList = null;
1818 		GstStructure* outentryStruct = null;
1819 
1820 		gst_message_parse_redirect_entry(gstMessage, entryIndex, &outlocation, &outtagList, &outentryStruct);
1821 
1822 		location = Str.toString(outlocation);
1823 		tagList = ObjectG.getDObject!(TagList)(outtagList);
1824 		entryStruct = ObjectG.getDObject!(Structure)(outentryStruct);
1825 	}
1826 
1827 	/**
1828 	 * Extract the requested state from the request_state message.
1829 	 *
1830 	 * MT safe.
1831 	 *
1832 	 * Params:
1833 	 *     state = Result location for the requested state or %NULL
1834 	 */
1835 	public void parseRequestState(out GstState state)
1836 	{
1837 		gst_message_parse_request_state(gstMessage, &state);
1838 	}
1839 
1840 	/**
1841 	 * Extract the running-time from the RESET_TIME message.
1842 	 *
1843 	 * MT safe.
1844 	 *
1845 	 * Params:
1846 	 *     runningTime = Result location for the running_time or
1847 	 *         %NULL
1848 	 */
1849 	public void parseResetTime(out GstClockTime runningTime)
1850 	{
1851 		gst_message_parse_reset_time(gstMessage, &runningTime);
1852 	}
1853 
1854 	/**
1855 	 * Extracts the position and format from the segment done message.
1856 	 *
1857 	 * MT safe.
1858 	 *
1859 	 * Params:
1860 	 *     format = Result location for the format, or %NULL
1861 	 *     position = Result location for the position, or %NULL
1862 	 */
1863 	public void parseSegmentDone(out GstFormat format, out long position)
1864 	{
1865 		gst_message_parse_segment_done(gstMessage, &format, &position);
1866 	}
1867 
1868 	/**
1869 	 * Extracts the position and format from the segment start message.
1870 	 *
1871 	 * MT safe.
1872 	 *
1873 	 * Params:
1874 	 *     format = Result location for the format, or %NULL
1875 	 *     position = Result location for the position, or %NULL
1876 	 */
1877 	public void parseSegmentStart(out GstFormat format, out long position)
1878 	{
1879 		gst_message_parse_segment_start(gstMessage, &format, &position);
1880 	}
1881 
1882 	/**
1883 	 * Extracts the old and new states from the GstMessage.
1884 	 *
1885 	 * Typical usage of this function might be:
1886 	 * |[<!-- language="C" -->
1887 	 * ...
1888 	 * switch (GST_MESSAGE_TYPE (msg)) {
1889 	 * case GST_MESSAGE_STATE_CHANGED: {
1890 	 * GstState old_state, new_state;
1891 	 *
1892 	 * gst_message_parse_state_changed (msg, &amp;old_state, &amp;new_state, NULL);
1893 	 * g_print ("Element %s changed state from %s to %s.\n",
1894 	 * GST_OBJECT_NAME (msg->src),
1895 	 * gst_element_state_get_name (old_state),
1896 	 * gst_element_state_get_name (new_state));
1897 	 * break;
1898 	 * }
1899 	 * ...
1900 	 * }
1901 	 * ...
1902 	 * ]|
1903 	 *
1904 	 * MT safe.
1905 	 *
1906 	 * Params:
1907 	 *     oldstate = the previous state, or %NULL
1908 	 *     newstate = the new (current) state, or %NULL
1909 	 *     pending = the pending (target) state, or %NULL
1910 	 */
1911 	public void parseStateChanged(out GstState oldstate, out GstState newstate, out GstState pending)
1912 	{
1913 		gst_message_parse_state_changed(gstMessage, &oldstate, &newstate, &pending);
1914 	}
1915 
1916 	/**
1917 	 * Extract the values the step_done message.
1918 	 *
1919 	 * MT safe.
1920 	 *
1921 	 * Params:
1922 	 *     format = result location for the format
1923 	 *     amount = result location for the amount
1924 	 *     rate = result location for the rate
1925 	 *     flush = result location for the flush flag
1926 	 *     intermediate = result location for the intermediate flag
1927 	 *     duration = result location for the duration
1928 	 *     eos = result location for the EOS flag
1929 	 */
1930 	public void parseStepDone(out GstFormat format, out ulong amount, out double rate, out bool flush, out bool intermediate, out ulong duration, out bool eos)
1931 	{
1932 		int outflush;
1933 		int outintermediate;
1934 		int outeos;
1935 
1936 		gst_message_parse_step_done(gstMessage, &format, &amount, &rate, &outflush, &outintermediate, &duration, &outeos);
1937 
1938 		flush = (outflush == 1);
1939 		intermediate = (outintermediate == 1);
1940 		eos = (outeos == 1);
1941 	}
1942 
1943 	/**
1944 	 * Extract the values from step_start message.
1945 	 *
1946 	 * MT safe.
1947 	 *
1948 	 * Params:
1949 	 *     active = result location for the active flag
1950 	 *     format = result location for the format
1951 	 *     amount = result location for the amount
1952 	 *     rate = result location for the rate
1953 	 *     flush = result location for the flush flag
1954 	 *     intermediate = result location for the intermediate flag
1955 	 */
1956 	public void parseStepStart(out bool active, out GstFormat format, out ulong amount, out double rate, out bool flush, out bool intermediate)
1957 	{
1958 		int outactive;
1959 		int outflush;
1960 		int outintermediate;
1961 
1962 		gst_message_parse_step_start(gstMessage, &outactive, &format, &amount, &rate, &outflush, &outintermediate);
1963 
1964 		active = (outactive == 1);
1965 		flush = (outflush == 1);
1966 		intermediate = (outintermediate == 1);
1967 	}
1968 
1969 	/**
1970 	 * Parses a stream-collection message.
1971 	 *
1972 	 * Params:
1973 	 *     collection = A location where to store a
1974 	 *         pointer to the #GstStreamCollection, or %NULL
1975 	 *
1976 	 * Since: 1.10
1977 	 */
1978 	public void parseStreamCollection(out StreamCollection collection)
1979 	{
1980 		GstStreamCollection* outcollection = null;
1981 
1982 		gst_message_parse_stream_collection(gstMessage, &outcollection);
1983 
1984 		collection = ObjectG.getDObject!(StreamCollection)(outcollection);
1985 	}
1986 
1987 	/**
1988 	 * Extracts the stream status type and owner the GstMessage. The returned
1989 	 * owner remains valid for as long as the reference to @message is valid and
1990 	 * should thus not be unreffed.
1991 	 *
1992 	 * MT safe.
1993 	 *
1994 	 * Params:
1995 	 *     type = A pointer to hold the status type
1996 	 *     owner = The owner element of the message source
1997 	 */
1998 	public void parseStreamStatus(out GstStreamStatusType type, out Element owner)
1999 	{
2000 		GstElement* outowner = null;
2001 
2002 		gst_message_parse_stream_status(gstMessage, &type, &outowner);
2003 
2004 		owner = ObjectG.getDObject!(Element)(outowner);
2005 	}
2006 
2007 	/**
2008 	 * Parses a streams-selected message.
2009 	 *
2010 	 * Params:
2011 	 *     collection = A location where to store a
2012 	 *         pointer to the #GstStreamCollection, or %NULL
2013 	 *
2014 	 * Since: 1.10
2015 	 */
2016 	public void parseStreamsSelected(out StreamCollection collection)
2017 	{
2018 		GstStreamCollection* outcollection = null;
2019 
2020 		gst_message_parse_streams_selected(gstMessage, &outcollection);
2021 
2022 		collection = ObjectG.getDObject!(StreamCollection)(outcollection);
2023 	}
2024 
2025 	/**
2026 	 * Extracts the change type and completion status from the GstMessage.
2027 	 *
2028 	 * MT safe.
2029 	 *
2030 	 * Params:
2031 	 *     type = A pointer to hold the change type
2032 	 *     owner = The owner element of the
2033 	 *         message source
2034 	 *     busy = a pointer to hold whether the change is in
2035 	 *         progress or has been completed
2036 	 */
2037 	public void parseStructureChange(out GstStructureChangeType type, out Element owner, out bool busy)
2038 	{
2039 		GstElement* outowner = null;
2040 		int outbusy;
2041 
2042 		gst_message_parse_structure_change(gstMessage, &type, &outowner, &outbusy);
2043 
2044 		owner = ObjectG.getDObject!(Element)(outowner);
2045 		busy = (outbusy == 1);
2046 	}
2047 
2048 	/**
2049 	 * Extracts the tag list from the GstMessage. The tag list returned in the
2050 	 * output argument is a copy; the caller must free it when done.
2051 	 *
2052 	 * Typical usage of this function might be:
2053 	 * |[<!-- language="C" -->
2054 	 * ...
2055 	 * switch (GST_MESSAGE_TYPE (msg)) {
2056 	 * case GST_MESSAGE_TAG: {
2057 	 * GstTagList *tags = NULL;
2058 	 *
2059 	 * gst_message_parse_tag (msg, &amp;tags);
2060 	 * g_print ("Got tags from element %s\n", GST_OBJECT_NAME (msg->src));
2061 	 * handle_tags (tags);
2062 	 * gst_tag_list_unref (tags);
2063 	 * break;
2064 	 * }
2065 	 * ...
2066 	 * }
2067 	 * ...
2068 	 * ]|
2069 	 *
2070 	 * MT safe.
2071 	 *
2072 	 * Params:
2073 	 *     tagList = return location for the tag-list.
2074 	 */
2075 	public void parseTag(out TagList tagList)
2076 	{
2077 		GstTagList* outtagList = null;
2078 
2079 		gst_message_parse_tag(gstMessage, &outtagList);
2080 
2081 		tagList = ObjectG.getDObject!(TagList)(outtagList);
2082 	}
2083 
2084 	/**
2085 	 * Extract the TOC from the #GstMessage. The TOC returned in the
2086 	 * output argument is a copy; the caller must free it with
2087 	 * gst_toc_unref() when done.
2088 	 *
2089 	 * MT safe.
2090 	 *
2091 	 * Params:
2092 	 *     toc = return location for the TOC.
2093 	 *     updated = return location for the updated flag.
2094 	 */
2095 	public void parseToc(out Toc toc, out bool updated)
2096 	{
2097 		GstToc* outtoc = null;
2098 		int outupdated;
2099 
2100 		gst_message_parse_toc(gstMessage, &outtoc, &outupdated);
2101 
2102 		toc = ObjectG.getDObject!(Toc)(outtoc);
2103 		updated = (outupdated == 1);
2104 	}
2105 
2106 	/**
2107 	 * Extracts the GError and debug string from the GstMessage. The values returned
2108 	 * in the output arguments are copies; the caller must free them when done.
2109 	 *
2110 	 * MT safe.
2111 	 *
2112 	 * Params:
2113 	 *     gerror = location for the GError
2114 	 *     dbg = location for the debug message,
2115 	 *         or %NULL
2116 	 */
2117 	public void parseWarning(out ErrorG gerror, out string dbg)
2118 	{
2119 		GError* outgerror = null;
2120 		char* outdbg = null;
2121 
2122 		gst_message_parse_warning(gstMessage, &outgerror, &outdbg);
2123 
2124 		gerror = new ErrorG(outgerror);
2125 		dbg = Str.toString(outdbg);
2126 	}
2127 
2128 	/**
2129 	 * Returns the optional details structure, may be NULL if none
2130 	 * The returned structure must not be freed.
2131 	 *
2132 	 * Params:
2133 	 *     structure = A pointer to the returned details structure
2134 	 *
2135 	 * Since: 1.10
2136 	 */
2137 	public void parseWarningDetails(out Structure structure)
2138 	{
2139 		GstStructure* outstructure = null;
2140 
2141 		gst_message_parse_warning_details(gstMessage, &outstructure);
2142 
2143 		structure = ObjectG.getDObject!(Structure)(outstructure);
2144 	}
2145 
2146 	/**
2147 	 * Configures the buffering stats values in @message.
2148 	 *
2149 	 * Params:
2150 	 *     mode = a buffering mode
2151 	 *     avgIn = the average input rate
2152 	 *     avgOut = the average output rate
2153 	 *     bufferingLeft = amount of buffering time left in milliseconds
2154 	 */
2155 	public void setBufferingStats(GstBufferingMode mode, int avgIn, int avgOut, long bufferingLeft)
2156 	{
2157 		gst_message_set_buffering_stats(gstMessage, mode, avgIn, avgOut, bufferingLeft);
2158 	}
2159 
2160 	/**
2161 	 * Sets the group id on the stream-start message.
2162 	 *
2163 	 * All streams that have the same group id are supposed to be played
2164 	 * together, i.e. all streams inside a container file should have the
2165 	 * same group id but different stream ids. The group id should change
2166 	 * each time the stream is started, resulting in different group ids
2167 	 * each time a file is played for example.
2168 	 *
2169 	 * MT safe.
2170 	 *
2171 	 * Params:
2172 	 *     groupId = the group id
2173 	 *
2174 	 * Since: 1.2
2175 	 */
2176 	public void setGroupId(uint groupId)
2177 	{
2178 		gst_message_set_group_id(gstMessage, groupId);
2179 	}
2180 
2181 	/**
2182 	 * Set the QoS stats representing the history of the current continuous pipeline
2183 	 * playback period.
2184 	 *
2185 	 * When @format is @GST_FORMAT_UNDEFINED both @dropped and @processed are
2186 	 * invalid. Values of -1 for either @processed or @dropped mean unknown values.
2187 	 *
2188 	 * MT safe.
2189 	 *
2190 	 * Params:
2191 	 *     format = Units of the 'processed' and 'dropped' fields. Video sinks and video
2192 	 *         filters will use GST_FORMAT_BUFFERS (frames). Audio sinks and audio filters
2193 	 *         will likely use GST_FORMAT_DEFAULT (samples).
2194 	 *     processed = Total number of units correctly processed since the last state
2195 	 *         change to READY or a flushing operation.
2196 	 *     dropped = Total number of units dropped since the last state change to READY
2197 	 *         or a flushing operation.
2198 	 */
2199 	public void setQosStats(GstFormat format, ulong processed, ulong dropped)
2200 	{
2201 		gst_message_set_qos_stats(gstMessage, format, processed, dropped);
2202 	}
2203 
2204 	/**
2205 	 * Set the QoS values that have been calculated/analysed from the QoS data
2206 	 *
2207 	 * MT safe.
2208 	 *
2209 	 * Params:
2210 	 *     jitter = The difference of the running-time against the deadline.
2211 	 *     proportion = Long term prediction of the ideal rate relative to normal rate
2212 	 *         to get optimal quality.
2213 	 *     quality = An element dependent integer value that specifies the current
2214 	 *         quality level of the element. The default maximum quality is 1000000.
2215 	 */
2216 	public void setQosValues(long jitter, double proportion, int quality)
2217 	{
2218 		gst_message_set_qos_values(gstMessage, jitter, proportion, quality);
2219 	}
2220 
2221 	/**
2222 	 * Set the sequence number of a message.
2223 	 *
2224 	 * This function might be called by the creator of a message to indicate that
2225 	 * the message relates to other messages or events. See gst_message_get_seqnum()
2226 	 * for more information.
2227 	 *
2228 	 * MT safe.
2229 	 *
2230 	 * Params:
2231 	 *     seqnum = A sequence number.
2232 	 */
2233 	public void setSeqnum(uint seqnum)
2234 	{
2235 		gst_message_set_seqnum(gstMessage, seqnum);
2236 	}
2237 
2238 	/**
2239 	 * Configures the object handling the streaming thread. This is usually a
2240 	 * GstTask object but other objects might be added in the future.
2241 	 *
2242 	 * Params:
2243 	 *     object = the object controlling the streaming
2244 	 */
2245 	public void setStreamStatusObject(Value object)
2246 	{
2247 		gst_message_set_stream_status_object(gstMessage, (object is null) ? null : object.getValueStruct());
2248 	}
2249 
2250 	/**
2251 	 * Adds the @stream to the @message.
2252 	 *
2253 	 * Params:
2254 	 *     stream = a #GstStream to add to @message
2255 	 *
2256 	 * Since: 1.10
2257 	 */
2258 	public void streamsSelectedAdd(Stream stream)
2259 	{
2260 		gst_message_streams_selected_add(gstMessage, (stream is null) ? null : stream.getStreamStruct());
2261 	}
2262 
2263 	/**
2264 	 * Returns the number of streams contained in the @message.
2265 	 *
2266 	 * Returns: The number of streams contained within.
2267 	 *
2268 	 * Since: 1.10
2269 	 */
2270 	public uint streamsSelectedGetSize()
2271 	{
2272 		return gst_message_streams_selected_get_size(gstMessage);
2273 	}
2274 
2275 	/**
2276 	 * Retrieves the #GstStream with index @index from the @message.
2277 	 *
2278 	 * Params:
2279 	 *     idx = Index of the stream to retrieve
2280 	 *
2281 	 * Returns: A #GstStream
2282 	 *
2283 	 * Since: 1.10
2284 	 */
2285 	public Stream streamsSelectedGetStream(uint idx)
2286 	{
2287 		auto p = gst_message_streams_selected_get_stream(gstMessage, idx);
2288 
2289 		if(p is null)
2290 		{
2291 			return null;
2292 		}
2293 
2294 		return ObjectG.getDObject!(Stream)(cast(GstStream*) p, true);
2295 	}
2296 
2297 	/**
2298 	 * Get a writable version of the structure.
2299 	 *
2300 	 * Returns: The structure of the message. The structure
2301 	 *     is still owned by the message, which means that you should not free
2302 	 *     it and that the pointer becomes invalid when you free the message.
2303 	 *     This function checks if @message is writable and will never return
2304 	 *     %NULL.
2305 	 *
2306 	 *     MT safe.
2307 	 *
2308 	 * Since: 1.14
2309 	 */
2310 	public Structure writableStructure()
2311 	{
2312 		auto p = gst_message_writable_structure(gstMessage);
2313 
2314 		if(p is null)
2315 		{
2316 			return null;
2317 		}
2318 
2319 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
2320 	}
2321 
2322 	/**
2323 	 * Get a printable name for the given message type. Do not modify or free.
2324 	 *
2325 	 * Params:
2326 	 *     type = the message type
2327 	 *
2328 	 * Returns: a reference to the static name of the message.
2329 	 */
2330 	public static string typeGetName(GstMessageType type)
2331 	{
2332 		return Str.toString(gst_message_type_get_name(type));
2333 	}
2334 
2335 	/**
2336 	 * Get the unique quark for the given message type.
2337 	 *
2338 	 * Params:
2339 	 *     type = the message type
2340 	 *
2341 	 * Returns: the quark associated with the message type
2342 	 */
2343 	public static GQuark typeToQuark(GstMessageType type)
2344 	{
2345 		return gst_message_type_to_quark(type);
2346 	}
2347 }