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