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  * Conversion parameters:
26  * inFile  = gstreamer-GstMessage.html
27  * outPack = gstreamer
28  * outFile = Message
29  * strct   = GstMessage
30  * realStrct=
31  * ctorStrct=
32  * clss    = Message
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gst_message_
41  * omit structs:
42  * 	- GstMessage
43  * omit prefixes:
44  * omit code:
45  * 	- gst_message_parse_tag
46  * 	- gst_message_new_element
47  * 	- gst_message_new_new_clock
48  * 	- gst_message_new_segment_done
49  * 	- gst_message_new_segment_start
50  * 	- gst_message_new_warning
51  * 	- gst_message_new_state_dirty
52  * 	- gst_message_new_eos
53  * 	- gst_message_new_error
54  * 	- gst_message_new_info
55  * 	- gst_message_new_latency
56  * 	- gst_message_new_duration_changed
57  * 	- gst_message_new_async_start
58  * 	- gst_message_new_reset_time
59  * omit signals:
60  * imports:
61  * 	- glib.Str
62  * 	- glib.ErrorG
63  * 	- gobject.Value
64  * 	- gstreamer.Clock
65  * 	- gstreamer.Context
66  * 	- gstreamer.Element
67  * 	- gstreamer.ObjectGst
68  * 	- gstreamer.Structure
69  * 	- gstreamer.TagList
70  * 	- gstreamer.Toc
71  * structWrap:
72  * 	- GError* -> ErrorG
73  * 	- GValue* -> Value
74  * 	- GstClock* -> Clock
75  * 	- GstContext* -> Context
76  * 	- GstElement* -> Element
77  * 	- GstMessage* -> Message
78  * 	- GstObject* -> ObjectGst
79  * 	- GstStructure* -> Structure
80  * 	- GstTagList* -> TagList
81  * 	- GstToc* -> Toc
82  * module aliases:
83  * local aliases:
84  * overrides:
85  */
86 
87 module gstreamer.Message;
88 
89 public  import gstreamerc.gstreamertypes;
90 
91 private import gstreamerc.gstreamer;
92 private import glib.ConstructionException;
93 private import gobject.ObjectG;
94 
95 
96 private import glib.Str;
97 private import glib.ErrorG;
98 private import gobject.Value;
99 private import gstreamer.Clock;
100 private import gstreamer.Context;
101 private import gstreamer.Element;
102 private import gstreamer.ObjectGst;
103 private import gstreamer.Structure;
104 private import gstreamer.TagList;
105 private import gstreamer.Toc;
106 
107 
108 
109 
110 /**
111  * Messages are implemented as a subclass of GstMiniObject with a generic
112  * GstStructure as the content. This allows for writing custom messages without
113  * requiring an API change while allowing a wide range of different types
114  * of messages.
115  *
116  * Messages are posted by objects in the pipeline and are passed to the
117  * application using the GstBus.
118  *
119  * The basic use pattern of posting a message on a GstBus is as follows:
120  *
121  * $(DDOC_COMMENT example)
122  *
123  * A GstElement usually posts messages on the bus provided by the parent
124  * container using gst_element_post_message().
125  *
126  * Last reviewed on 2005-11-09 (0.9.4)
127  */
128 public class Message
129 {
130 	
131 	/** the main Gtk struct */
132 	protected GstMessage* gstMessage;
133 	
134 	
135 	public GstMessage* getMessageStruct()
136 	{
137 		return gstMessage;
138 	}
139 	
140 	
141 	/** the main Gtk struct as a void* */
142 	protected void* getStruct()
143 	{
144 		return cast(void*)gstMessage;
145 	}
146 	
147 	/**
148 	 * Sets our main struct and passes it to the parent class
149 	 */
150 	public this (GstMessage* gstMessage)
151 	{
152 		this.gstMessage = gstMessage;
153 	}
154 	
155 	/**
156 	 * Get the type of the message.
157 	 */
158 	public GstMessageType type()
159 	{
160 		return cast(GstMessageType)getMessageStruct().type;
161 	}
162 	
163 	/**
164 	 * Get the src (the element that originated the message) of the message.
165 	 */
166 	public ObjectGst src()
167 	{
168 		return new ObjectGst( cast(GstObject*)getMessageStruct().src );
169 	}
170 	
171 	/**
172 	 * Create a new element-specific message. This is meant as a generic way of
173 	 * allowing one-way communication from an element to an application, for example
174 	 * "the firewire cable was unplugged". The format of the message should be
175 	 * documented in the element's documentation. The structure field can be NULL.
176 	 * MT safe.
177 	 * Params:
178 	 *  src = The object originating the message.
179 	 *  structure = The structure for the message. The message will take ownership of
180 	 *  the structure.
181 	 * Returns:
182 	 *  The new element message.
183 	 */
184 	public static Message newElement(ObjectGst src, Structure structure)
185 	{
186 		// GstMessage* gst_message_new_element (GstObject *src,  GstStructure *structure);
187 		auto p = gst_message_new_element((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct());
188 		
189 		if(p is null)
190 		{
191 			throw new ConstructionException("null returned by gst_message_new_element");
192 		}
193 		
194 		return new Message(cast(GstMessage*)p);
195 	}
196 	
197 	/**
198 	 * Create a new clock message. This message is posted whenever the
199 	 * pipeline selectes a new clock for the pipeline.
200 	 * MT safe.
201 	 * Params:
202 	 *  src = The object originating the message.
203 	 *  clock = the new selected clock
204 	 * Returns:
205 	 *  The new new clock message.
206 	 */
207 	public static Message newNewClock(ObjectGst src, Clock clock)
208 	{
209 		// GstMessage* gst_message_new_new_clock (GstObject *src,  GstClock *clock);
210 		auto p = gst_message_new_new_clock((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct());
211 		
212 		if(p is null)
213 		{
214 			throw new ConstructionException("null returned by gst_message_new_new_clock");
215 		}
216 		
217 		return new Message(cast(GstMessage*)p );
218 	}
219 	
220 	/**
221 	 * Create a new segment done message. This message is posted by elements that
222 	 * finish playback of a segment as a result of a segment seek. This message
223 	 * is received by the application after all elements that posted a segment_start
224 	 * have posted the segment_done.
225 	 * MT safe.
226 	 * Params:
227 	 *  src = The object originating the message.
228 	 *  format = The format of the position being done
229 	 *  position = The position of the segment being done
230 	 * Returns:
231 	 *  The new segment done message.
232 	 */
233 	public static Message newSegmentDone(ObjectGst src, GstFormat format, long position)
234 	{
235 		// GstMessage* gst_message_new_segment_done (GstObject *src,  GstFormat format,  gint64 position);
236 		auto p = gst_message_new_segment_done((src is null) ? null : src.getObjectGstStruct(), format, position);
237 		
238 		if(p is null)
239 		{
240 			throw new ConstructionException("null returned by gst_message_new_segment_done");
241 		}
242 		
243 		return new Message(cast(GstMessage*)p );
244 	}
245 	
246 	/**
247 	 * Create a new segment message. This message is posted by elements that
248 	 * start playback of a segment as a result of a segment seek. This message
249 	 * is not received by the application but is used for maintenance reasons in
250 	 * container elements.
251 	 * MT safe.
252 	 * Params:
253 	 *  src = The object originating the message.
254 	 *  format = The format of the position being played
255 	 *  position = The position of the segment being played
256 	 * Returns:
257 	 *  The new segment start message.
258 	 */
259 	public static Message newSegmentStart(ObjectGst src, GstFormat format, long position)
260 	{
261 		// GstMessage* gst_message_new_segment_start (GstObject *src,  GstFormat format,  gint64 position);
262 		auto p = gst_message_new_segment_start((src is null) ? null : src.getObjectGstStruct(), format, position);
263 		
264 		if(p is null)
265 		{
266 			throw new ConstructionException("null returned by gst_message_new_segment_start");
267 		}
268 		
269 		return new Message(cast(GstMessage*)p );
270 	}
271 	
272 	/**
273 	 * Create a new warning message. The message will make copies of error and
274 	 * debug.
275 	 * MT safe.
276 	 * Params:
277 	 *  src = The object originating the message.
278 	 *  error = The GError for this message.
279 	 *  debug = A debugging string for something or other.
280 	 * Returns:
281 	 *  The new warning message.
282 	 */
283 	public static Message newWarning(ObjectGst src, ErrorG error, string dbug)
284 	{
285 		// GstMessage* gst_message_new_warning (GstObject *src,  GError *error,  gchar *debug);
286 		auto p = gst_message_new_warning((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug));
287 		
288 		if(p is null)
289 		{
290 			throw new ConstructionException("null returned by gst_message_new_warning");
291 		}
292 		
293 		return new Message(cast(GstMessage*)p );
294 	}
295 	
296 	/**
297 	 * Create a state dirty message. This message is posted whenever an element
298 	 * changed its state asynchronously and is used internally to update the
299 	 * states of container objects.
300 	 * MT safe.
301 	 * Params:
302 	 *  src = the object originating the message
303 	 * Returns:
304 	 *  The new state dirty message.
305 	 */
306 	public static Message newStateDirty(ObjectGst src)
307 	{
308 		// GstMessage* gst_message_new_state_dirty (GstObject *src);
309 		auto p = gst_message_new_state_dirty((src is null) ? null : src.getObjectGstStruct());
310 		
311 		if(p is null)
312 		{
313 			throw new ConstructionException("null returned by gst_message_new_state_dirty");
314 		}
315 		
316 		return new Message(cast(GstMessage*)p );
317 	}
318 	
319 	/**
320 	 * Create a new eos message. This message is generated and posted in
321 	 * the sink elements of a GstBin. The bin will only forward the EOS
322 	 * message to the application if all sinks have posted an EOS message.
323 	 * MT safe.
324 	 * Params:
325 	 *  src = The object originating the message.
326 	 * Returns:
327 	 *  The new eos message.
328 	 */
329 	public static Message newEOS(ObjectGst src)
330 	{
331 		// GstMessage* gst_message_new_eos (GstObject *src);
332 		auto p = gst_message_new_eos((src is null) ? null : src.getObjectGstStruct());
333 		
334 		if(p is null)
335 		{
336 			throw new ConstructionException("null returned by gst_message_new_eos");
337 		}
338 		
339 		return new Message(cast(GstMessage*)p );
340 	}
341 	
342 	/**
343 	 * Create a new error message. The message will copy error and
344 	 * debug. This message is posted by element when a fatal event
345 	 * occured. The pipeline will probably (partially) stop. The application
346 	 * receiving this message should stop the pipeline.
347 	 * MT safe.
348 	 * Params:
349 	 *  src = The object originating the message.
350 	 *  error = The GError for this message.
351 	 *  debug = A debugging string for something or other.
352 	 * Returns:
353 	 *  The new error message.
354 	 */
355 	public static Message newError(ObjectGst src, ErrorG error, string dbug)
356 	{
357 		// GstMessage* gst_message_new_error (GstObject *src,  GError *error,  gchar *debug);
358 		auto p = gst_message_new_error((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug));
359 		
360 		if(p is null)
361 		{
362 			throw new ConstructionException("null returned by gst_message_new_error");
363 		}
364 		
365 		return new Message(cast(GstMessage*)p );
366 	}
367 	
368 	/**
369 	 * Create a new info message. The message will make copies of error and
370 	 * debug.
371 	 * MT safe.
372 	 * Since 0.10.12
373 	 * Params:
374 	 *  src = The object originating the message.
375 	 *  error = The GError for this message.
376 	 *  debug = A debugging string for something or other.
377 	 * Returns:
378 	 *  The new info message.
379 	 */
380 	public static Message newInfo(ObjectGst src, ErrorG error, string dbug)
381 	{
382 		// GstMessage* gst_message_new_info (GstObject *src,  GError *error,  gchar *debug);
383 		auto p = gst_message_new_info((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug));
384 		
385 		if(p is null)
386 		{
387 			throw new ConstructionException("null returned by gst_message_new_info");
388 		}
389 		
390 		return new Message(cast(GstMessage*)p );
391 	}
392 	
393 	/**
394 	 * This message can be posted by elements when their latency requirements
395 	 * have changed.
396 	 * Params:
397 	 *     src = The object originating the message.
398 	 * Returns:
399 	 * The new latency message. MT safe.
400 	 */
401 	public static Message newLatency(ObjectGst src)
402 	{
403 		// GstMessage* gst_message_new_latency (GstObject *src);
404 		auto p = gst_message_new_latency((src is null) ? null : src.getObjectGstStruct());
405 		
406 		if(p is null)
407 		{
408 			throw new ConstructionException("null returned by gst_message_new_latency");
409 		}
410 		
411 		return new Message(cast(GstMessage*)p );
412 	}
413 	
414 	/**
415 	 * Create a new duration changed message. This message is posted by elements
416 	 * that know the duration of a stream when the duration changes. This message
417 	 * is received by bins and is used to calculate the total duration of a
418 	 * pipeline. Elements may post a duration message with a duration of
419 	 * GST_CLOCK_TIME_NONE to indicate that the duration has changed and the
420 	 * cached duration should be discarded. The new duration can then be
421 	 * retrieved via a query.
422 	 * Params:
423 	 *    src = The object originating the message. [transfer none]
424 	 * Throws: ConstructionException GTK+ fails to create the object.
425 	 */
426 	public static Message newDurationChanged(ObjectGst src)
427 	{
428 		// GstMessage * gst_message_new_duration_changed (GstObject *src);
429 		auto p = gst_message_new_duration_changed((src is null) ? null : src.getObjectGstStruct());
430 		
431 		if(p is null)
432 		{
433 			throw new ConstructionException("null returned by gst_message_new_duration_changed((src is null) ? null : src.getObjectGstStruct())");
434 		}
435 		
436 		return new Message(cast(GstMessage*)p );
437 	}
438 	
439 	/**
440 	 * This message is posted by elements when they start an ASYNC state change.
441 	 * Params:
442 	 * src = The object originating the message. [transfer none]
443 	 * Throws: ConstructionException GTK+ fails to create the object.
444 	 */
445 	public static Message newAsyncStart(ObjectGst src)
446 	{
447 		// GstMessage * gst_message_new_async_start (GstObject *src);
448 		auto p = gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct());
449 		if(p is null)
450 		{
451 			throw new ConstructionException("null returned by gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct())");
452 		}
453 		return new Message(cast(GstMessage*)p );
454 	}
455 	
456 	/**
457 	 * The message is posted when elements completed an ASYNC state change.
458 	 * running_time contains the time of the desired running_time when this
459 	 * elements goes to PLAYING. A value of GST_CLOCK_TIME_NONE for running_time
460 	 * means that the element has no clock interaction and thus doesn't care about
461 	 * the running_time of the pipeline.
462 	 * Params:
463 	 * src = The object originating the message. [transfer none]
464 	 * runningTime = the desired running_time
465 	 * Throws: ConstructionException GTK+ fails to create the object.
466 	 */
467 	public static Message newAsyncDone(ObjectGst src, GstClockTime runningTime)
468 	{
469 		// GstMessage * gst_message_new_async_done (GstObject *src,  GstClockTime running_time);
470 		auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime);
471 		if(p is null)
472 		{
473 			throw new ConstructionException("null returned by gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime)");
474 		}
475 		return new Message(cast(GstMessage*)p );
476 	}
477 	
478 	/**
479 	 */
480 	
481 	/**
482 	 * Get the unique quark for the given message type.
483 	 * Params:
484 	 * type = the message type
485 	 * Returns: the quark associated with the message type
486 	 */
487 	public static GQuark typeToQuark(GstMessageType type)
488 	{
489 		// GQuark gst_message_type_to_quark (GstMessageType type);
490 		return gst_message_type_to_quark(type);
491 	}
492 	
493 	/**
494 	 * Get a printable name for the given message type. Do not modify or free.
495 	 * Params:
496 	 * type = the message type
497 	 * Returns: a reference to the static name of the message.
498 	 */
499 	public static string typeGetName(GstMessageType type)
500 	{
501 		// const gchar * gst_message_type_get_name (GstMessageType type);
502 		return Str.toString(gst_message_type_get_name(type));
503 	}
504 	
505 	/**
506 	 * Convenience macro to increase the reference count of the message.
507 	 * Returns: msg (for convenience when doing assignments)
508 	 */
509 	public Message doref()
510 	{
511 		// GstMessage * gst_message_ref (GstMessage *msg);
512 		auto p = gst_message_ref(gstMessage);
513 		
514 		if(p is null)
515 		{
516 			return null;
517 		}
518 		
519 		return ObjectG.getDObject!(Message)(cast(GstMessage*) p);
520 	}
521 	
522 	/**
523 	 * Convenience macro to decrease the reference count of the message, possibly
524 	 * freeing it.
525 	 */
526 	public void unref()
527 	{
528 		// void gst_message_unref (GstMessage *msg);
529 		gst_message_unref(gstMessage);
530 	}
531 	
532 	/**
533 	 * Creates a copy of the message. Returns a copy of the message.
534 	 * Returns: a new copy of msg. MT safe. [transfer full]
535 	 */
536 	public Message copy()
537 	{
538 		// GstMessage * gst_message_copy (const GstMessage *msg);
539 		auto p = gst_message_copy(gstMessage);
540 		
541 		if(p is null)
542 		{
543 			return null;
544 		}
545 		
546 		return ObjectG.getDObject!(Message)(cast(GstMessage*) p);
547 	}
548 	
549 	/**
550 	 * Access the structure of the message.
551 	 * Returns: The structure of the message. The structure is still owned by the message, which means that you should not free it and that the pointer becomes invalid when you free the message. MT safe. [transfer none]
552 	 */
553 	public Structure getStructure()
554 	{
555 		// const GstStructure * gst_message_get_structure (GstMessage *message);
556 		auto p = gst_message_get_structure(gstMessage);
557 		
558 		if(p is null)
559 		{
560 			return null;
561 		}
562 		
563 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
564 	}
565 	
566 	/**
567 	 * Retrieve the sequence number of a message.
568 	 * Messages have ever-incrementing sequence numbers, which may also be set
569 	 * explicitly via gst_message_set_seqnum(). Sequence numbers are typically used
570 	 * to indicate that a message corresponds to some other set of messages or
571 	 * events, for example a SEGMENT_DONE message corresponding to a SEEK event. It
572 	 * is considered good practice to make this correspondence when possible, though
573 	 * it is not required.
574 	 * Note that events and messages share the same sequence number incrementor;
575 	 * two events or messages will never have the same sequence number unless
576 	 * that correspondence was made explicitly.
577 	 * Returns: The message's sequence number. MT safe.
578 	 */
579 	public uint getSeqnum()
580 	{
581 		// guint32 gst_message_get_seqnum (GstMessage *message);
582 		return gst_message_get_seqnum(gstMessage);
583 	}
584 	
585 	/**
586 	 * Set the sequence number of a message.
587 	 * This function might be called by the creator of a message to indicate that
588 	 * the message relates to other messages or events. See gst_message_get_seqnum()
589 	 * for more information.
590 	 * MT safe.
591 	 * Params:
592 	 * seqnum = A sequence number.
593 	 */
594 	public void setSeqnum(uint seqnum)
595 	{
596 		// void gst_message_set_seqnum (GstMessage *message,  guint32 seqnum);
597 		gst_message_set_seqnum(gstMessage, seqnum);
598 	}
599 	
600 	/**
601 	 * Checks if message has the given name. This function is usually used to
602 	 * check the name of a custom message.
603 	 * Params:
604 	 * name = name to check
605 	 * Returns: TRUE if name matches the name of the message structure.
606 	 */
607 	public int hasName(string name)
608 	{
609 		// gboolean gst_message_has_name (GstMessage *message,  const gchar *name);
610 		return gst_message_has_name(gstMessage, Str.toStringz(name));
611 	}
612 	
613 	/**
614 	 * Modifies a pointer to a GstMessage to point to a different GstMessage. The
615 	 * modification is done atomically (so this is useful for ensuring thread safety
616 	 * in some cases), and the reference counts are updated appropriately (the old
617 	 * message is unreffed, the new one is reffed).
618 	 * Either new_message or the GstMessage pointed to by old_message may be NULL.
619 	 * Params:
620 	 * oldMessage = pointer to a pointer to a GstMessage
621 	 * to be replaced. [inout][transfer full]
622 	 * newMessage = pointer to a GstMessage that will
623 	 * replace the message pointed to by old_message. [allow-none][transfer none]
624 	 * Returns: TRUE if new_message was different from old_message
625 	 */
626 	public static int replace(ref Message oldMessage, Message newMessage)
627 	{
628 		// gboolean gst_message_replace (GstMessage **old_message,  GstMessage *new_message);
629 		GstMessage* outoldMessage = (oldMessage is null) ? null : oldMessage.getMessageStruct();
630 		
631 		auto p = gst_message_replace(&outoldMessage, (newMessage is null) ? null : newMessage.getMessageStruct());
632 		
633 		oldMessage = ObjectG.getDObject!(Message)(outoldMessage);
634 		return p;
635 	}
636 	
637 	/**
638 	 * Extracts the GError and debug string from the GstMessage. The values returned
639 	 * in the output arguments are copies; the caller must free them when done.
640 	 * Params:
641 	 * gerror = location for the GError. [out][allow-none][transfer full]
642 	 */
643 	public void parseError(out ErrorG gerror, out string dbug)
644 	{
645 		// void gst_message_parse_error (GstMessage *message,  GError **gerror,  gchar **debug);
646 		GError* outgerror = null;
647 		char* outdbug = null;
648 		
649 		gst_message_parse_error(gstMessage, &outgerror, &outdbug);
650 		
651 		gerror = ObjectG.getDObject!(ErrorG)(outgerror);
652 		dbug = Str.toString(outdbug);
653 	}
654 	
655 	/**
656 	 * Extracts the GError and debug string from the GstMessage. The values returned
657 	 * in the output arguments are copies; the caller must free them when done.
658 	 * MT safe.
659 	 * Params:
660 	 * gerror = location for the GError. [out][allow-none][transfer full]
661 	 */
662 	public void parseWarning(out ErrorG gerror, out string dbug)
663 	{
664 		// void gst_message_parse_warning (GstMessage *message,  GError **gerror,  gchar **debug);
665 		GError* outgerror = null;
666 		char* outdbug = null;
667 		
668 		gst_message_parse_warning(gstMessage, &outgerror, &outdbug);
669 		
670 		gerror = ObjectG.getDObject!(ErrorG)(outgerror);
671 		dbug = Str.toString(outdbug);
672 	}
673 	
674 	/**
675 	 * Extracts the GError and debug string from the GstMessage. The values returned
676 	 * in the output arguments are copies; the caller must free them when done.
677 	 * MT safe.
678 	 * Params:
679 	 * gerror = location for the GError. [out][allow-none][transfer full]
680 	 */
681 	public void parseInfo(out ErrorG gerror, out string dbug)
682 	{
683 		// void gst_message_parse_info (GstMessage *message,  GError **gerror,  gchar **debug);
684 		GError* outgerror = null;
685 		char* outdbug = null;
686 		
687 		gst_message_parse_info(gstMessage, &outgerror, &outdbug);
688 		
689 		gerror = ObjectG.getDObject!(ErrorG)(outgerror);
690 		dbug = Str.toString(outdbug);
691 	}
692 	
693 	/**
694 	 * Create a new tag message. The message will take ownership of the tag list.
695 	 * The message is posted by elements that discovered a new taglist.
696 	 * Params:
697 	 * src = The object originating the message. [transfer none]
698 	 * tagList = the tag list for the message. [transfer full]
699 	 * Throws: ConstructionException GTK+ fails to create the object.
700 	 */
701 	public this (ObjectGst src, TagList tagList)
702 	{
703 		// GstMessage * gst_message_new_tag (GstObject *src,  GstTagList *tag_list);
704 		auto p = gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct());
705 		if(p is null)
706 		{
707 			throw new ConstructionException("null returned by gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct())");
708 		}
709 		this(cast(GstMessage*) p);
710 	}
711 	
712 	/**
713 	 * Create a new buffering message. This message can be posted by an element that
714 	 * needs to buffer data before it can continue processing. percent should be a
715 	 * value between 0 and 100. A value of 100 means that the buffering completed.
716 	 * When percent is < 100 the application should PAUSE a PLAYING pipeline. When
717 	 * percent is 100, the application can set the pipeline (back) to PLAYING.
718 	 * The application must be prepared to receive BUFFERING messages in the
719 	 * PREROLLING state and may only set the pipeline to PLAYING after receiving a
720 	 * message with percent set to 100, which can happen after the pipeline
721 	 * completed prerolling.
722 	 * MT safe.
723 	 * Params:
724 	 * src = The object originating the message. [transfer none]
725 	 * percent = The buffering percent
726 	 * Throws: ConstructionException GTK+ fails to create the object.
727 	 */
728 	public this (ObjectGst src, int percent)
729 	{
730 		// GstMessage * gst_message_new_buffering (GstObject *src,  gint percent);
731 		auto p = gst_message_new_buffering((src is null) ? null : src.getObjectGstStruct(), percent);
732 		if(p is null)
733 		{
734 			throw new ConstructionException("null returned by gst_message_new_buffering((src is null) ? null : src.getObjectGstStruct(), percent)");
735 		}
736 		this(cast(GstMessage*) p);
737 	}
738 	
739 	/**
740 	 * Extracts the buffering percent from the GstMessage. see also
741 	 * gst_message_new_buffering().
742 	 * MT safe.
743 	 * Params:
744 	 * percent = Return location for the percent. [out][allow-none]
745 	 */
746 	public void parseBuffering(out int percent)
747 	{
748 		// void gst_message_parse_buffering (GstMessage *message,  gint *percent);
749 		gst_message_parse_buffering(gstMessage, &percent);
750 	}
751 	
752 	/**
753 	 * Configures the buffering stats values in message.
754 	 * Params:
755 	 * mode = a buffering mode
756 	 * avgIn = the average input rate
757 	 * avgOut = the average output rate
758 	 * bufferingLeft = amount of buffering time left in milliseconds
759 	 */
760 	public void setBufferingStats(GstBufferingMode mode, int avgIn, int avgOut, long bufferingLeft)
761 	{
762 		// void gst_message_set_buffering_stats (GstMessage *message,  GstBufferingMode mode,  gint avg_in,  gint avg_out,  gint64 buffering_left);
763 		gst_message_set_buffering_stats(gstMessage, mode, avgIn, avgOut, bufferingLeft);
764 	}
765 	
766 	/**
767 	 * Extracts the buffering stats values from message.
768 	 * Params:
769 	 * mode = a buffering mode, or NULL. [out][allow-none]
770 	 * avgIn = the average input rate, or NULL. [out][allow-none]
771 	 * avgOut = the average output rate, or NULL. [out][allow-none]
772 	 * bufferingLeft = amount of buffering time left in
773 	 * milliseconds, or NULL. [out][allow-none]
774 	 */
775 	public void parseBufferingStats(out GstBufferingMode mode, out int avgIn, out int avgOut, out long bufferingLeft)
776 	{
777 		// void gst_message_parse_buffering_stats (GstMessage *message,  GstBufferingMode *mode,  gint *avg_in,  gint *avg_out,  gint64 *buffering_left);
778 		gst_message_parse_buffering_stats(gstMessage, &mode, &avgIn, &avgOut, &bufferingLeft);
779 	}
780 	
781 	/**
782 	 * Create a state change message. This message is posted whenever an element
783 	 * changed its state.
784 	 * Params:
785 	 * src = the object originating the message. [transfer none]
786 	 * oldstate = the previous state
787 	 * newstate = the new (current) state
788 	 * pending = the pending (target) state
789 	 * Throws: ConstructionException GTK+ fails to create the object.
790 	 */
791 	public this (ObjectGst src, GstState oldstate, GstState newstate, GstState pending)
792 	{
793 		// GstMessage * gst_message_new_state_changed (GstObject *src,  GstState oldstate,  GstState newstate,  GstState pending);
794 		auto p = gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending);
795 		if(p is null)
796 		{
797 			throw new ConstructionException("null returned by gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending)");
798 		}
799 		this(cast(GstMessage*) p);
800 	}
801 	
802 	/**
803 	 * Extracts the old and new states from the GstMessage.
804 	 * Params:
805 	 * oldstate = the previous state, or NULL. [out][allow-none]
806 	 * newstate = the new (current) state, or NULL. [out][allow-none]
807 	 * pending = the pending (target) state, or NULL. [out][allow-none]
808 	 */
809 	public void parseStateChanged(out GstState oldstate, out GstState newstate, out GstState pending)
810 	{
811 		// void gst_message_parse_state_changed (GstMessage *message,  GstState *oldstate,  GstState *newstate,  GstState *pending);
812 		gst_message_parse_state_changed(gstMessage, &oldstate, &newstate, &pending);
813 	}
814 	
815 	/**
816 	 * This message is posted by elements when they complete a part, when intermediate set
817 	 * to TRUE, or a complete step operation.
818 	 * duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped
819 	 * amount of media in format format.
820 	 * Params:
821 	 * src = The object originating the message.
822 	 * format = the format of amount
823 	 * amount = the amount of stepped data
824 	 * rate = the rate of the stepped amount
825 	 * flush = is this an flushing step
826 	 * intermediate = is this an intermediate step
827 	 * duration = the duration of the data
828 	 * eos = the step caused EOS
829 	 * Throws: ConstructionException GTK+ fails to create the object.
830 	 */
831 	public this (ObjectGst src, GstFormat format, ulong amount, double rate, int flush, int intermediate, ulong duration, int eos)
832 	{
833 		// GstMessage * gst_message_new_step_done (GstObject *src,  GstFormat format,  guint64 amount,  gdouble rate,  gboolean flush,  gboolean intermediate,  guint64 duration,  gboolean eos);
834 		auto p = gst_message_new_step_done((src is null) ? null : src.getObjectGstStruct(), format, amount, rate, flush, intermediate, duration, eos);
835 		if(p is null)
836 		{
837 			throw new ConstructionException("null returned by gst_message_new_step_done((src is null) ? null : src.getObjectGstStruct(), format, amount, rate, flush, intermediate, duration, eos)");
838 		}
839 		this(cast(GstMessage*) p);
840 	}
841 	
842 	/**
843 	 * Extract the values the step_done message.
844 	 * MT safe.
845 	 * Params:
846 	 * format = result location for the format. [out][allow-none]
847 	 * amount = result location for the amount. [out][allow-none]
848 	 * rate = result location for the rate. [out][allow-none]
849 	 * flush = result location for the flush flag. [out][allow-none]
850 	 * intermediate = result location for the intermediate flag. [out][allow-none]
851 	 * duration = result location for the duration. [out][allow-none]
852 	 * eos = result location for the EOS flag. [out][allow-none]
853 	 */
854 	public void parseStepDone(out GstFormat format, out ulong amount, out double rate, out int flush, out int intermediate, out ulong duration, out int eos)
855 	{
856 		// void gst_message_parse_step_done (GstMessage *message,  GstFormat *format,  guint64 *amount,  gdouble *rate,  gboolean *flush,  gboolean *intermediate,  guint64 *duration,  gboolean *eos);
857 		gst_message_parse_step_done(gstMessage, &format, &amount, &rate, &flush, &intermediate, &duration, &eos);
858 	}
859 	
860 	/**
861 	 * Create a clock provide message. This message is posted whenever an
862 	 * element is ready to provide a clock or lost its ability to provide
863 	 * a clock (maybe because it paused or became EOS).
864 	 * This message is mainly used internally to manage the clock
865 	 * selection.
866 	 * Params:
867 	 * src = the object originating the message. [transfer none]
868 	 * clock = the clock it provides. [transfer none]
869 	 * ready = TRUE if the sender can provide a clock
870 	 * Throws: ConstructionException GTK+ fails to create the object.
871 	 */
872 	public this (ObjectGst src, Clock clock, int ready)
873 	{
874 		// GstMessage * gst_message_new_clock_provide (GstObject *src,  GstClock *clock,  gboolean ready);
875 		auto p = gst_message_new_clock_provide((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct(), ready);
876 		if(p is null)
877 		{
878 			throw new ConstructionException("null returned by gst_message_new_clock_provide((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct(), ready)");
879 		}
880 		this(cast(GstMessage*) p);
881 	}
882 	
883 	/**
884 	 * Extracts the clock and ready flag from the GstMessage.
885 	 * The clock object returned remains valid until the message is freed.
886 	 * MT safe.
887 	 * Params:
888 	 * clock = a pointer to hold a clock
889 	 * object, or NULL. [out][allow-none][transfer none]
890 	 * ready = a pointer to hold the ready flag, or NULL. [out][allow-none]
891 	 */
892 	public void parseClockProvide(out Clock clock, out int ready)
893 	{
894 		// void gst_message_parse_clock_provide (GstMessage *message,  GstClock **clock,  gboolean *ready);
895 		GstClock* outclock = null;
896 		
897 		gst_message_parse_clock_provide(gstMessage, &outclock, &ready);
898 		
899 		clock = ObjectG.getDObject!(Clock)(outclock);
900 	}
901 	
902 	/**
903 	 * Create a clock lost message. This message is posted whenever the
904 	 * clock is not valid anymore.
905 	 * If this message is posted by the pipeline, the pipeline will
906 	 * select a new clock again when it goes to PLAYING. It might therefore
907 	 * be needed to set the pipeline to PAUSED and PLAYING again.
908 	 * Params:
909 	 * src = the object originating the message. [transfer none]
910 	 * clock = the clock that was lost. [transfer none]
911 	 * Throws: ConstructionException GTK+ fails to create the object.
912 	 */
913 	public this (ObjectGst src, Clock clock)
914 	{
915 		// GstMessage * gst_message_new_clock_lost (GstObject *src,  GstClock *clock);
916 		auto p = gst_message_new_clock_lost((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct());
917 		if(p is null)
918 		{
919 			throw new ConstructionException("null returned by gst_message_new_clock_lost((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct())");
920 		}
921 		this(cast(GstMessage*) p);
922 	}
923 	
924 	/**
925 	 * Extracts the lost clock from the GstMessage.
926 	 * The clock object returned remains valid until the message is freed.
927 	 * MT safe.
928 	 * Params:
929 	 * clock = a pointer to hold the lost clock. [out][allow-none][transfer none]
930 	 */
931 	public void parseClockLost(out Clock clock)
932 	{
933 		// void gst_message_parse_clock_lost (GstMessage *message,  GstClock **clock);
934 		GstClock* outclock = null;
935 		
936 		gst_message_parse_clock_lost(gstMessage, &outclock);
937 		
938 		clock = ObjectG.getDObject!(Clock)(outclock);
939 	}
940 	
941 	/**
942 	 * Extracts the new clock from the GstMessage.
943 	 * The clock object returned remains valid until the message is freed.
944 	 * MT safe.
945 	 * Params:
946 	 * clock = a pointer to hold the selected
947 	 * new clock. [out][allow-none][transfer none]
948 	 */
949 	public void parseNewClock(out Clock clock)
950 	{
951 		// void gst_message_parse_new_clock (GstMessage *message,  GstClock **clock);
952 		GstClock* outclock = null;
953 		
954 		gst_message_parse_new_clock(gstMessage, &outclock);
955 		
956 		clock = ObjectG.getDObject!(Clock)(outclock);
957 	}
958 	
959 	/**
960 	 * Create a new application-typed message. GStreamer will never create these
961 	 * messages; they are a gift from us to you. Enjoy.
962 	 * Params:
963 	 * src = the object originating the message. [transfer none]
964 	 * structure = the structure for the message. The message
965 	 * will take ownership of the structure. [transfer full]
966 	 * Throws: ConstructionException GTK+ fails to create the object.
967 	 */
968 	public this (ObjectGst src, Structure structure)
969 	{
970 		// GstMessage * gst_message_new_application (GstObject *src,  GstStructure *structure);
971 		auto p = gst_message_new_application((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct());
972 		if(p is null)
973 		{
974 			throw new ConstructionException("null returned by gst_message_new_application((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct())");
975 		}
976 		this(cast(GstMessage*) p);
977 	}
978 	
979 	/**
980 	 * Create a new custom-typed message. This can be used for anything not
981 	 * handled by other message-specific functions to pass a message to the
982 	 * app. The structure field can be NULL.
983 	 * Params:
984 	 * type = The GstMessageType to distinguish messages
985 	 * src = The object originating the message.
986 	 * structure = the structure for the message. The message
987 	 * will take ownership of the structure. [transfer full]
988 	 * Throws: ConstructionException GTK+ fails to create the object.
989 	 */
990 	public this (GstMessageType type, ObjectGst src, Structure structure)
991 	{
992 		// GstMessage * gst_message_new_custom (GstMessageType type,  GstObject *src,  GstStructure *structure);
993 		auto p = gst_message_new_custom(type, (src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct());
994 		if(p is null)
995 		{
996 			throw new ConstructionException("null returned by gst_message_new_custom(type, (src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct())");
997 		}
998 		this(cast(GstMessage*) p);
999 	}
1000 	
1001 	/**
1002 	 * Extracts the position and format from the segment start message.
1003 	 * MT safe.
1004 	 * Params:
1005 	 * format = Result location for the format, or NULL. [out][allow-none]
1006 	 * position = Result location for the position, or NULL. [out][allow-none]
1007 	 */
1008 	public void parseSegmentStart(out GstFormat format, out long position)
1009 	{
1010 		// void gst_message_parse_segment_start (GstMessage *message,  GstFormat *format,  gint64 *position);
1011 		gst_message_parse_segment_start(gstMessage, &format, &position);
1012 	}
1013 	
1014 	/**
1015 	 * Extracts the position and format from the segment done message.
1016 	 * MT safe.
1017 	 * Params:
1018 	 * format = Result location for the format, or NULL. [out][allow-none]
1019 	 * position = Result location for the position, or NULL. [out][allow-none]
1020 	 */
1021 	public void parseSegmentDone(out GstFormat format, out long position)
1022 	{
1023 		// void gst_message_parse_segment_done (GstMessage *message,  GstFormat *format,  gint64 *position);
1024 		gst_message_parse_segment_done(gstMessage, &format, &position);
1025 	}
1026 	
1027 	/**
1028 	 * The message is posted when elements completed an ASYNC state change.
1029 	 * running_time contains the time of the desired running_time when this
1030 	 * elements goes to PLAYING. A value of GST_CLOCK_TIME_NONE for running_time
1031 	 * means that the element has no clock interaction and thus doesn't care about
1032 	 * the running_time of the pipeline.
1033 	 * Params:
1034 	 * src = The object originating the message. [transfer none]
1035 	 * runningTime = the desired running_time
1036 	 * Throws: ConstructionException GTK+ fails to create the object.
1037 	 */
1038 	public this (ObjectGst src, GstClockTime runningTime)
1039 	{
1040 		// GstMessage * gst_message_new_async_done (GstObject *src,  GstClockTime running_time);
1041 		auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime);
1042 		if(p is null)
1043 		{
1044 			throw new ConstructionException("null returned by gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime)");
1045 		}
1046 		this(cast(GstMessage*) p);
1047 	}
1048 	
1049 	/**
1050 	 * Extract the running_time from the async_done message.
1051 	 * MT safe.
1052 	 * Params:
1053 	 * runningTime = Result location for the running_time or NULL. [out][allow-none]
1054 	 */
1055 	public void parseAsyncDone(out GstClockTime runningTime)
1056 	{
1057 		// void gst_message_parse_async_done (GstMessage *message,  GstClockTime *running_time);
1058 		gst_message_parse_async_done(gstMessage, &runningTime);
1059 	}
1060 	
1061 	/**
1062 	 * This message is posted by elements when they accept or activate a new step
1063 	 * event for amount in format.
1064 	 * active is set to FALSE when the element accepted the new step event and has
1065 	 * queued it for execution in the streaming threads.
1066 	 * active is set to TRUE when the element has activated the step operation and
1067 	 * is now ready to start executing the step in the streaming thread. After this
1068 	 * message is emited, the application can queue a new step operation in the
1069 	 * element.
1070 	 * Params:
1071 	 * src = The object originating the message.
1072 	 * active = if the step is active or queued
1073 	 * format = the format of amount
1074 	 * amount = the amount of stepped data
1075 	 * rate = the rate of the stepped amount
1076 	 * flush = is this an flushing step
1077 	 * intermediate = is this an intermediate step
1078 	 * Throws: ConstructionException GTK+ fails to create the object.
1079 	 */
1080 	public this (ObjectGst src, int active, GstFormat format, ulong amount, double rate, int flush, int intermediate)
1081 	{
1082 		// GstMessage * gst_message_new_step_start (GstObject *src,  gboolean active,  GstFormat format,  guint64 amount,  gdouble rate,  gboolean flush,  gboolean intermediate);
1083 		auto p = gst_message_new_step_start((src is null) ? null : src.getObjectGstStruct(), active, format, amount, rate, flush, intermediate);
1084 		if(p is null)
1085 		{
1086 			throw new ConstructionException("null returned by gst_message_new_step_start((src is null) ? null : src.getObjectGstStruct(), active, format, amount, rate, flush, intermediate)");
1087 		}
1088 		this(cast(GstMessage*) p);
1089 	}
1090 	
1091 	/**
1092 	 * Extract the values from step_start message.
1093 	 * MT safe.
1094 	 * Params:
1095 	 * active = result location for the active flag. [out][allow-none]
1096 	 * format = result location for the format. [out][allow-none]
1097 	 * amount = result location for the amount. [out][allow-none]
1098 	 * rate = result location for the rate. [out][allow-none]
1099 	 * flush = result location for the flush flag. [out][allow-none]
1100 	 * intermediate = result location for the intermediate flag. [out][allow-none]
1101 	 */
1102 	public void parseStepStart(out int active, out GstFormat format, out ulong amount, out double rate, out int flush, out int intermediate)
1103 	{
1104 		// void gst_message_parse_step_start (GstMessage *message,  gboolean *active,  GstFormat *format,  guint64 *amount,  gdouble *rate,  gboolean *flush,  gboolean *intermediate);
1105 		gst_message_parse_step_start(gstMessage, &active, &format, &amount, &rate, &flush, &intermediate);
1106 	}
1107 	
1108 	/**
1109 	 * A QOS message is posted on the bus whenever an element decides to drop a
1110 	 * buffer because of QoS reasons or whenever it changes its processing strategy
1111 	 * because of QoS reasons (quality adjustments such as processing at lower
1112 	 * accuracy).
1113 	 * This message can be posted by an element that performs synchronisation against the
1114 	 * clock (live) or it could be dropped by an element that performs QoS because of QOS
1115 	 * events received from a downstream element (!live).
1116 	 * running_time, stream_time, timestamp, duration should be set to the
1117 	 * respective running-time, stream-time, timestamp and duration of the (dropped)
1118 	 * buffer that generated the QoS event. Values can be left to
1119 	 * GST_CLOCK_TIME_NONE when unknown.
1120 	 * Params:
1121 	 * src = The object originating the message.
1122 	 * live = if the message was generated by a live element
1123 	 * runningTime = the running time of the buffer that generated the message
1124 	 * streamTime = the stream time of the buffer that generated the message
1125 	 * timestamp = the timestamps of the buffer that generated the message
1126 	 * duration = the duration of the buffer that generated the message
1127 	 * Throws: ConstructionException GTK+ fails to create the object.
1128 	 */
1129 	public this (ObjectGst src, int live, ulong runningTime, ulong streamTime, ulong timestamp, ulong duration)
1130 	{
1131 		// GstMessage * gst_message_new_qos (GstObject *src,  gboolean live,  guint64 running_time,  guint64 stream_time,  guint64 timestamp,  guint64 duration);
1132 		auto p = gst_message_new_qos((src is null) ? null : src.getObjectGstStruct(), live, runningTime, streamTime, timestamp, duration);
1133 		if(p is null)
1134 		{
1135 			throw new ConstructionException("null returned by gst_message_new_qos((src is null) ? null : src.getObjectGstStruct(), live, runningTime, streamTime, timestamp, duration)");
1136 		}
1137 		this(cast(GstMessage*) p);
1138 	}
1139 	
1140 	/**
1141 	 * Set the QoS values that have been calculated/analysed from the QoS data
1142 	 * MT safe.
1143 	 * Params:
1144 	 * jitter = The difference of the running-time against the deadline.
1145 	 * proportion = Long term prediction of the ideal rate relative to normal rate
1146 	 * to get optimal quality.
1147 	 * quality = An element dependent integer value that specifies the current
1148 	 * quality level of the element. The default maximum quality is 1000000.
1149 	 */
1150 	public void setQosValues(long jitter, double proportion, int quality)
1151 	{
1152 		// void gst_message_set_qos_values (GstMessage *message,  gint64 jitter,  gdouble proportion,  gint quality);
1153 		gst_message_set_qos_values(gstMessage, jitter, proportion, quality);
1154 	}
1155 	
1156 	/**
1157 	 * Set the QoS stats representing the history of the current continuous pipeline
1158 	 * playback period.
1159 	 * When format is GST_FORMAT_UNDEFINED both dropped and processed are
1160 	 * invalid. Values of -1 for either processed or dropped mean unknown values.
1161 	 * MT safe.
1162 	 * Params:
1163 	 * format = Units of the 'processed' and 'dropped' fields. Video sinks and video
1164 	 * filters will use GST_FORMAT_BUFFERS (frames). Audio sinks and audio filters
1165 	 * will likely use GST_FORMAT_DEFAULT (samples).
1166 	 * processed = Total number of units correctly processed since the last state
1167 	 * change to READY or a flushing operation.
1168 	 * dropped = Total number of units dropped since the last state change to READY
1169 	 * or a flushing operation.
1170 	 */
1171 	public void setQosStats(GstFormat format, ulong processed, ulong dropped)
1172 	{
1173 		// void gst_message_set_qos_stats (GstMessage *message,  GstFormat format,  guint64 processed,  guint64 dropped);
1174 		gst_message_set_qos_stats(gstMessage, format, processed, dropped);
1175 	}
1176 	
1177 	/**
1178 	 * Extract the timestamps and live status from the QoS message.
1179 	 * The returned values give the running_time, stream_time, timestamp and
1180 	 * duration of the dropped buffer. Values of GST_CLOCK_TIME_NONE mean unknown
1181 	 * values.
1182 	 * MT safe.
1183 	 * Params:
1184 	 * live = if the message was generated by a live element. [out][allow-none]
1185 	 * runningTime = the running time of the buffer that
1186 	 * generated the message. [out][allow-none]
1187 	 * streamTime = the stream time of the buffer that
1188 	 * generated the message. [out][allow-none]
1189 	 * timestamp = the timestamps of the buffer that
1190 	 * generated the message. [out][allow-none]
1191 	 * duration = the duration of the buffer that
1192 	 * generated the message. [out][allow-none]
1193 	 */
1194 	public void parseQos(out int live, ulong* runningTime, out ulong streamTime, out ulong timestamp, out ulong duration)
1195 	{
1196 		// void gst_message_parse_qos (GstMessage *message,  gboolean *live,  guint64 *running_time,  guint64 *stream_time,  guint64 *timestamp,  guint64 *duration);
1197 		gst_message_parse_qos(gstMessage, &live, runningTime, &streamTime, &timestamp, &duration);
1198 	}
1199 	
1200 	/**
1201 	 * Extract the QoS values that have been calculated/analysed from the QoS data
1202 	 * MT safe.
1203 	 * Params:
1204 	 * jitter = The difference of the running-time against
1205 	 * the deadline. [out][allow-none]
1206 	 * proportion = Long term prediction of the ideal rate
1207 	 * relative to normal rate to get optimal quality. [out][allow-none]
1208 	 * quality = An element dependent integer value that
1209 	 * specifies the current quality level of the element. The default
1210 	 * maximum quality is 1000000. [out][allow-none]
1211 	 */
1212 	public void parseQosValues(out long jitter, out double proportion, out int quality)
1213 	{
1214 		// void gst_message_parse_qos_values (GstMessage *message,  gint64 *jitter,  gdouble *proportion,  gint *quality);
1215 		gst_message_parse_qos_values(gstMessage, &jitter, &proportion, &quality);
1216 	}
1217 	
1218 	/**
1219 	 * Extract the QoS stats representing the history of the current continuous
1220 	 * pipeline playback period.
1221 	 * When format is GST_FORMAT_UNDEFINED both dropped and processed are
1222 	 * invalid. Values of -1 for either processed or dropped mean unknown values.
1223 	 * MT safe.
1224 	 * Params:
1225 	 * format = Units of the 'processed' and 'dropped' fields.
1226 	 * Video sinks and video filters will use GST_FORMAT_BUFFERS (frames).
1227 	 * Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT
1228 	 * (samples). [out][allow-none]
1229 	 * processed = Total number of units correctly processed
1230 	 * since the last state change to READY or a flushing operation. [out][allow-none]
1231 	 * dropped = Total number of units dropped since the last
1232 	 * state change to READY or a flushing operation. [out][allow-none]
1233 	 */
1234 	public void parseQosStats(out GstFormat format, out ulong processed, out ulong dropped)
1235 	{
1236 		// void gst_message_parse_qos_stats (GstMessage *message,  GstFormat *format,  guint64 *processed,  guint64 *dropped);
1237 		gst_message_parse_qos_stats(gstMessage, &format, &processed, &dropped);
1238 	}
1239 	
1240 	/**
1241 	 * Create a new TOC message. The message is posted by elements
1242 	 * that discovered or updated a TOC.
1243 	 * Params:
1244 	 * src = the object originating the message.
1245 	 * toc = GstToc structure for the message. [transfer none]
1246 	 * updated = whether TOC was updated or not.
1247 	 * Throws: ConstructionException GTK+ fails to create the object.
1248 	 */
1249 	public this (ObjectGst src, Toc toc, int updated)
1250 	{
1251 		// GstMessage * gst_message_new_toc (GstObject *src,  GstToc *toc,  gboolean updated);
1252 		auto p = gst_message_new_toc((src is null) ? null : src.getObjectGstStruct(), (toc is null) ? null : toc.getTocStruct(), updated);
1253 		if(p is null)
1254 		{
1255 			throw new ConstructionException("null returned by gst_message_new_toc((src is null) ? null : src.getObjectGstStruct(), (toc is null) ? null : toc.getTocStruct(), updated)");
1256 		}
1257 		this(cast(GstMessage*) p);
1258 	}
1259 	
1260 	/**
1261 	 * Extract thef TOC from the GstMessage. The TOC returned in the
1262 	 * output argument is a copy; the caller must free it with
1263 	 * gst_toc_unref() when done.
1264 	 * MT safe.
1265 	 * Params:
1266 	 * toc = return location for the TOC. [out][transfer full]
1267 	 * updated = return location for the updated flag. [out]
1268 	 */
1269 	public void parseToc(out Toc toc, out int updated)
1270 	{
1271 		// void gst_message_parse_toc (GstMessage *message,  GstToc **toc,  gboolean *updated);
1272 		GstToc* outtoc = null;
1273 		
1274 		gst_message_parse_toc(gstMessage, &outtoc, &updated);
1275 		
1276 		toc = ObjectG.getDObject!(Toc)(outtoc);
1277 	}
1278 	
1279 	/**
1280 	 * Extract the running-time from the RESET_TIME message.
1281 	 * MT safe.
1282 	 * Params:
1283 	 * runningTime = Result location for the running_time or
1284 	 * NULL. [out][allow-none]
1285 	 */
1286 	public void parseResetTime(GstClockTime* runningTime)
1287 	{
1288 		// void gst_message_parse_reset_time (GstMessage *message,  GstClockTime *running_time);
1289 		gst_message_parse_reset_time(gstMessage, runningTime);
1290 	}
1291 	
1292 	/**
1293 	 * Create a new stream_start message. This message is generated and posted in
1294 	 * the sink elements of a GstBin. The bin will only forward the STREAM_START
1295 	 * message to the application if all sinks have posted an STREAM_START message.
1296 	 * Params:
1297 	 * src = The object originating the message. [transfer none]
1298 	 * Throws: ConstructionException GTK+ fails to create the object.
1299 	 */
1300 	public this (ObjectGst src)
1301 	{
1302 		// GstMessage * gst_message_new_stream_start (GstObject *src);
1303 		auto p = gst_message_new_stream_start((src is null) ? null : src.getObjectGstStruct());
1304 		if(p is null)
1305 		{
1306 			throw new ConstructionException("null returned by gst_message_new_stream_start((src is null) ? null : src.getObjectGstStruct())");
1307 		}
1308 		this(cast(GstMessage*) p);
1309 	}
1310 	
1311 	/**
1312 	 * Sets the group id on the stream-start message.
1313 	 * All streams that have the same group id are supposed to be played
1314 	 * together, i.e. all streams inside a container file should have the
1315 	 * same group id but different stream ids. The group id should change
1316 	 * each time the stream is started, resulting in different group ids
1317 	 * each time a file is played for example.
1318 	 * MT safe.
1319 	 * Since 1.2
1320 	 * Params:
1321 	 * groupId = the group id
1322 	 */
1323 	public void setGroupId(uint groupId)
1324 	{
1325 		// void gst_message_set_group_id (GstMessage *message,  guint group_id);
1326 		gst_message_set_group_id(gstMessage, groupId);
1327 	}
1328 	
1329 	/**
1330 	 * Extract the group from the STREAM_START message.
1331 	 * Since 1.2
1332 	 * Params:
1333 	 * groupId = Result location for the group id or
1334 	 * NULL. [out][allow-none]
1335 	 * Returns: TRUE if the message had a group id set, FALSE otherwise MT safe.
1336 	 */
1337 	public int parseGroupId(out uint groupId)
1338 	{
1339 		// gboolean gst_message_parse_group_id (GstMessage *message,  guint *group_id);
1340 		return gst_message_parse_group_id(gstMessage, &groupId);
1341 	}
1342 	
1343 	/**
1344 	 * Create a new structure change message. This message is posted when the
1345 	 * structure of a pipeline is in the process of being changed, for example
1346 	 * when pads are linked or unlinked.
1347 	 * src should be the sinkpad that unlinked or linked.
1348 	 * Params:
1349 	 * src = The object originating the message. [transfer none]
1350 	 * type = The change type.
1351 	 * owner = The owner element of src. [transfer none]
1352 	 * busy = Whether the structure change is busy.
1353 	 * Throws: ConstructionException GTK+ fails to create the object.
1354 	 */
1355 	public this (ObjectGst src, GstStructureChangeType type, Element owner, int busy)
1356 	{
1357 		// GstMessage * gst_message_new_structure_change (GstObject *src,  GstStructureChangeType type,  GstElement *owner,  gboolean busy);
1358 		auto p = gst_message_new_structure_change((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct(), busy);
1359 		if(p is null)
1360 		{
1361 			throw new ConstructionException("null returned by gst_message_new_structure_change((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct(), busy)");
1362 		}
1363 		this(cast(GstMessage*) p);
1364 	}
1365 	
1366 	/**
1367 	 * Extracts the change type and completion status from the GstMessage.
1368 	 * MT safe.
1369 	 * Params:
1370 	 * type = A pointer to hold the change type. [out]
1371 	 * owner = The owner element of the
1372 	 * message source. [out][allow-none][transfer none]
1373 	 * busy = a pointer to hold whether the change is in
1374 	 * progress or has been completed. [out][allow-none]
1375 	 */
1376 	public void parseStructureChange(out GstStructureChangeType type, out Element owner, out int busy)
1377 	{
1378 		// void gst_message_parse_structure_change (GstMessage *message,  GstStructureChangeType *type,  GstElement **owner,  gboolean *busy);
1379 		GstElement* outowner = null;
1380 		
1381 		gst_message_parse_structure_change(gstMessage, &type, &outowner, &busy);
1382 		
1383 		owner = ObjectG.getDObject!(Element)(outowner);
1384 	}
1385 	
1386 	/**
1387 	 * This message can be posted by elements when they want to have their state
1388 	 * changed. A typical use case would be an audio server that wants to pause the
1389 	 * pipeline because a higher priority stream is being played.
1390 	 * Params:
1391 	 * src = the object originating the message. [transfer none]
1392 	 * state = The new requested state
1393 	 * Throws: ConstructionException GTK+ fails to create the object.
1394 	 */
1395 	public this (ObjectGst src, GstState state)
1396 	{
1397 		// GstMessage * gst_message_new_request_state (GstObject *src,  GstState state);
1398 		auto p = gst_message_new_request_state((src is null) ? null : src.getObjectGstStruct(), state);
1399 		if(p is null)
1400 		{
1401 			throw new ConstructionException("null returned by gst_message_new_request_state((src is null) ? null : src.getObjectGstStruct(), state)");
1402 		}
1403 		this(cast(GstMessage*) p);
1404 	}
1405 	
1406 	/**
1407 	 * Extract the requested state from the request_state message.
1408 	 * MT safe.
1409 	 * Params:
1410 	 * state = Result location for the requested state or NULL. [out][allow-none]
1411 	 */
1412 	public void parseRequestState(out GstState state)
1413 	{
1414 		// void gst_message_parse_request_state (GstMessage *message,  GstState *state);
1415 		gst_message_parse_request_state(gstMessage, &state);
1416 	}
1417 	
1418 	/**
1419 	 * Create a new stream status message. This message is posted when a streaming
1420 	 * thread is created/destroyed or when the state changed.
1421 	 * Params:
1422 	 * src = The object originating the message.
1423 	 * type = The stream status type.
1424 	 * owner = the owner element of src. [transfer none]
1425 	 * Throws: ConstructionException GTK+ fails to create the object.
1426 	 */
1427 	public this (ObjectGst src, GstStreamStatusType type, Element owner)
1428 	{
1429 		// GstMessage * gst_message_new_stream_status (GstObject *src,  GstStreamStatusType type,  GstElement *owner);
1430 		auto p = gst_message_new_stream_status((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct());
1431 		if(p is null)
1432 		{
1433 			throw new ConstructionException("null returned by gst_message_new_stream_status((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct())");
1434 		}
1435 		this(cast(GstMessage*) p);
1436 	}
1437 	
1438 	/**
1439 	 * Extracts the stream status type and owner the GstMessage. The returned
1440 	 * owner remains valid for as long as the reference to message is valid and
1441 	 * should thus not be unreffed.
1442 	 * MT safe.
1443 	 * Params:
1444 	 * type = A pointer to hold the status type. [out]
1445 	 * owner = The owner element of the message source. [out][transfer none]
1446 	 */
1447 	public void parseStreamStatus(out GstStreamStatusType type, out Element owner)
1448 	{
1449 		// void gst_message_parse_stream_status (GstMessage *message,  GstStreamStatusType *type,  GstElement **owner);
1450 		GstElement* outowner = null;
1451 		
1452 		gst_message_parse_stream_status(gstMessage, &type, &outowner);
1453 		
1454 		owner = ObjectG.getDObject!(Element)(outowner);
1455 	}
1456 	
1457 	/**
1458 	 * Configures the object handling the streaming thread. This is usually a
1459 	 * GstTask object but other objects might be added in the future.
1460 	 * Params:
1461 	 * object = the object controlling the streaming
1462 	 */
1463 	public void setStreamStatusObject(Value object)
1464 	{
1465 		// void gst_message_set_stream_status_object  (GstMessage *message,  const GValue *object);
1466 		gst_message_set_stream_status_object(gstMessage, (object is null) ? null : object.getValueStruct());
1467 	}
1468 	
1469 	/**
1470 	 * Extracts the object managing the streaming thread from message.
1471 	 * Returns: a GValue containing the object that manages the streaming thread. This object is usually of type GstTask but other types can be added in the future. The object remains valid as long as message is valid.
1472 	 */
1473 	public Value getStreamStatusObject()
1474 	{
1475 		// const GValue * gst_message_get_stream_status_object  (GstMessage *message);
1476 		auto p = gst_message_get_stream_status_object(gstMessage);
1477 		
1478 		if(p is null)
1479 		{
1480 			return null;
1481 		}
1482 		
1483 		return ObjectG.getDObject!(Value)(cast(GValue*) p);
1484 	}
1485 	
1486 	/**
1487 	 * Progress messages are posted by elements when they use an asynchronous task
1488 	 * to perform actions triggered by a state change.
1489 	 * code contains a well defined string describing the action.
1490 	 * test should contain a user visible string detailing the current action.
1491 	 * Params:
1492 	 * src = The object originating the message.
1493 	 * type = a GstProgressType
1494 	 * code = a progress code
1495 	 * text = free, user visible text describing the progress
1496 	 * Throws: ConstructionException GTK+ fails to create the object.
1497 	 */
1498 	public this (ObjectGst src, GstProgressType type, string code, string text)
1499 	{
1500 		// GstMessage * gst_message_new_progress (GstObject *src,  GstProgressType type,  const gchar *code,  const gchar *text);
1501 		auto p = gst_message_new_progress((src is null) ? null : src.getObjectGstStruct(), type, Str.toStringz(code), Str.toStringz(text));
1502 		if(p is null)
1503 		{
1504 			throw new ConstructionException("null returned by gst_message_new_progress((src is null) ? null : src.getObjectGstStruct(), type, Str.toStringz(code), Str.toStringz(text))");
1505 		}
1506 		this(cast(GstMessage*) p);
1507 	}
1508 	
1509 	/**
1510 	 * Parses the progress type, code and text.
1511 	 * Params:
1512 	 * type = location for the type. [out][allow-none]
1513 	 * code = location for the code. [out][allow-none][transfer full]
1514 	 * text = location for the text. [out][allow-none][transfer full]
1515 	 */
1516 	public void parseProgress(out GstProgressType type, out string code, out string text)
1517 	{
1518 		// void gst_message_parse_progress (GstMessage *message,  GstProgressType *type,  gchar **code,  gchar **text);
1519 		char* outcode = null;
1520 		char* outtext = null;
1521 		
1522 		gst_message_parse_progress(gstMessage, &type, &outcode, &outtext);
1523 		
1524 		code = Str.toString(outcode);
1525 		text = Str.toString(outtext);
1526 	}
1527 	
1528 	/**
1529 	 * This message is posted when an element needs a specific GstContext.
1530 	 * Since 1.2
1531 	 * Params:
1532 	 * src = The object originating the message. [transfer none]
1533 	 * contextType = The context type that is needed
1534 	 * Throws: ConstructionException GTK+ fails to create the object.
1535 	 */
1536 	public this (ObjectGst src, string contextType)
1537 	{
1538 		// GstMessage * gst_message_new_need_context (GstObject *src,  const gchar *context_type);
1539 		auto p = gst_message_new_need_context((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(contextType));
1540 		if(p is null)
1541 		{
1542 			throw new ConstructionException("null returned by gst_message_new_need_context((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(contextType))");
1543 		}
1544 		this(cast(GstMessage*) p);
1545 	}
1546 	
1547 	/**
1548 	 * Parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message.
1549 	 * Since 1.2
1550 	 * Params:
1551 	 * contextType = the context type, or NULL. [out][allow-none]
1552 	 * Returns: a gboolean indicating if the parsing succeeded.
1553 	 */
1554 	public int parseContextType(out string contextType)
1555 	{
1556 		// gboolean gst_message_parse_context_type (GstMessage *message,  const gchar **context_type);
1557 		char* outcontextType = null;
1558 		
1559 		auto p = gst_message_parse_context_type(gstMessage, &outcontextType);
1560 		
1561 		contextType = Str.toString(outcontextType);
1562 		return p;
1563 	}
1564 	
1565 	/**
1566 	 * This message is posted when an element has a new local GstContext.
1567 	 * Since 1.2
1568 	 * Params:
1569 	 * src = The object originating the message. [transfer none]
1570 	 * context = the context. [transfer full]
1571 	 * Throws: ConstructionException GTK+ fails to create the object.
1572 	 */
1573 	public this (ObjectGst src, Context context)
1574 	{
1575 		// GstMessage * gst_message_new_have_context (GstObject *src,  GstContext *context);
1576 		auto p = gst_message_new_have_context((src is null) ? null : src.getObjectGstStruct(), (context is null) ? null : context.getContextStruct());
1577 		if(p is null)
1578 		{
1579 			throw new ConstructionException("null returned by gst_message_new_have_context((src is null) ? null : src.getObjectGstStruct(), (context is null) ? null : context.getContextStruct())");
1580 		}
1581 		this(cast(GstMessage*) p);
1582 	}
1583 	
1584 	/**
1585 	 * Extract the context from the HAVE_CONTEXT message.
1586 	 * MT safe.
1587 	 * Since 1.2
1588 	 * Params:
1589 	 * context = Result location for the
1590 	 * context or NULL. [out][transfer full][allow-none]
1591 	 */
1592 	public void parseHaveContext(out Context context)
1593 	{
1594 		// void gst_message_parse_have_context (GstMessage *message,  GstContext **context);
1595 		GstContext* outcontext = null;
1596 		
1597 		gst_message_parse_have_context(gstMessage, &outcontext);
1598 		
1599 		context = ObjectG.getDObject!(Context)(outcontext);
1600 	}
1601 }