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