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-GstQuery.html
27  * outPack = gstreamer
28  * outFile = Query
29  * strct   = GstQuery
30  * realStrct=
31  * ctorStrct=
32  * clss    = Query
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gst_query_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * 	- gst_query_new_position
45  * 	- gst_query_new_duration
46  * 	- gst_query_new_seeking
47  * 	- gst_query_new_formats
48  * 	- gst_query_new_segment
49  * 	- gst_query_new_latency
50  * 	- gst_query_new_uri
51  * 	- gst_query_new_scheduling
52  * 	- gst_query_new_drain
53  * 	- gst_query_new_accept_caps
54  * omit signals:
55  * imports:
56  * 	- glib.Str
57  * 	- gstreamer.Allocator
58  * 	- gstreamer.BufferPool
59  * 	- gstreamer.Caps
60  * 	- gstreamer.Context
61  * 	- gstreamer.Structure
62  * structWrap:
63  * 	- GstAllocator* -> Allocator
64  * 	- GstBufferPool* -> BufferPool
65  * 	- GstCaps* -> Caps
66  * 	- GstContext* -> Context
67  * 	- GstQuery* -> Query
68  * 	- GstStructure* -> Structure
69  * module aliases:
70  * local aliases:
71  * overrides:
72  */
73 
74 module gstreamer.Query;
75 
76 public  import gstreamerc.gstreamertypes;
77 
78 private import gstreamerc.gstreamer;
79 private import glib.ConstructionException;
80 private import gobject.ObjectG;
81 
82 
83 private import glib.Str;
84 private import gstreamer.Allocator;
85 private import gstreamer.BufferPool;
86 private import gstreamer.Caps;
87 private import gstreamer.Context;
88 private import gstreamer.Structure;
89 
90 
91 
92 
93 /**
94  * Queries can be performed on pads (gst_pad_query()) and elements
95  * (gst_element_query()). Please note that some queries might need a running
96  * pipeline to work.
97  *
98  * Queries can be created using the gst_query_new_*() functions.
99  * Query values can be set using gst_query_set_*(), and parsed using
100  * gst_query_parse_*() helpers.
101  *
102  * The following example shows how to query the duration of a pipeline:
103  *
104  * $(DDOC_COMMENT example)
105  *
106  * Last reviewed on 2012-03-29 (0.11.3)
107  */
108 public class Query
109 {
110 	
111 	/** the main Gtk struct */
112 	protected GstQuery* gstQuery;
113 	
114 	
115 	public GstQuery* getQueryStruct()
116 	{
117 		return gstQuery;
118 	}
119 	
120 	
121 	/** the main Gtk struct as a void* */
122 	protected void* getStruct()
123 	{
124 		return cast(void*)gstQuery;
125 	}
126 	
127 	/**
128 	 * Sets our main struct and passes it to the parent class
129 	 */
130 	public this (GstQuery* gstQuery)
131 	{
132 		this.gstQuery = gstQuery;
133 	}
134 	
135 	/**
136 	 * Constructs a new query stream position query object. Use gst_query_unref()
137 	 * when done with it. A position query is used to query the current position
138 	 * of playback in the streams, in some format.
139 	 * Params:
140 	 *  format = the default GstFormat for the new query
141 	 * Returns:
142 	 *  A GstQuery
143 	 */
144 	public static Query newPosition(GstFormat format)
145 	{
146 		// GstQuery* gst_query_new_position (GstFormat format);
147 		auto p = gst_query_new_position(format);
148 		
149 		if(p is null)
150 		{
151 			throw new ConstructionException("null returned by gst_query_new_position");
152 		}
153 		
154 		return new Query( cast(GstQuery*)p );
155 	}	/**
156 	 * Constructs a new stream duration query object to query in the given format.
157 	 * Use gst_query_unref() when done with it. A duration query will give the
158 	 * total length of the stream.
159 	 * Params:
160 	 *  format = the GstFormat for this duration query
161 	 * Returns:
162 	 *  A GstQuery
163 	 */
164 	public static Query newDuration(GstFormat format)
165 	{
166 		// GstQuery* gst_query_new_duration (GstFormat format);
167 		auto p = gst_query_new_duration(format);
168 		
169 		if(p is null)
170 		{
171 			throw new ConstructionException("null returned by gst_query_new_duration");
172 		}
173 		
174 		return new Query( cast(GstQuery*)p );
175 	}	/**
176 	 * Constructs a new query object for querying seeking properties of
177 	 * the stream.
178 	 * Params:
179 	 *  format = the default GstFormat for the new query
180 	 * Returns:
181 	 *  A GstQuery
182 	 */
183 	public static Query newSeeking(GstFormat format)
184 	{
185 		// GstQuery* gst_query_new_seeking (GstFormat format);
186 		auto p = gst_query_new_seeking(format);
187 		
188 		if(p is null)
189 		{
190 			throw new ConstructionException("null returned by gst_query_new_seeking");
191 		}
192 		
193 		return new Query(cast(GstQuery*)p );
194 	}	/**
195 	 * Constructs a new query object for querying formats of
196 	 * the stream.
197 	 * Since 0.10.4
198 	 * Returns:
199 	 *  A GstQuery
200 	 */
201 	public static Query newFormats()
202 	{
203 		// GstQuery* gst_query_new_formats (void);
204 		auto p = gst_query_new_formats();
205 		
206 		if(p is null)
207 		{
208 			throw new ConstructionException("null returned by gst_query_new_formats");
209 		}
210 		
211 		return new Query(cast(GstQuery*)p );
212 	}	/**
213 	 * Constructs a new segment query object. Use gst_query_unref()
214 	 * when done with it. A segment query is used to discover information about the
215 	 * currently configured segment for playback.
216 	 * Params:
217 	 *  format = the GstFormat for the new query
218 	 * Returns:
219 	 *  a GstQuery
220 	 */
221 	public static Query newSegment(GstFormat format)
222 	{
223 		// GstQuery* gst_query_new_segment (GstFormat format);
224 		auto p = gst_query_new_segment(format);
225 		
226 		if(p is null)
227 		{
228 			throw new ConstructionException("null returned by gst_query_new_segment");
229 		}
230 		
231 		return new Query(cast(GstQuery*)p );
232 	}	/**
233 	 * Constructs a new latency query object.
234 	 * Use gst_query_unref() when done with it. A latency query is usually performed
235 	 * by sinks to compensate for additional latency introduced by elements in the
236 	 * pipeline.
237 	 * Free-function: gst_query_unref
238 	 */
239 	public static Query newLatency()
240 	{
241 		// GstQuery * gst_query_new_latency (void);
242 		auto p = gst_query_new_latency();
243 		if(p is null)
244 		{
245 			throw new ConstructionException("null returned by gst_query_new_latency()");
246 		}
247 		return new Query(cast(GstQuery*)p );
248 	}	/**
249 	 * Constructs a new query URI query object. Use gst_query_unref()
250 	 * when done with it. An URI query is used to query the current URI
251 	 * that is used by the source or sink.
252 	 * Free-function: gst_query_unref
253 	 * Throws: ConstructionException GTK+ fails to create the object.
254 	 */
255 	public static Query newUri()
256 	{
257 		// GstQuery * gst_query_new_uri (void);
258 		auto p = gst_query_new_uri();
259 		if(p is null)
260 		{
261 			throw new ConstructionException("null returned by gst_query_new_uri()");
262 		}
263 		return new Query(cast(GstQuery*)p );
264 	}	/**
265 	 * Constructs a new query object for querying the scheduling properties.
266 	 * Free-function: gst_query_unref
267 	 * Throws: ConstructionException GTK+ fails to create the object.
268 	 */
269 	public static Query newScheduling()
270 	{
271 		// GstQuery * gst_query_new_scheduling (void);
272 		auto p = gst_query_new_scheduling();
273 		if(p is null)
274 		{
275 			throw new ConstructionException("null returned by gst_query_new_scheduling()");
276 		}
277 		return new Query(cast(GstQuery*)p );
278 	}	/**
279 	 * Constructs a new query object for querying the drain state.
280 	 * Free-function: gst_query_unref
281 	 * Throws: ConstructionException GTK+ fails to create the object.
282 	 */
283 	public static Query newDrain()
284 	{
285 		// GstQuery * gst_query_new_drain (void);
286 		auto p = gst_query_new_drain();
287 		if(p is null)
288 		{
289 			throw new ConstructionException("null returned by gst_query_new_drain()");
290 		}
291 		return new Query(cast(GstQuery*)p );
292 	}	/**
293 	 * Constructs a new query object for querying if caps are accepted.
294 	 * Free-function: gst_query_unref
295 	 * Params:
296 	 * caps = a fixed GstCaps
297 	 * Throws: ConstructionException GTK+ fails to create the object.
298 	 */
299 	public static Query newAcceptCaps(Caps caps)
300 	{
301 		// GstQuery * gst_query_new_accept_caps (GstCaps *caps);
302 		auto p = gst_query_new_accept_caps((caps is null) ? null : caps.getCapsStruct());
303 		if(p is null)
304 		{
305 			throw new ConstructionException("null returned by gst_query_new_accept_caps((caps is null) ? null : caps.getCapsStruct())");
306 		}
307 		return new Query(cast(GstQuery*)p );
308 	}
309 	
310 	/**
311 	 */
312 	
313 	/**
314 	 * Gets the GstQueryTypeFlags associated with type.
315 	 * Params:
316 	 * type = a GstQueryType
317 	 * Returns: a GstQueryTypeFlags.
318 	 */
319 	public static GstQueryTypeFlags typeGetFlags(GstQueryType type)
320 	{
321 		// GstQueryTypeFlags gst_query_type_get_flags (GstQueryType type);
322 		return gst_query_type_get_flags(type);
323 	}
324 	
325 	/**
326 	 * Get a printable name for the given query type. Do not modify or free.
327 	 * Params:
328 	 * type = the query type
329 	 * Returns: a reference to the static name of the query.
330 	 */
331 	public static string typeGetName(GstQueryType type)
332 	{
333 		// const gchar * gst_query_type_get_name (GstQueryType type);
334 		return Str.toString(gst_query_type_get_name(type));
335 	}
336 	
337 	/**
338 	 * Get the unique quark for the given query type.
339 	 * Params:
340 	 * type = the query type
341 	 * Returns: the quark associated with the query type
342 	 */
343 	public static GQuark typeToQuark(GstQueryType type)
344 	{
345 		// GQuark gst_query_type_to_quark (GstQueryType type);
346 		return gst_query_type_to_quark(type);
347 	}
348 	
349 	/**
350 	 * Increases the refcount of the given query by one.
351 	 * Returns: q
352 	 */
353 	public Query doref()
354 	{
355 		// GstQuery * gst_query_ref (GstQuery *q);
356 		auto p = gst_query_ref(gstQuery);
357 		
358 		if(p is null)
359 		{
360 			return null;
361 		}
362 		
363 		return ObjectG.getDObject!(Query)(cast(GstQuery*) p);
364 	}
365 	
366 	/**
367 	 * Decreases the refcount of the query. If the refcount reaches 0, the query
368 	 * will be freed.
369 	 */
370 	public void unref()
371 	{
372 		// void gst_query_unref (GstQuery *q);
373 		gst_query_unref(gstQuery);
374 	}
375 	
376 	/**
377 	 * Copies the given query using the copy function of the parent GstStructure.
378 	 * Free-function: gst_query_unref
379 	 * Returns: a new copy of q. [transfer full]
380 	 */
381 	public Query copy()
382 	{
383 		// GstQuery * gst_query_copy (const GstQuery *q);
384 		auto p = gst_query_copy(gstQuery);
385 		
386 		if(p is null)
387 		{
388 			return null;
389 		}
390 		
391 		return ObjectG.getDObject!(Query)(cast(GstQuery*) p);
392 	}
393 	
394 	/**
395 	 * Modifies a pointer to a GstQuery to point to a different GstQuery. The
396 	 * modification is done atomically (so this is useful for ensuring thread safety
397 	 * in some cases), and the reference counts are updated appropriately (the old
398 	 * query is unreffed, the new one is reffed).
399 	 * Either new_query or the GstQuery pointed to by old_query may be NULL.
400 	 * Params:
401 	 * oldQuery = pointer to a pointer to a GstQuery
402 	 * to be replaced. [inout][transfer full]
403 	 * newQuery = pointer to a GstQuery that will
404 	 * replace the query pointed to by old_query. [allow-none][transfer none]
405 	 * Returns: TRUE if new_query was different from old_query
406 	 */
407 	public static int replace(ref Query oldQuery, Query newQuery)
408 	{
409 		// gboolean gst_query_replace (GstQuery **old_query,  GstQuery *new_query);
410 		GstQuery* outoldQuery = (oldQuery is null) ? null : oldQuery.getQueryStruct();
411 		
412 		auto p = gst_query_replace(&outoldQuery, (newQuery is null) ? null : newQuery.getQueryStruct());
413 		
414 		oldQuery = ObjectG.getDObject!(Query)(outoldQuery);
415 		return p;
416 	}
417 	
418 	/**
419 	 * Get the structure of a query. This method should be called with a writable
420 	 * query so that the returned structure is guranteed to be writable.
421 	 * Returns: the GstStructure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed. [transfer none]
422 	 */
423 	public Structure writableStructure()
424 	{
425 		// GstStructure * gst_query_writable_structure (GstQuery *query);
426 		auto p = gst_query_writable_structure(gstQuery);
427 		
428 		if(p is null)
429 		{
430 			return null;
431 		}
432 		
433 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
434 	}
435 	
436 	/**
437 	 * Constructs a new custom query object. Use gst_query_unref()
438 	 * when done with it.
439 	 * Free-function: gst_query_unref
440 	 * Params:
441 	 * type = the query type
442 	 * structure = a structure for the query
443 	 * Throws: ConstructionException GTK+ fails to create the object.
444 	 */
445 	public this (GstQueryType type, Structure structure)
446 	{
447 		// GstQuery * gst_query_new_custom (GstQueryType type,  GstStructure *structure);
448 		auto p = gst_query_new_custom(type, (structure is null) ? null : structure.getStructureStruct());
449 		if(p is null)
450 		{
451 			throw new ConstructionException("null returned by gst_query_new_custom(type, (structure is null) ? null : structure.getStructureStruct())");
452 		}
453 		this(cast(GstQuery*) p);
454 	}
455 	
456 	/**
457 	 * Get the structure of a query.
458 	 * Returns: the GstStructure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed. [transfer none]
459 	 */
460 	public Structure getStructure()
461 	{
462 		// const GstStructure * gst_query_get_structure (GstQuery *query);
463 		auto p = gst_query_get_structure(gstQuery);
464 		
465 		if(p is null)
466 		{
467 			return null;
468 		}
469 		
470 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
471 	}
472 	
473 	/**
474 	 * Constructs a new convert query object. Use gst_query_unref()
475 	 * when done with it. A convert query is used to ask for a conversion between
476 	 * one format and another.
477 	 * Free-function: gst_query_unref
478 	 * Params:
479 	 * srcFormat = the source GstFormat for the new query
480 	 * value = the value to convert
481 	 * destFormat = the target GstFormat
482 	 * Throws: ConstructionException GTK+ fails to create the object.
483 	 */
484 	public this (GstFormat srcFormat, long value, GstFormat destFormat)
485 	{
486 		// GstQuery * gst_query_new_convert (GstFormat src_format,  gint64 value,  GstFormat dest_format);
487 		auto p = gst_query_new_convert(srcFormat, value, destFormat);
488 		if(p is null)
489 		{
490 			throw new ConstructionException("null returned by gst_query_new_convert(srcFormat, value, destFormat)");
491 		}
492 		this(cast(GstQuery*) p);
493 	}
494 	
495 	/**
496 	 * Answer a convert query by setting the requested values.
497 	 * Params:
498 	 * srcFormat = the source GstFormat
499 	 * srcValue = the source value
500 	 * destFormat = the destination GstFormat
501 	 * destValue = the destination value
502 	 */
503 	public void setConvert(GstFormat srcFormat, long srcValue, GstFormat destFormat, long destValue)
504 	{
505 		// void gst_query_set_convert (GstQuery *query,  GstFormat src_format,  gint64 src_value,  GstFormat dest_format,  gint64 dest_value);
506 		gst_query_set_convert(gstQuery, srcFormat, srcValue, destFormat, destValue);
507 	}
508 	
509 	/**
510 	 * Parse a convert query answer. Any of src_format, src_value, dest_format,
511 	 * and dest_value may be NULL, in which case that value is omitted.
512 	 * Params:
513 	 * srcFormat = the storage for the GstFormat of the
514 	 * source value, or NULL. [out][allow-none]
515 	 * srcValue = the storage for the source value, or NULL. [out][allow-none]
516 	 * destFormat = the storage for the GstFormat of the
517 	 * destination value, or NULL. [out][allow-none]
518 	 * destValue = the storage for the destination value,
519 	 * or NULL. [out][allow-none]
520 	 */
521 	public void parseConvert(ref GstFormat srcFormat, ref long srcValue, ref GstFormat destFormat, ref long destValue)
522 	{
523 		// void gst_query_parse_convert (GstQuery *query,  GstFormat *src_format,  gint64 *src_value,  GstFormat *dest_format,  gint64 *dest_value);
524 		gst_query_parse_convert(gstQuery, &srcFormat, &srcValue, &destFormat, &destValue);
525 	}
526 	
527 	/**
528 	 * Answer a position query by setting the requested value in the given format.
529 	 * Params:
530 	 * format = the requested GstFormat
531 	 * cur = the position to set
532 	 */
533 	public void setPosition(GstFormat format, long cur)
534 	{
535 		// void gst_query_set_position (GstQuery *query,  GstFormat format,  gint64 cur);
536 		gst_query_set_position(gstQuery, format, cur);
537 	}
538 	
539 	/**
540 	 * Parse a position query, writing the format into format, and the position
541 	 * into cur, if the respective parameters are non-NULL.
542 	 * Params:
543 	 * format = the storage for the GstFormat of the
544 	 * position values (may be NULL). [out][allow-none]
545 	 * cur = the storage for the current position (may be NULL). [out][allow-none]
546 	 */
547 	public void parsePosition(ref GstFormat format, ref long cur)
548 	{
549 		// void gst_query_parse_position (GstQuery *query,  GstFormat *format,  gint64 *cur);
550 		gst_query_parse_position(gstQuery, &format, &cur);
551 	}
552 	
553 	/**
554 	 * Answer a duration query by setting the requested value in the given format.
555 	 * Params:
556 	 * format = the GstFormat for the duration
557 	 * duration = the duration of the stream
558 	 */
559 	public void setDuration(GstFormat format, long duration)
560 	{
561 		// void gst_query_set_duration (GstQuery *query,  GstFormat format,  gint64 duration);
562 		gst_query_set_duration(gstQuery, format, duration);
563 	}
564 	
565 	/**
566 	 * Parse a duration query answer. Write the format of the duration into format,
567 	 * and the value into duration, if the respective variables are non-NULL.
568 	 * Params:
569 	 * format = the storage for the GstFormat of the duration
570 	 * value, or NULL. [out][allow-none]
571 	 * duration = the storage for the total duration, or NULL. [out][allow-none]
572 	 */
573 	public void parseDuration(ref GstFormat format, ref long duration)
574 	{
575 		// void gst_query_parse_duration (GstQuery *query,  GstFormat *format,  gint64 *duration);
576 		gst_query_parse_duration(gstQuery, &format, &duration);
577 	}
578 	
579 	/**
580 	 * Parse a latency query answer.
581 	 * Params:
582 	 * live = storage for live or NULL. [out][allow-none]
583 	 * minLatency = the storage for the min latency or NULL. [out][allow-none]
584 	 * maxLatency = the storage for the max latency or NULL. [out][allow-none]
585 	 */
586 	public void parseLatency(ref int live, ref GstClockTime minLatency, ref GstClockTime maxLatency)
587 	{
588 		// void gst_query_parse_latency (GstQuery *query,  gboolean *live,  GstClockTime *min_latency,  GstClockTime *max_latency);
589 		gst_query_parse_latency(gstQuery, &live, &minLatency, &maxLatency);
590 	}
591 	
592 	/**
593 	 * Answer a latency query by setting the requested values in the given format.
594 	 * Params:
595 	 * live = if there is a live element upstream
596 	 * minLatency = the minimal latency of the upstream elements
597 	 * maxLatency = the maximal latency of the upstream elements
598 	 */
599 	public void setLatency(int live, GstClockTime minLatency, GstClockTime maxLatency)
600 	{
601 		// void gst_query_set_latency (GstQuery *query,  gboolean live,  GstClockTime min_latency,  GstClockTime max_latency);
602 		gst_query_set_latency(gstQuery, live, minLatency, maxLatency);
603 	}
604 	
605 	/**
606 	 * Set the seeking query result fields in query.
607 	 * Params:
608 	 * format = the format to set for the segment_start and segment_end values
609 	 * seekable = the seekable flag to set
610 	 * segmentStart = the segment_start to set
611 	 * segmentEnd = the segment_end to set
612 	 */
613 	public void setSeeking(GstFormat format, int seekable, long segmentStart, long segmentEnd)
614 	{
615 		// void gst_query_set_seeking (GstQuery *query,  GstFormat format,  gboolean seekable,  gint64 segment_start,  gint64 segment_end);
616 		gst_query_set_seeking(gstQuery, format, seekable, segmentStart, segmentEnd);
617 	}
618 	
619 	/**
620 	 * Parse a seeking query, writing the format into format, and
621 	 * other results into the passed parameters, if the respective parameters
622 	 * are non-NULL
623 	 * Params:
624 	 * format = the format to set for the segment_start
625 	 * and segment_end values, or NULL. [out][allow-none]
626 	 * seekable = the seekable flag to set, or NULL. [out][allow-none]
627 	 * segmentStart = the segment_start to set, or NULL. [out][allow-none]
628 	 * segmentEnd = the segment_end to set, or NULL. [out][allow-none]
629 	 */
630 	public void parseSeeking(ref GstFormat format, ref int seekable, ref long segmentStart, ref long segmentEnd)
631 	{
632 		// void gst_query_parse_seeking (GstQuery *query,  GstFormat *format,  gboolean *seekable,  gint64 *segment_start,  gint64 *segment_end);
633 		gst_query_parse_seeking(gstQuery, &format, &seekable, &segmentStart, &segmentEnd);
634 	}
635 	
636 	/**
637 	 * Set the formats query result fields in query. The number of formats passed
638 	 * in the formats array must be equal to n_formats.
639 	 * Params:
640 	 * formats = an array containing n_formats
641 	 * GstFormat values. [in][array length=n_formats]
642 	 */
643 	public void setFormatsv(GstFormat[] formats)
644 	{
645 		// void gst_query_set_formatsv (GstQuery *query,  gint n_formats,  const GstFormat *formats);
646 		gst_query_set_formatsv(gstQuery, cast(int) formats.length, formats.ptr);
647 	}
648 	
649 	/**
650 	 * Parse the number of formats in the formats query.
651 	 * Params:
652 	 * nFormats = the number of formats in this query. [out][allow-none]
653 	 */
654 	public void parseNFormats(out uint nFormats)
655 	{
656 		// void gst_query_parse_n_formats (GstQuery *query,  guint *n_formats);
657 		gst_query_parse_n_formats(gstQuery, &nFormats);
658 	}
659 	
660 	/**
661 	 * Parse the format query and retrieve the nth format from it into
662 	 * format. If the list contains less elements than nth, format will be
663 	 * set to GST_FORMAT_UNDEFINED.
664 	 * Params:
665 	 * nth = the nth format to retrieve. [out]
666 	 * format = a pointer to store the nth format. [out][allow-none]
667 	 */
668 	public void parseNthFormat(uint nth, out GstFormat format)
669 	{
670 		// void gst_query_parse_nth_format (GstQuery *query,  guint nth,  GstFormat *format);
671 		gst_query_parse_nth_format(gstQuery, nth, &format);
672 	}
673 	
674 	/**
675 	 * Answer a segment query by setting the requested values. The normal
676 	 * playback segment of a pipeline is 0 to duration at the default rate of
677 	 * 1.0. If a seek was performed on the pipeline to play a different
678 	 * segment, this query will return the range specified in the last seek.
679 	 * start_value and stop_value will respectively contain the configured
680 	 * playback range start and stop values expressed in format.
681 	 * The values are always between 0 and the duration of the media and
682 	 * start_value <= stop_value. rate will contain the playback rate. For
683 	 * negative rates, playback will actually happen from stop_value to
684 	 * start_value.
685 	 * Params:
686 	 * rate = the rate of the segment
687 	 * format = the GstFormat of the segment values (start_value and stop_value)
688 	 * startValue = the start value
689 	 * stopValue = the stop value
690 	 */
691 	public void setSegment(double rate, GstFormat format, long startValue, long stopValue)
692 	{
693 		// void gst_query_set_segment (GstQuery *query,  gdouble rate,  GstFormat format,  gint64 start_value,  gint64 stop_value);
694 		gst_query_set_segment(gstQuery, rate, format, startValue, stopValue);
695 	}
696 	
697 	/**
698 	 * Parse a segment query answer. Any of rate, format, start_value, and
699 	 * stop_value may be NULL, which will cause this value to be omitted.
700 	 * See gst_query_set_segment() for an explanation of the function arguments.
701 	 * Params:
702 	 * rate = the storage for the rate of the segment, or NULL. [out][allow-none]
703 	 * format = the storage for the GstFormat of the values,
704 	 * or NULL. [out][allow-none]
705 	 * startValue = the storage for the start value, or NULL. [out][allow-none]
706 	 * stopValue = the storage for the stop value, or NULL. [out][allow-none]
707 	 */
708 	public void parseSegment(ref double rate, ref GstFormat format, ref long startValue, ref long stopValue)
709 	{
710 		// void gst_query_parse_segment (GstQuery *query,  gdouble *rate,  GstFormat *format,  gint64 *start_value,  gint64 *stop_value);
711 		gst_query_parse_segment(gstQuery, &rate, &format, &startValue, &stopValue);
712 	}
713 	
714 	/**
715 	 * Constructs a new query object for querying the caps.
716 	 * The CAPS query should return the allowable caps for a pad in the context
717 	 * of the element's state, its link to other elements, and the devices or files
718 	 * it has opened. These caps must be a subset of the pad template caps. In the
719 	 * NULL state with no links, the CAPS query should ideally return the same caps
720 	 * as the pad template. In rare circumstances, an object property can affect
721 	 * the caps returned by the CAPS query, but this is discouraged.
722 	 * For most filters, the caps returned by CAPS query is directly affected by the
723 	 * allowed caps on other pads. For demuxers and decoders, the caps returned by
724 	 * the srcpad's getcaps function is directly related to the stream data. Again,
725 	 * the CAPS query should return the most specific caps it reasonably can, since this
726 	 * helps with autoplugging.
727 	 * The filter is used to restrict the result caps, only the caps matching
728 	 * filter should be returned from the CAPS query. Specifying a filter might
729 	 * greatly reduce the amount of processing an element needs to do.
730 	 * Free-function: gst_query_unref
731 	 * Params:
732 	 * filter = a filter
733 	 * Throws: ConstructionException GTK+ fails to create the object.
734 	 */
735 	public this (Caps filter)
736 	{
737 		// GstQuery * gst_query_new_caps (GstCaps *filter);
738 		auto p = gst_query_new_caps((filter is null) ? null : filter.getCapsStruct());
739 		if(p is null)
740 		{
741 			throw new ConstructionException("null returned by gst_query_new_caps((filter is null) ? null : filter.getCapsStruct())");
742 		}
743 		this(cast(GstQuery*) p);
744 	}
745 	
746 	/**
747 	 * Get the filter from the caps query. The caps remains valid as long as
748 	 * query remains valid.
749 	 * Params:
750 	 * filter = A pointer to the caps filter. [out][transfer none]
751 	 */
752 	public void parseCaps(out Caps filter)
753 	{
754 		// void gst_query_parse_caps (GstQuery *query,  GstCaps **filter);
755 		GstCaps* outfilter = null;
756 		
757 		gst_query_parse_caps(gstQuery, &outfilter);
758 		
759 		filter = ObjectG.getDObject!(Caps)(outfilter);
760 	}
761 	
762 	/**
763 	 * Set the caps result in query.
764 	 * Params:
765 	 * caps = A pointer to the caps. [in]
766 	 */
767 	public void setCapsResult(Caps caps)
768 	{
769 		// void gst_query_set_caps_result (GstQuery *query,  GstCaps *caps);
770 		gst_query_set_caps_result(gstQuery, (caps is null) ? null : caps.getCapsStruct());
771 	}
772 	
773 	/**
774 	 * Get the caps result from query. The caps remains valid as long as
775 	 * query remains valid.
776 	 * Params:
777 	 * caps = A pointer to the caps. [out][transfer none]
778 	 */
779 	public void parseCapsResult(out Caps caps)
780 	{
781 		// void gst_query_parse_caps_result (GstQuery *query,  GstCaps **caps);
782 		GstCaps* outcaps = null;
783 		
784 		gst_query_parse_caps_result(gstQuery, &outcaps);
785 		
786 		caps = ObjectG.getDObject!(Caps)(outcaps);
787 	}
788 	
789 	/**
790 	 * Get the caps from query. The caps remains valid as long as query remains
791 	 * valid.
792 	 * Params:
793 	 * caps = A pointer to the caps. [out][transfer none]
794 	 */
795 	public void parseAcceptCaps(out Caps caps)
796 	{
797 		// void gst_query_parse_accept_caps (GstQuery *query,  GstCaps **caps);
798 		GstCaps* outcaps = null;
799 		
800 		gst_query_parse_accept_caps(gstQuery, &outcaps);
801 		
802 		caps = ObjectG.getDObject!(Caps)(outcaps);
803 	}
804 	
805 	/**
806 	 * Set result as the result for the query.
807 	 * Params:
808 	 * result = the result to set
809 	 */
810 	public void setAcceptCapsResult(int result)
811 	{
812 		// void gst_query_set_accept_caps_result (GstQuery *query,  gboolean result);
813 		gst_query_set_accept_caps_result(gstQuery, result);
814 	}
815 	
816 	/**
817 	 * Parse the result from query and store in result.
818 	 * Params:
819 	 * result = location for the result
820 	 */
821 	public void parseAcceptCapsResult(out int result)
822 	{
823 		// void gst_query_parse_accept_caps_result (GstQuery *query,  gboolean *result);
824 		gst_query_parse_accept_caps_result(gstQuery, &result);
825 	}
826 	
827 	/**
828 	 * Constructs a new query object for querying the buffering status of
829 	 * a stream.
830 	 * Free-function: gst_query_unref
831 	 * Params:
832 	 * format = the default GstFormat for the new query
833 	 * Throws: ConstructionException GTK+ fails to create the object.
834 	 */
835 	public this (GstFormat format)
836 	{
837 		// GstQuery * gst_query_new_buffering (GstFormat format);
838 		auto p = gst_query_new_buffering(format);
839 		if(p is null)
840 		{
841 			throw new ConstructionException("null returned by gst_query_new_buffering(format)");
842 		}
843 		this(cast(GstQuery*) p);
844 	}
845 	
846 	/**
847 	 * Set the percentage of buffered data. This is a value between 0 and 100.
848 	 * The busy indicator is TRUE when the buffering is in progress.
849 	 * Params:
850 	 * busy = if buffering is busy
851 	 * percent = a buffering percent
852 	 */
853 	public void setBufferingPercent(int busy, int percent)
854 	{
855 		// void gst_query_set_buffering_percent (GstQuery *query,  gboolean busy,  gint percent);
856 		gst_query_set_buffering_percent(gstQuery, busy, percent);
857 	}
858 	
859 	/**
860 	 * Get the percentage of buffered data. This is a value between 0 and 100.
861 	 * The busy indicator is TRUE when the buffering is in progress.
862 	 * Params:
863 	 * busy = if buffering is busy, or NULL. [out][allow-none]
864 	 * percent = a buffering percent, or NULL. [out][allow-none]
865 	 */
866 	public void parseBufferingPercent(out int busy, out int percent)
867 	{
868 		// void gst_query_parse_buffering_percent (GstQuery *query,  gboolean *busy,  gint *percent);
869 		gst_query_parse_buffering_percent(gstQuery, &busy, &percent);
870 	}
871 	
872 	/**
873 	 * Configures the buffering stats values in query.
874 	 * Params:
875 	 * mode = a buffering mode
876 	 * avgIn = the average input rate
877 	 * avgOut = the average output rate
878 	 * bufferingLeft = amount of buffering time left in milliseconds
879 	 */
880 	public void setBufferingStats(GstBufferingMode mode, int avgIn, int avgOut, long bufferingLeft)
881 	{
882 		// void gst_query_set_buffering_stats (GstQuery *query,  GstBufferingMode mode,  gint avg_in,  gint avg_out,  gint64 buffering_left);
883 		gst_query_set_buffering_stats(gstQuery, mode, avgIn, avgOut, bufferingLeft);
884 	}
885 	
886 	/**
887 	 * Extracts the buffering stats values from query.
888 	 * Params:
889 	 * mode = a buffering mode, or NULL. [out][allow-none]
890 	 * avgIn = the average input rate, or NULL. [out][allow-none]
891 	 * avgOut = the average output rat, or NULLe. [out][allow-none]
892 	 * bufferingLeft = amount of buffering time left in
893 	 * milliseconds, or NULL. [out][allow-none]
894 	 */
895 	public void parseBufferingStats(out GstBufferingMode mode, out int avgIn, out int avgOut, out long bufferingLeft)
896 	{
897 		// void gst_query_parse_buffering_stats (GstQuery *query,  GstBufferingMode *mode,  gint *avg_in,  gint *avg_out,  gint64 *buffering_left);
898 		gst_query_parse_buffering_stats(gstQuery, &mode, &avgIn, &avgOut, &bufferingLeft);
899 	}
900 	
901 	/**
902 	 * Set the available query result fields in query.
903 	 * Params:
904 	 * format = the format to set for the start and stop values
905 	 * start = the start to set
906 	 * stop = the stop to set
907 	 * estimatedTotal = estimated total amount of download time remaining in
908 	 * miliseconds
909 	 */
910 	public void setBufferingRange(GstFormat format, long start, long stop, long estimatedTotal)
911 	{
912 		// void gst_query_set_buffering_range (GstQuery *query,  GstFormat format,  gint64 start,  gint64 stop,  gint64 estimated_total);
913 		gst_query_set_buffering_range(gstQuery, format, start, stop, estimatedTotal);
914 	}
915 	
916 	/**
917 	 * Parse an available query, writing the format into format, and
918 	 * other results into the passed parameters, if the respective parameters
919 	 * are non-NULL
920 	 * Params:
921 	 * format = the format to set for the segment_start
922 	 * and segment_end values, or NULL. [out][allow-none]
923 	 * start = the start to set, or NULL. [out][allow-none]
924 	 * stop = the stop to set, or NULL. [out][allow-none]
925 	 * estimatedTotal = estimated total amount of download
926 	 * time remaining in miliseconds, or NULL. [out][allow-none]
927 	 */
928 	public void parseBufferingRange(out GstFormat format, out long start, out long stop, out long estimatedTotal)
929 	{
930 		// void gst_query_parse_buffering_range (GstQuery *query,  GstFormat *format,  gint64 *start,  gint64 *stop,  gint64 *estimated_total);
931 		gst_query_parse_buffering_range(gstQuery, &format, &start, &stop, &estimatedTotal);
932 	}
933 	
934 	/**
935 	 * Set the buffering-ranges array field in query. The current last
936 	 * start position of the array should be inferior to start.
937 	 * Params:
938 	 * start = start position of the range
939 	 * stop = stop position of the range
940 	 * Returns: a gboolean indicating if the range was added or not.
941 	 */
942 	public int addBufferingRange(long start, long stop)
943 	{
944 		// gboolean gst_query_add_buffering_range (GstQuery *query,  gint64 start,  gint64 stop);
945 		return gst_query_add_buffering_range(gstQuery, start, stop);
946 	}
947 	
948 	/**
949 	 * Retrieve the number of values currently stored in the
950 	 * buffered-ranges array of the query's structure.
951 	 * Returns: the range array size as a guint.
952 	 */
953 	public uint getNBufferingRanges()
954 	{
955 		// guint gst_query_get_n_buffering_ranges (GstQuery *query);
956 		return gst_query_get_n_buffering_ranges(gstQuery);
957 	}
958 	
959 	/**
960 	 * Parse an available query and get the start and stop values stored
961 	 * at the index of the buffered ranges array.
962 	 * Params:
963 	 * index = position in the buffered-ranges array to read
964 	 * start = the start position to set, or NULL. [out][allow-none]
965 	 * stop = the stop position to set, or NULL. [out][allow-none]
966 	 * Returns: a gboolean indicating if the parsing succeeded.
967 	 */
968 	public int parseNthBufferingRange(uint index, out long start, out long stop)
969 	{
970 		// gboolean gst_query_parse_nth_buffering_range (GstQuery *query,  guint index,  gint64 *start,  gint64 *stop);
971 		return gst_query_parse_nth_buffering_range(gstQuery, index, &start, &stop);
972 	}
973 	
974 	/**
975 	 * Parse an URI query, writing the URI into uri as a newly
976 	 * allocated string, if the respective parameters are non-NULL.
977 	 * Free the string with g_free() after usage.
978 	 * Params:
979 	 * uri = the storage for the current URI
980 	 * (may be NULL). [out][transfer full][allow-none]
981 	 */
982 	public void parseUri(out string uri)
983 	{
984 		// void gst_query_parse_uri (GstQuery *query,  gchar **uri);
985 		char* outuri = null;
986 		
987 		gst_query_parse_uri(gstQuery, &outuri);
988 		
989 		uri = Str.toString(outuri);
990 	}
991 	
992 	/**
993 	 * Answer a URI query by setting the requested URI.
994 	 * Params:
995 	 * uri = the URI to set
996 	 */
997 	public void setUri(string uri)
998 	{
999 		// void gst_query_set_uri (GstQuery *query,  const gchar *uri);
1000 		gst_query_set_uri(gstQuery, Str.toStringz(uri));
1001 	}
1002 	
1003 	/**
1004 	 * Constructs a new query object for querying the allocation properties.
1005 	 * Free-function: gst_query_unref
1006 	 * Params:
1007 	 * caps = the negotiated caps
1008 	 * needPool = return a pool
1009 	 * Throws: ConstructionException GTK+ fails to create the object.
1010 	 */
1011 	public this (Caps caps, int needPool)
1012 	{
1013 		// GstQuery * gst_query_new_allocation (GstCaps *caps,  gboolean need_pool);
1014 		auto p = gst_query_new_allocation((caps is null) ? null : caps.getCapsStruct(), needPool);
1015 		if(p is null)
1016 		{
1017 			throw new ConstructionException("null returned by gst_query_new_allocation((caps is null) ? null : caps.getCapsStruct(), needPool)");
1018 		}
1019 		this(cast(GstQuery*) p);
1020 	}
1021 	
1022 	/**
1023 	 * Parse an allocation query, writing the requested caps in caps and
1024 	 * whether a pool is needed in need_pool, if the respective parameters
1025 	 * are non-NULL.
1026 	 * Params:
1027 	 * caps = The GstCaps. [out][transfer none][allow-none]
1028 	 * needPool = Whether a GstBufferPool is needed. [out][allow-none]
1029 	 */
1030 	public void parseAllocation(out Caps caps, out int needPool)
1031 	{
1032 		// void gst_query_parse_allocation (GstQuery *query,  GstCaps **caps,  gboolean *need_pool);
1033 		GstCaps* outcaps = null;
1034 		
1035 		gst_query_parse_allocation(gstQuery, &outcaps, &needPool);
1036 		
1037 		caps = ObjectG.getDObject!(Caps)(outcaps);
1038 	}
1039 	
1040 	/**
1041 	 * Set the pool parameters in query.
1042 	 * Params:
1043 	 * pool = the GstBufferPool
1044 	 * size = the size
1045 	 * minBuffers = the min buffers
1046 	 * maxBuffers = the max buffers
1047 	 */
1048 	public void addAllocationPool(BufferPool pool, uint size, uint minBuffers, uint maxBuffers)
1049 	{
1050 		// void gst_query_add_allocation_pool (GstQuery *query,  GstBufferPool *pool,  guint size,  guint min_buffers,  guint max_buffers);
1051 		gst_query_add_allocation_pool(gstQuery, (pool is null) ? null : pool.getBufferPoolStruct(), size, minBuffers, maxBuffers);
1052 	}
1053 	
1054 	/**
1055 	 * Retrieve the number of values currently stored in the
1056 	 * pool array of the query's structure.
1057 	 * Returns: the pool array size as a guint.
1058 	 */
1059 	public uint getNAllocationPools()
1060 	{
1061 		// guint gst_query_get_n_allocation_pools (GstQuery *query);
1062 		return gst_query_get_n_allocation_pools(gstQuery);
1063 	}
1064 	
1065 	/**
1066 	 * Get the pool parameters in query.
1067 	 * Unref pool with gst_object_unref() when it's not needed any more.
1068 	 * Params:
1069 	 * index = index to parse
1070 	 * pool = the GstBufferPool. [out][allow-none][transfer full]
1071 	 * size = the size. [out][allow-none]
1072 	 * minBuffers = the min buffers. [out][allow-none]
1073 	 * maxBuffers = the max buffers. [out][allow-none]
1074 	 */
1075 	public void parseNthAllocationPool(uint index, out BufferPool pool, out uint size, out uint minBuffers, out uint maxBuffers)
1076 	{
1077 		// void gst_query_parse_nth_allocation_pool (GstQuery *query,  guint index,  GstBufferPool **pool,  guint *size,  guint *min_buffers,  guint *max_buffers);
1078 		GstBufferPool* outpool = null;
1079 		
1080 		gst_query_parse_nth_allocation_pool(gstQuery, index, &outpool, &size, &minBuffers, &maxBuffers);
1081 		
1082 		pool = ObjectG.getDObject!(BufferPool)(outpool);
1083 	}
1084 	
1085 	/**
1086 	 * Set the pool parameters in query.
1087 	 * Params:
1088 	 * index = index to modify
1089 	 * pool = the GstBufferPool
1090 	 * size = the size
1091 	 * minBuffers = the min buffers
1092 	 * maxBuffers = the max buffers
1093 	 */
1094 	public void setNthAllocationPool(uint index, BufferPool pool, uint size, uint minBuffers, uint maxBuffers)
1095 	{
1096 		// void gst_query_set_nth_allocation_pool (GstQuery *query,  guint index,  GstBufferPool *pool,  guint size,  guint min_buffers,  guint max_buffers);
1097 		gst_query_set_nth_allocation_pool(gstQuery, index, (pool is null) ? null : pool.getBufferPoolStruct(), size, minBuffers, maxBuffers);
1098 	}
1099 	
1100 	/**
1101 	 * Remove the allocation pool at index of the allocation pool array.
1102 	 * Since 1.2
1103 	 * Params:
1104 	 * index = position in the allocation pool array to remove
1105 	 */
1106 	public void removeNthAllocationPool(uint index)
1107 	{
1108 		// void gst_query_remove_nth_allocation_pool  (GstQuery *query,  guint index);
1109 		gst_query_remove_nth_allocation_pool(gstQuery, index);
1110 	}
1111 	
1112 	/**
1113 	 * Add allocator and its params as a supported memory allocator.
1114 	 * Params:
1115 	 * allocator = the memory allocator. [transfer none][allow-none]
1116 	 * params = a GstAllocationParams. [transfer none][allow-none]
1117 	 */
1118 	public void addAllocationParam(Allocator allocator, GstAllocationParams* params)
1119 	{
1120 		// void gst_query_add_allocation_param (GstQuery *query,  GstAllocator *allocator,  const GstAllocationParams *params);
1121 		gst_query_add_allocation_param(gstQuery, (allocator is null) ? null : allocator.getAllocatorStruct(), params);
1122 	}
1123 	
1124 	/**
1125 	 * Retrieve the number of values currently stored in the
1126 	 * allocator params array of the query's structure.
1127 	 * If no memory allocator is specified, the downstream element can handle
1128 	 * the default memory allocator. The first memory allocator in the query
1129 	 * should be generic and allow mapping to system memory, all following
1130 	 * allocators should be ordered by preference with the preferred one first.
1131 	 * Returns: the allocator array size as a guint.
1132 	 */
1133 	public uint getNAllocationParams()
1134 	{
1135 		// guint gst_query_get_n_allocation_params (GstQuery *query);
1136 		return gst_query_get_n_allocation_params(gstQuery);
1137 	}
1138 	
1139 	/**
1140 	 * Parse an available query and get the alloctor and its params
1141 	 * at index of the allocator array.
1142 	 * Params:
1143 	 * index = position in the allocator array to read
1144 	 * allocator = variable to hold the result. [out][transfer full][allow-none]
1145 	 * params = parameters for the allocator. [out][allow-none]
1146 	 */
1147 	public void parseNthAllocationParam(uint index, out Allocator allocator, out GstAllocationParams params)
1148 	{
1149 		// void gst_query_parse_nth_allocation_param  (GstQuery *query,  guint index,  GstAllocator **allocator,  GstAllocationParams *params);
1150 		GstAllocator* outallocator = null;
1151 		
1152 		gst_query_parse_nth_allocation_param(gstQuery, index, &outallocator, &params);
1153 		
1154 		allocator = ObjectG.getDObject!(Allocator)(outallocator);
1155 	}
1156 	
1157 	/**
1158 	 * Parse an available query and get the alloctor and its params
1159 	 * at index of the allocator array.
1160 	 * Params:
1161 	 * index = position in the allocator array to set
1162 	 * allocator = new allocator to set. [transfer none][allow-none]
1163 	 * params = parameters for the allocator. [transfer none][allow-none]
1164 	 */
1165 	public void setNthAllocationParam(uint index, out GstAllocator allocator, out GstAllocationParams params)
1166 	{
1167 		// void gst_query_set_nth_allocation_param (GstQuery *query,  guint index,  GstAllocator *allocator,  const GstAllocationParams *params);
1168 		gst_query_set_nth_allocation_param(gstQuery, index, &allocator, &params);
1169 	}
1170 	
1171 	/**
1172 	 * Remove the allocation param at index of the allocation param array.
1173 	 * Since 1.2
1174 	 * Params:
1175 	 * index = position in the allocation param array to remove
1176 	 */
1177 	public void removeNthAllocationParam(uint index)
1178 	{
1179 		// void gst_query_remove_nth_allocation_param  (GstQuery *query,  guint index);
1180 		gst_query_remove_nth_allocation_param(gstQuery, index);
1181 	}
1182 	
1183 	/**
1184 	 * Add api with params as one of the supported metadata API to query.
1185 	 * Params:
1186 	 * api = the metadata API
1187 	 * params = API specific parameters. [transfer none][allow-none]
1188 	 */
1189 	public void addAllocationMeta(GType api, Structure params)
1190 	{
1191 		// void gst_query_add_allocation_meta (GstQuery *query,  GType api,  const GstStructure *params);
1192 		gst_query_add_allocation_meta(gstQuery, api, (params is null) ? null : params.getStructureStruct());
1193 	}
1194 	
1195 	/**
1196 	 * Retrieve the number of values currently stored in the
1197 	 * meta API array of the query's structure.
1198 	 * Returns: the metadata API array size as a guint.
1199 	 */
1200 	public uint getNAllocationMetas()
1201 	{
1202 		// guint gst_query_get_n_allocation_metas (GstQuery *query);
1203 		return gst_query_get_n_allocation_metas(gstQuery);
1204 	}
1205 	
1206 	/**
1207 	 * Parse an available query and get the metadata API
1208 	 * at index of the metadata API array.
1209 	 * Params:
1210 	 * index = position in the metadata API array to read
1211 	 * params = API specific flags. [out][transfer none][allow-none]
1212 	 * Returns: a GType of the metadata API at index.
1213 	 */
1214 	public GType parseNthAllocationMeta(uint index, out Structure params)
1215 	{
1216 		// GType gst_query_parse_nth_allocation_meta (GstQuery *query,  guint index,  const GstStructure **params);
1217 		GstStructure* outparams = null;
1218 		
1219 		auto p = gst_query_parse_nth_allocation_meta(gstQuery, index, &outparams);
1220 		
1221 		params = ObjectG.getDObject!(Structure)(outparams);
1222 		return p;
1223 	}
1224 	
1225 	/**
1226 	 * Remove the metadata API at index of the metadata API array.
1227 	 * Params:
1228 	 * index = position in the metadata API array to remove
1229 	 */
1230 	public void removeNthAllocationMeta(uint index)
1231 	{
1232 		// void gst_query_remove_nth_allocation_meta  (GstQuery *query,  guint index);
1233 		gst_query_remove_nth_allocation_meta(gstQuery, index);
1234 	}
1235 	
1236 	/**
1237 	 * Check if query has metadata api set. When this function returns TRUE,
1238 	 * index will contain the index where the requested API and the flags can be
1239 	 * found.
1240 	 * Params:
1241 	 * api = the metadata API
1242 	 * index = the index. [out][transfer none][allow-none]
1243 	 * Returns: TRUE when api is in the list of metadata.
1244 	 */
1245 	public int findAllocationMeta(GType api, out uint index)
1246 	{
1247 		// gboolean gst_query_find_allocation_meta (GstQuery *query,  GType api,  guint *index);
1248 		return gst_query_find_allocation_meta(gstQuery, api, &index);
1249 	}
1250 	
1251 	/**
1252 	 * Set the scheduling properties.
1253 	 * Params:
1254 	 * flags = GstSchedulingFlags. [out][allow-none]
1255 	 * minsize = the suggested minimum size of pull requests. [out][allow-none]
1256 	 * maxsize = the suggested maximum size of pull requests:. [out][allow-none]
1257 	 */
1258 	public void parseScheduling(out GstSchedulingFlags flags, out int minsize, out int maxsize, out int alig)
1259 	{
1260 		// void gst_query_parse_scheduling (GstQuery *query,  GstSchedulingFlags *flags,  gint *minsize,  gint *maxsize,  gint *align);
1261 		gst_query_parse_scheduling(gstQuery, &flags, &minsize, &maxsize, &alig);
1262 	}
1263 	
1264 	/**
1265 	 * Set the scheduling properties.
1266 	 * Params:
1267 	 * flags = GstSchedulingFlags
1268 	 * minsize = the suggested minimum size of pull requests
1269 	 * maxsize = the suggested maximum size of pull requests
1270 	 */
1271 	public void setScheduling(GstSchedulingFlags flags, int minsize, int maxsize, int alig)
1272 	{
1273 		// void gst_query_set_scheduling (GstQuery *query,  GstSchedulingFlags flags,  gint minsize,  gint maxsize,  gint align);
1274 		gst_query_set_scheduling(gstQuery, flags, minsize, maxsize, alig);
1275 	}
1276 	
1277 	/**
1278 	 * Add mode as aone of the supported scheduling modes to query.
1279 	 * Params:
1280 	 * mode = a GstPadMode
1281 	 */
1282 	public void addSchedulingMode(GstPadMode mode)
1283 	{
1284 		// void gst_query_add_scheduling_mode (GstQuery *query,  GstPadMode mode);
1285 		gst_query_add_scheduling_mode(gstQuery, mode);
1286 	}
1287 	
1288 	/**
1289 	 * Retrieve the number of values currently stored in the
1290 	 * scheduling mode array of the query's structure.
1291 	 * Returns: the scheduling mode array size as a guint.
1292 	 */
1293 	public uint getNSchedulingModes()
1294 	{
1295 		// guint gst_query_get_n_scheduling_modes (GstQuery *query);
1296 		return gst_query_get_n_scheduling_modes(gstQuery);
1297 	}
1298 	
1299 	/**
1300 	 * Parse an available query and get the scheduling mode
1301 	 * at index of the scheduling modes array.
1302 	 * Params:
1303 	 * index = position in the scheduling modes array to read
1304 	 * Returns: a GstPadMode of the scheduling mode at index.
1305 	 */
1306 	public GstPadMode parseNthSchedulingMode(uint index)
1307 	{
1308 		// GstPadMode gst_query_parse_nth_scheduling_mode (GstQuery *query,  guint index);
1309 		return gst_query_parse_nth_scheduling_mode(gstQuery, index);
1310 	}
1311 	
1312 	/**
1313 	 * Check if query has scheduling mode set.
1314 	 * Note
1315 	 *  When checking if upstream supports pull mode, it is usually not
1316 	 *  enough to just check for GST_PAD_MODE_PULL with this function, you
1317 	 *  also want to check whether the scheduling flags returned by
1318 	 *  gst_query_parse_scheduling() have the seeking flag set (meaning
1319 	 *  random access is supported, not only sequential pulls).
1320 	 * Params:
1321 	 * mode = the scheduling mode
1322 	 * Returns: TRUE when mode is in the list of scheduling modes.
1323 	 */
1324 	public int hasSchedulingMode(GstPadMode mode)
1325 	{
1326 		// gboolean gst_query_has_scheduling_mode (GstQuery *query,  GstPadMode mode);
1327 		return gst_query_has_scheduling_mode(gstQuery, mode);
1328 	}
1329 	
1330 	/**
1331 	 * Check if query has scheduling mode set and flags is set in
1332 	 * query scheduling flags.
1333 	 * Params:
1334 	 * mode = the scheduling mode
1335 	 * flags = GstSchedulingFlags
1336 	 * Returns: TRUE when mode is in the list of scheduling modes and flags are compatible with query flags.
1337 	 */
1338 	public int hasSchedulingModeWithFlags(GstPadMode mode, GstSchedulingFlags flags)
1339 	{
1340 		// gboolean gst_query_has_scheduling_mode_with_flags  (GstQuery *query,  GstPadMode mode,  GstSchedulingFlags flags);
1341 		return gst_query_has_scheduling_mode_with_flags(gstQuery, mode, flags);
1342 	}
1343 	
1344 	/**
1345 	 * Constructs a new query object for querying the pipeline-local context.
1346 	 * Free-function: gst_query_unref
1347 	 * Since 1.2
1348 	 * Params:
1349 	 * contextType = Context type to query
1350 	 * Throws: ConstructionException GTK+ fails to create the object.
1351 	 */
1352 	public this (string contextType)
1353 	{
1354 		// GstQuery * gst_query_new_context (const gchar *context_type);
1355 		auto p = gst_query_new_context(Str.toStringz(contextType));
1356 		if(p is null)
1357 		{
1358 			throw new ConstructionException("null returned by gst_query_new_context(Str.toStringz(contextType))");
1359 		}
1360 		this(cast(GstQuery*) p);
1361 	}
1362 	
1363 	/**
1364 	 * Answer a context query by setting the requested context.
1365 	 * Since 1.2
1366 	 * Params:
1367 	 * context = the requested GstContext
1368 	 */
1369 	public void setContext(Context context)
1370 	{
1371 		// void gst_query_set_context (GstQuery *query,  GstContext *context);
1372 		gst_query_set_context(gstQuery, (context is null) ? null : context.getContextStruct());
1373 	}
1374 	
1375 	/**
1376 	 * Get the context from the context query. The context remains valid as long as
1377 	 * query remains valid.
1378 	 * Since 1.2
1379 	 * Params:
1380 	 * context = A pointer to store the GstContext. [out][transfer none]
1381 	 */
1382 	public void parseContext(out Context context)
1383 	{
1384 		// void gst_query_parse_context (GstQuery *query,  GstContext **context);
1385 		GstContext* outcontext = null;
1386 		
1387 		gst_query_parse_context(gstQuery, &outcontext);
1388 		
1389 		context = ObjectG.getDObject!(Context)(outcontext);
1390 	}
1391 	
1392 	/**
1393 	 * Parse a context type from an existing GST_QUERY_CONTEXT query.
1394 	 * Since 1.2
1395 	 * Params:
1396 	 * contextType = the context type, or NULL. [out][transfer none][allow-none]
1397 	 * Returns: a gboolean indicating if the parsing succeeded.
1398 	 */
1399 	public int parseContextType(out string contextType)
1400 	{
1401 		// gboolean gst_query_parse_context_type (GstQuery *query,  const gchar **context_type);
1402 		char* outcontextType = null;
1403 		
1404 		auto p = gst_query_parse_context_type(gstQuery, &outcontextType);
1405 		
1406 		contextType = Str.toString(outcontextType);
1407 		return p;
1408 	}
1409 }