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