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