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  * 	- gst_
42  * omit structs:
43  * 	- GstMessage
44  * omit prefixes:
45  * omit code:
46  * 	- gst_message_parse_tag
47  * 	- gst_message_type_to_quark
48  * 	- gst_message_new_element
49  * 	- gst_message_new_new_clock
50  * 	- gst_message_new_segment_done
51  * 	- gst_message_new_segment_start
52  * 	- gst_message_new_warning
53  * 	- gst_message_new_state_dirty
54  * 	- gst_message_new_eos
55  * 	- gst_message_new_error
56  * 	- gst_message_new_info
57  * 	- gst_message_new_latency
58  * 	- gst_message_new_async_start
59  * omit signals:
60  * imports:
61  * 	- glib.Str
62  * 	- glib.Quark
63  * 	- gstreamer.Structure
64  * 	- gstreamer.ObjectGst
65  * 	- gstreamer.Clock
66  * 	- glib.ErrorG
67  * 	- gstreamer.TagList
68  * structWrap:
69  * 	- GError* -> ErrorG
70  * 	- GQuark -> Quark
71  * 	- GstClock* -> Clock
72  * 	- GstMessage* -> Message
73  * 	- GstObject* -> ObjectGst
74  * 	- GstStructure* -> Structure
75  * 	- GstTagList* -> TagList
76  * module aliases:
77  * local aliases:
78  * overrides:
79  */
80 
81 module gstreamer.Message;
82 
83 public  import gstreamerc.gstreamertypes;
84 
85 private import gstreamerc.gstreamer;
86 private import glib.ConstructionException;
87 private import gobject.ObjectG;
88 
89 
90 private import glib.Str;
91 private import glib.Quark;
92 private import gstreamer.Structure;
93 private import gstreamer.ObjectGst;
94 private import gstreamer.Clock;
95 private import glib.ErrorG;
96 private import gstreamer.TagList;
97 
98 
99 
100 
101 /**
102  * Description
103  * Messages are implemented as a subclass of GstMiniObject with a generic
104  * GstStructure as the content. This allows for writing custom messages without
105  * requiring an API change while allowing a wide range of different types
106  * of messages.
107  * Messages are posted by objects in the pipeline and are passed to the
108  * application using the GstBus.
109  * The basic use pattern of posting a message on a GstBus is as follows:
110  * $(DDOC_COMMENT example)
111  * A GstElement usually posts messages on the bus provided by the parent
112  * container using gst_element_post_message().
113  * Last reviewed on 2005-11-09 (0.9.4)
114  */
115 public class Message
116 {
117 	
118 	/** the main Gtk struct */
119 	protected GstMessage* gstMessage;
120 	
121 	
122 	public GstMessage* getMessageStruct()
123 	{
124 		return gstMessage;
125 	}
126 	
127 	
128 	/** the main Gtk struct as a void* */
129 	protected void* getStruct()
130 	{
131 		return cast(void*)gstMessage;
132 	}
133 	
134 	/**
135 	 * Sets our main struct and passes it to the parent class
136 	 */
137 	public this (GstMessage* gstMessage)
138 	{
139 		this.gstMessage = gstMessage;
140 	}
141 	
142 	/**
143 	 * Get the type of the message.
144 	 */
145 	public GstMessageType type()
146 	{
147 		return cast(GstMessageType)getMessageStruct().type;
148 	}
149 	
150 	/**
151 	 * Get the src (the element that originated the message) of the message.
152 	 */
153 	public ObjectGst src()
154 	{
155 		return new ObjectGst( cast(GstObject*)getMessageStruct().src );
156 	}
157 	
158 	/**
159 	 * Get the structure.
160 	 */
161 	public Structure structure()
162 	{
163 		return new Structure( getMessageStruct().structure );
164 	}
165 	
166 	/**
167 	 * Extracts the tag list from the GstMessage. The tag list returned in the
168 	 * output argument is a copy; the caller must free it when done.
169 	 * MT safe.
170 	 * Params:
171 	 *  tagList = Return location for the tag-list.
172 	 */
173 	/*public void parseTag(GstTagList** tagList)
174 	{
175 		// void gst_message_parse_tag (GstMessage *message,  GstTagList **tag_list);
176 		gst_message_parse_tag(gstMessage, tagList);
177 	}*/
178 	public TagList parseTag()
179 	{
180 		// void gst_message_parse_tag (GstMessage *message,  GstTagList **tag_list);
181 		GstTagList* tag_list_c;
182 		gst_message_parse_tag(gstMessage, &tag_list_c);
183 		return new TagList(tag_list_c);
184 	}
185 	
186 	//I'm not so sure about the following:
187 	/**
188 	 * Get the unique quark for the given message type.
189 	 * Params:
190 	 *  type = the message type
191 	 * Returns:
192 	 *  the quark associated with the message type
193 	 */
194 	public static Quark typeToQuark(GstMessageType type)
195 	{
196 		// GQuark gst_message_type_to_quark (GstMessageType type);
197 		return new Quark( cast(uint*)gst_message_type_to_quark(type) );
198 	}
199 	
200 	/**
201 	 * Create a new element-specific message. This is meant as a generic way of
202 	 * allowing one-way communication from an element to an application, for example
203 	 * "the firewire cable was unplugged". The format of the message should be
204 	 * documented in the element's documentation. The structure field can be NULL.
205 	 * MT safe.
206 	 * Params:
207 	 *  src = The object originating the message.
208 	 *  structure = The structure for the message. The message will take ownership of
209 	 *  the structure.
210 	 * Returns:
211 	 *  The new element message.
212 	 */
213 	public static Message newElement(ObjectGst src, Structure structure)
214 	{
215 		// GstMessage* gst_message_new_element (GstObject *src,  GstStructure *structure);
216 		return new Message(cast(GstMessage*)gst_message_new_element((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct()) );
217 	}
218 	
219 	/**
220 	 * Create a new clock message. This message is posted whenever the
221 	 * pipeline selectes a new clock for the pipeline.
222 	 * MT safe.
223 	 * Params:
224 	 *  src = The object originating the message.
225 	 *  clock = the new selected clock
226 	 * Returns:
227 	 *  The new new clock message.
228 	 */
229 	public static Message newNewClock(ObjectGst src, Clock clock)
230 	{
231 		// GstMessage* gst_message_new_new_clock (GstObject *src,  GstClock *clock);
232 		return new Message(cast(GstMessage*)gst_message_new_new_clock((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct()) );
233 	}
234 	
235 	/**
236 	 * Create a new segment done message. This message is posted by elements that
237 	 * finish playback of a segment as a result of a segment seek. This message
238 	 * is received by the application after all elements that posted a segment_start
239 	 * have posted the segment_done.
240 	 * MT safe.
241 	 * Params:
242 	 *  src = The object originating the message.
243 	 *  format = The format of the position being done
244 	 *  position = The position of the segment being done
245 	 * Returns:
246 	 *  The new segment done message.
247 	 */
248 	public static Message newSegmentDone(ObjectGst src, GstFormat format, long position)
249 	{
250 		// GstMessage* gst_message_new_segment_done (GstObject *src,  GstFormat format,  gint64 position);
251 		return new Message(cast(GstMessage*)gst_message_new_segment_done((src is null) ? null : src.getObjectGstStruct(), format, position) );
252 	}
253 	
254 	/**
255 	 * Create a new segment message. This message is posted by elements that
256 	 * start playback of a segment as a result of a segment seek. This message
257 	 * is not received by the application but is used for maintenance reasons in
258 	 * container elements.
259 	 * MT safe.
260 	 * Params:
261 	 *  src = The object originating the message.
262 	 *  format = The format of the position being played
263 	 *  position = The position of the segment being played
264 	 * Returns:
265 	 *  The new segment start message.
266 	 */
267 	public static Message newSegmentStart(ObjectGst src, GstFormat format, long position)
268 	{
269 		// GstMessage* gst_message_new_segment_start (GstObject *src,  GstFormat format,  gint64 position);
270 		return new Message(cast(GstMessage*)gst_message_new_segment_start((src is null) ? null : src.getObjectGstStruct(), format, position) );
271 	}
272 	
273 	/**
274 	 * Create a new warning message. The message will make copies of error and
275 	 * debug.
276 	 * MT safe.
277 	 * Params:
278 	 *  src = The object originating the message.
279 	 *  error = The GError for this message.
280 	 *  debug = A debugging string for something or other.
281 	 * Returns:
282 	 *  The new warning message.
283 	 */
284 	public static Message newWarning(ObjectGst src, ErrorG error, string dbug)
285 	{
286 		// GstMessage* gst_message_new_warning (GstObject *src,  GError *error,  gchar *debug);
287 		return new Message(cast(GstMessage*)gst_message_new_warning((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
288 	}
289 	
290 	/**
291 	 * Create a state dirty message. This message is posted whenever an element
292 	 * changed its state asynchronously and is used internally to update the
293 	 * states of container objects.
294 	 * MT safe.
295 	 * Params:
296 	 *  src = the object originating the message
297 	 * Returns:
298 	 *  The new state dirty message.
299 	 */
300 	public static Message newStateDirty(ObjectGst src)
301 	{
302 		// GstMessage* gst_message_new_state_dirty (GstObject *src);
303 		return new Message(cast(GstMessage*)gst_message_new_state_dirty((src is null) ? null : src.getObjectGstStruct()) );
304 	}
305 	
306 	/**
307 	 * Create a new eos message. This message is generated and posted in
308 	 * the sink elements of a GstBin. The bin will only forward the EOS
309 	 * message to the application if all sinks have posted an EOS message.
310 	 * MT safe.
311 	 * Params:
312 	 *  src = The object originating the message.
313 	 * Returns:
314 	 *  The new eos message.
315 	 */
316 	public static Message newEOS(ObjectGst src)
317 	{
318 		// GstMessage* gst_message_new_eos (GstObject *src);
319 		return new Message(cast(GstMessage*)gst_message_new_eos((src is null) ? null : src.getObjectGstStruct()) );
320 	}
321 	
322 	/**
323 	 * Create a new error message. The message will copy error and
324 	 * debug. This message is posted by element when a fatal event
325 	 * occured. The pipeline will probably (partially) stop. The application
326 	 * receiving this message should stop the pipeline.
327 	 * MT safe.
328 	 * Params:
329 	 *  src = The object originating the message.
330 	 *  error = The GError for this message.
331 	 *  debug = A debugging string for something or other.
332 	 * Returns:
333 	 *  The new error message.
334 	 */
335 	public static Message newError(ObjectGst src, ErrorG error, string dbug)
336 	{
337 		// GstMessage* gst_message_new_error (GstObject *src,  GError *error,  gchar *debug);
338 		return new Message(cast(GstMessage*)gst_message_new_error((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
339 	}
340 	
341 	/**
342 	 * Create a new info message. The message will make copies of error and
343 	 * debug.
344 	 * MT safe.
345 	 * Since 0.10.12
346 	 * Params:
347 	 *  src = The object originating the message.
348 	 *  error = The GError for this message.
349 	 *  debug = A debugging string for something or other.
350 	 * Returns:
351 	 *  The new info message.
352 	 */
353 	public static Message newInfo(ObjectGst src, ErrorG error, string dbug)
354 	{
355 		// GstMessage* gst_message_new_info (GstObject *src,  GError *error,  gchar *debug);
356 		return new Message(cast(GstMessage*)gst_message_new_info((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
357 	}
358 	
359 	/**
360 	 * This message can be posted by elements when their latency requirements
361 	 * have changed.
362 	 * Params:
363 	 *     src = The object originating the message.
364 	 * Returns:
365 	 * The new latency message. MT safe.
366 	 */
367 	public static Message newLatency(ObjectGst src)
368 	{
369 		// GstMessage* gst_message_new_latency (GstObject *src);
370 		return new Message(cast(GstMessage*)gst_message_new_latency((src is null) ? null : src.getObjectGstStruct()) );
371 	}
372 	
373 	/**
374 	 * This message is posted by elements when they start an ASYNC state change.
375 	 * new_base_time is set to TRUE when the element lost its state when it was
376 	 * PLAYING.
377 	 * Params:
378 	 * src = The object originating the message.
379 	 * newBaseTime = if a new base_time should be set on the element
380 	 * Throws: ConstructionException GTK+ fails to create the object.
381 	 */
382 	public static Message newAsyncStart(ObjectGst src, int newBaseTime)
383 	{
384 		// GstMessage* gst_message_new_async_start (GstObject *src,  gboolean new_base_time);
385 		return new Message(cast(GstMessage*)gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct(), newBaseTime));
386 	}
387 	
388 	/**
389 	 */
390 	
391 	/**
392 	 * Get a printable name for the given message type. Do not modify or free.
393 	 * Params:
394 	 * type = the message type
395 	 * Returns: a reference to the static name of the message.
396 	 */
397 	public static string typeGetName(GstMessageType type)
398 	{
399 		// const gchar* gst_message_type_get_name (GstMessageType type);
400 		return Str.toString(gst_message_type_get_name(type));
401 	}
402 	
403 	/**
404 	 * Access the structure of the message.
405 	 * 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.
406 	 */
407 	public Structure getStructure()
408 	{
409 		// const GstStructure* gst_message_get_structure (GstMessage *message);
410 		auto p = gst_message_get_structure(gstMessage);
411 		
412 		if(p is null)
413 		{
414 			return null;
415 		}
416 		
417 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
418 	}
419 	
420 	/**
421 	 * Create a new application-typed message. GStreamer will never create these
422 	 * messages; they are a gift from us to you. Enjoy.
423 	 * Params:
424 	 * src = The object originating the message.
425 	 * structure = The structure for the message. The message will take ownership of
426 	 * the structure.
427 	 * Throws: ConstructionException GTK+ fails to create the object.
428 	 */
429 	public this (ObjectGst src, Structure structure)
430 	{
431 		// GstMessage* gst_message_new_application (GstObject *src,  GstStructure *structure);
432 		auto p = gst_message_new_application((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct());
433 		if(p is null)
434 		{
435 			throw new ConstructionException("null returned by gst_message_new_application((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct())");
436 		}
437 		this(cast(GstMessage*) p);
438 	}
439 	
440 	/**
441 	 * Create a clock provide message. This message is posted whenever an
442 	 * element is ready to provide a clock or lost its ability to provide
443 	 * a clock (maybe because it paused or became EOS).
444 	 * This message is mainly used internally to manage the clock
445 	 * selection.
446 	 * Params:
447 	 * src = The object originating the message.
448 	 * clock = The clock it provides
449 	 * ready = TRUE if the sender can provide a clock
450 	 * Throws: ConstructionException GTK+ fails to create the object.
451 	 */
452 	public this (ObjectGst src, Clock clock, int ready)
453 	{
454 		// GstMessage* gst_message_new_clock_provide (GstObject *src,  GstClock *clock,  gboolean ready);
455 		auto p = gst_message_new_clock_provide((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct(), ready);
456 		if(p is null)
457 		{
458 			throw new ConstructionException("null returned by gst_message_new_clock_provide((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct(), ready)");
459 		}
460 		this(cast(GstMessage*) p);
461 	}
462 	
463 	/**
464 	 * Create a clock lost message. This message is posted whenever the
465 	 * clock is not valid anymore.
466 	 * If this message is posted by the pipeline, the pipeline will
467 	 * select a new clock again when it goes to PLAYING. It might therefore
468 	 * be needed to set the pipeline to PAUSED and PLAYING again.
469 	 * Params:
470 	 * src = The object originating the message.
471 	 * clock = the clock that was lost
472 	 * Throws: ConstructionException GTK+ fails to create the object.
473 	 */
474 	public this (ObjectGst src, Clock clock)
475 	{
476 		// GstMessage* gst_message_new_clock_lost (GstObject *src,  GstClock *clock);
477 		auto p = gst_message_new_clock_lost((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct());
478 		if(p is null)
479 		{
480 			throw new ConstructionException("null returned by gst_message_new_clock_lost((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct())");
481 		}
482 		this(cast(GstMessage*) p);
483 	}
484 	
485 	/**
486 	 * Create a new custom-typed message. This can be used for anything not
487 	 * handled by other message-specific functions to pass a message to the
488 	 * app. The structure field can be NULL.
489 	 * Params:
490 	 * type = The GstMessageType to distinguish messages
491 	 * src = The object originating the message.
492 	 * structure = The structure for the message. The message will take ownership of
493 	 * the structure.
494 	 * Throws: ConstructionException GTK+ fails to create the object.
495 	 */
496 	public this (GstMessageType type, ObjectGst src, Structure structure)
497 	{
498 		// GstMessage* gst_message_new_custom (GstMessageType type,  GstObject *src,  GstStructure *structure);
499 		auto p = gst_message_new_custom(type, (src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct());
500 		if(p is null)
501 		{
502 			throw new ConstructionException("null returned by gst_message_new_custom(type, (src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct())");
503 		}
504 		this(cast(GstMessage*) p);
505 	}
506 	
507 	/**
508 	 * Create a state change message. This message is posted whenever an element
509 	 * changed its state.
510 	 * Params:
511 	 * src = the object originating the message
512 	 * oldstate = the previous state
513 	 * newstate = the new (current) state
514 	 * pending = the pending (target) state
515 	 * Throws: ConstructionException GTK+ fails to create the object.
516 	 */
517 	public this (ObjectGst src, GstState oldstate, GstState newstate, GstState pending)
518 	{
519 		// GstMessage* gst_message_new_state_changed (GstObject *src,  GstState oldstate,  GstState newstate,  GstState pending);
520 		auto p = gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending);
521 		if(p is null)
522 		{
523 			throw new ConstructionException("null returned by gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending)");
524 		}
525 		this(cast(GstMessage*) p);
526 	}
527 	
528 	/**
529 	 * Create a new tag message. The message will take ownership of the tag list.
530 	 * The message is posted by elements that discovered a new taglist.
531 	 * Params:
532 	 * src = The object originating the message.
533 	 * tagList = The tag list for the message.
534 	 * Throws: ConstructionException GTK+ fails to create the object.
535 	 */
536 	public this (ObjectGst src, TagList tagList)
537 	{
538 		// GstMessage* gst_message_new_tag (GstObject *src,  GstTagList *tag_list);
539 		auto p = gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct());
540 		if(p is null)
541 		{
542 			throw new ConstructionException("null returned by gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct())");
543 		}
544 		this(cast(GstMessage*) p);
545 	}
546 	
547 	/**
548 	 * Create a new buffering message. This message can be posted by an element that
549 	 * needs to buffer data before it can continue processing. percent should be a
550 	 * value between 0 and 100. A value of 100 means that the buffering completed.
551 	 * When percent is < 100 the application should PAUSE a PLAYING pipeline. When
552 	 * percent is 100, the application can set the pipeline (back) to PLAYING.
553 	 * The application must be prepared to receive BUFFERING messages in the
554 	 * PREROLLING state and may only set the pipeline to PLAYING after receiving a
555 	 * message with percent set to 100, which can happen after the pipeline
556 	 * completed prerolling.
557 	 * Params:
558 	 * src = The object originating the message.
559 	 * percent = The buffering percent
560 	 * Throws: ConstructionException GTK+ fails to create the object.
561 	 */
562 	public this (ObjectGst src, int percent)
563 	{
564 		// GstMessage* gst_message_new_buffering (GstObject *src,  gint percent);
565 		auto p = gst_message_new_buffering((src is null) ? null : src.getObjectGstStruct(), percent);
566 		if(p is null)
567 		{
568 			throw new ConstructionException("null returned by gst_message_new_buffering((src is null) ? null : src.getObjectGstStruct(), percent)");
569 		}
570 		this(cast(GstMessage*) p);
571 	}
572 	
573 	/**
574 	 * Create a new duration message. This message is posted by elements that
575 	 * know the duration of a stream in a specific format. This message
576 	 * is received by bins and is used to calculate the total duration of a
577 	 * pipeline. Elements may post a duration message with a duration of
578 	 * GST_CLOCK_TIME_NONE to indicate that the duration has changed and the
579 	 * cached duration should be discarded. The new duration can then be
580 	 * retrieved via a query.
581 	 * Params:
582 	 * src = The object originating the message.
583 	 * format = The format of the duration
584 	 * duration = The new duration
585 	 * Throws: ConstructionException GTK+ fails to create the object.
586 	 */
587 	public this (ObjectGst src, GstFormat format, long duration)
588 	{
589 		// GstMessage* gst_message_new_duration (GstObject *src,  GstFormat format,  gint64 duration);
590 		auto p = gst_message_new_duration((src is null) ? null : src.getObjectGstStruct(), format, duration);
591 		if(p is null)
592 		{
593 			throw new ConstructionException("null returned by gst_message_new_duration((src is null) ? null : src.getObjectGstStruct(), format, duration)");
594 		}
595 		this(cast(GstMessage*) p);
596 	}
597 	
598 	/**
599 	 * The message is posted when elements completed an ASYNC state change.
600 	 * Params:
601 	 * src = The object originating the message.
602 	 * Throws: ConstructionException GTK+ fails to create the object.
603 	 */
604 	public this (ObjectGst src)
605 	{
606 		// GstMessage* gst_message_new_async_done (GstObject *src);
607 		auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct());
608 		if(p is null)
609 		{
610 			throw new ConstructionException("null returned by gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct())");
611 		}
612 		this(cast(GstMessage*) p);
613 	}
614 	
615 	/**
616 	 * Extracts the lost clock from the GstMessage.
617 	 * The clock object returned remains valid until the message is freed.
618 	 * MT safe.
619 	 * Params:
620 	 * clock = A pointer to hold the lost clock
621 	 */
622 	public void parseClockLost(out Clock clock)
623 	{
624 		// void gst_message_parse_clock_lost (GstMessage *message,  GstClock **clock);
625 		GstClock* outclock = null;
626 		
627 		gst_message_parse_clock_lost(gstMessage, &outclock);
628 		
629 		clock = ObjectG.getDObject!(Clock)(outclock);
630 	}
631 	
632 	/**
633 	 * Extracts the clock and ready flag from the GstMessage.
634 	 * The clock object returned remains valid until the message is freed.
635 	 * MT safe.
636 	 * Params:
637 	 * clock = A pointer to hold a clock object.
638 	 * ready = A pointer to hold the ready flag.
639 	 */
640 	public void parseClockProvide(out Clock clock, out int ready)
641 	{
642 		// void gst_message_parse_clock_provide (GstMessage *message,  GstClock **clock,  gboolean *ready);
643 		GstClock* outclock = null;
644 		
645 		gst_message_parse_clock_provide(gstMessage, &outclock, &ready);
646 		
647 		clock = ObjectG.getDObject!(Clock)(outclock);
648 	}
649 	
650 	/**
651 	 * Extracts the GError and debug string from the GstMessage. The values returned
652 	 * in the output arguments are copies; the caller must free them when done.
653 	 * MT safe.
654 	 * Params:
655 	 * gerror = Location for the GError
656 	 * dbug = Location for the debug message, or NULL
657 	 */
658 	public void parseError(out ErrorG gerror, out string dbug)
659 	{
660 		// void gst_message_parse_error (GstMessage *message,  GError **gerror,  gchar **debug);
661 		GError* outgerror = null;
662 		char* outdbug = null;
663 		
664 		gst_message_parse_error(gstMessage, &outgerror, &outdbug);
665 		
666 		gerror = ObjectG.getDObject!(ErrorG)(outgerror);
667 		dbug = Str.toString(outdbug);
668 	}
669 	
670 	/**
671 	 * Extracts the GError and debug string from the GstMessage. The values returned
672 	 * in the output arguments are copies; the caller must free them when done.
673 	 * MT safe.
674 	 * Params:
675 	 * gerror = Location for the GError
676 	 * dbug = Location for the debug message, or NULL
677 	 * Since 0.10.12
678 	 */
679 	public void parseInfo(out ErrorG gerror, out string dbug)
680 	{
681 		// void gst_message_parse_info (GstMessage *message,  GError **gerror,  gchar **debug);
682 		GError* outgerror = null;
683 		char* outdbug = null;
684 		
685 		gst_message_parse_info(gstMessage, &outgerror, &outdbug);
686 		
687 		gerror = ObjectG.getDObject!(ErrorG)(outgerror);
688 		dbug = Str.toString(outdbug);
689 	}
690 	
691 	/**
692 	 * Extracts the new clock from the GstMessage.
693 	 * The clock object returned remains valid until the message is freed.
694 	 * MT safe.
695 	 * Params:
696 	 * clock = A pointer to hold the selected new clock
697 	 */
698 	public void parseNewClock(out Clock clock)
699 	{
700 		// void gst_message_parse_new_clock (GstMessage *message,  GstClock **clock);
701 		GstClock* outclock = null;
702 		
703 		gst_message_parse_new_clock(gstMessage, &outclock);
704 		
705 		clock = ObjectG.getDObject!(Clock)(outclock);
706 	}
707 	
708 	/**
709 	 * Extracts the position and format from the segment start message.
710 	 * MT safe.
711 	 * Params:
712 	 * format = Result location for the format, or NULL
713 	 * position = Result location for the position, or NULL
714 	 */
715 	public void parseSegmentDone(out GstFormat format, out long position)
716 	{
717 		// void gst_message_parse_segment_done (GstMessage *message,  GstFormat *format,  gint64 *position);
718 		gst_message_parse_segment_done(gstMessage, &format, &position);
719 	}
720 	
721 	/**
722 	 * Extracts the position and format from the segment start message.
723 	 * MT safe.
724 	 * Params:
725 	 * format = Result location for the format, or NULL
726 	 * position = Result location for the position, or NULL
727 	 */
728 	public void parseSegmentStart(out GstFormat format, out long position)
729 	{
730 		// void gst_message_parse_segment_start (GstMessage *message,  GstFormat *format,  gint64 *position);
731 		gst_message_parse_segment_start(gstMessage, &format, &position);
732 	}
733 	
734 	/**
735 	 * Extracts the old and new states from the GstMessage.
736 	 * MT safe.
737 	 * Params:
738 	 * oldstate = the previous state, or NULL
739 	 * newstate = the new (current) state, or NULL
740 	 * pending = the pending (target) state, or NULL
741 	 */
742 	public void parseStateChanged(GstState* oldstate, GstState* newstate, GstState* pending)
743 	{
744 		// void gst_message_parse_state_changed (GstMessage *message,  GstState *oldstate,  GstState *newstate,  GstState *pending);
745 		gst_message_parse_state_changed(gstMessage, oldstate, newstate, pending);
746 	}
747 	
748 	/**
749 	 * Extracts the buffering percent from the GstMessage. see also
750 	 * gst_message_new_buffering().
751 	 * Params:
752 	 * percent = Return location for the percent.
753 	 * Since 0.10.11
754 	 * MT safe.
755 	 */
756 	public void parseBuffering(out int percent)
757 	{
758 		// void gst_message_parse_buffering (GstMessage *message,  gint *percent);
759 		gst_message_parse_buffering(gstMessage, &percent);
760 	}
761 	
762 	/**
763 	 * Extracts the GError and debug string from the GstMessage. The values returned
764 	 * in the output arguments are copies; the caller must free them when done.
765 	 * MT safe.
766 	 * Params:
767 	 * gerror = Location for the GError
768 	 * dbug = Location for the debug message, or NULL
769 	 */
770 	public void parseWarning(out ErrorG gerror, out string dbug)
771 	{
772 		// void gst_message_parse_warning (GstMessage *message,  GError **gerror,  gchar **debug);
773 		GError* outgerror = null;
774 		char* outdbug = null;
775 		
776 		gst_message_parse_warning(gstMessage, &outgerror, &outdbug);
777 		
778 		gerror = ObjectG.getDObject!(ErrorG)(outgerror);
779 		dbug = Str.toString(outdbug);
780 	}
781 	
782 	/**
783 	 * Extracts the duration and format from the duration message. The duration
784 	 * might be GST_CLOCK_TIME_NONE, which indicates that the duration has
785 	 * changed. Applications should always use a query to retrieve the duration
786 	 * of a pipeline.
787 	 * MT safe.
788 	 * Params:
789 	 * format = Result location for the format, or NULL
790 	 * duration = Result location for the duration, or NULL
791 	 */
792 	public void parseDuration(out GstFormat format, out long duration)
793 	{
794 		// void gst_message_parse_duration (GstMessage *message,  GstFormat *format,  gint64 *duration);
795 		gst_message_parse_duration(gstMessage, &format, &duration);
796 	}
797 	
798 	/**
799 	 * Extract the new_base_time from the async_start message.
800 	 * MT safe.
801 	 * Params:
802 	 * newBaseTime = Result location for the new_base_time or NULL
803 	 * Since 0.10.13
804 	 */
805 	public void parseAsyncStart(out int newBaseTime)
806 	{
807 		// void gst_message_parse_async_start (GstMessage *message,  gboolean *new_base_time);
808 		gst_message_parse_async_start(gstMessage, &newBaseTime);
809 	}
810 	
811 	/**
812 	 * Convenience macro to increase the reference count of the message.
813 	 * Returns: msg (for convenience when doing assignments)
814 	 */
815 	public Message doref()
816 	{
817 		// GstMessage* gst_message_ref (GstMessage *msg);
818 		auto p = gst_message_ref(gstMessage);
819 		
820 		if(p is null)
821 		{
822 			return null;
823 		}
824 		
825 		return ObjectG.getDObject!(Message)(cast(GstMessage*) p);
826 	}
827 }