2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gstreamer-GstQuery.html
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
51 * - gstreamer.Structure
53 * - GstQuery* -> Query
54 * - GstStructure* -> Structure
59 module gstreamer
.Query
;
61 private import gstreamerc
.gstreamertypes
;
63 private import gstreamerc
.gstreamer
;
65 private import glib
.Str
;
66 private import gstreamer
.Structure
;
72 * GstQuery functions are used to register a new query types to the gstreamer
74 * Query types can be used to perform queries on pads and elements.
75 * Queries can be created using the gst_query_new_xxx() functions.
76 * Query values can be set using gst_query_set_xxx(), and parsed using
77 * gst_query_parse_xxx() helpers.
78 * The following example shows how to query the duration of a pipeline:
79 * Example13.Query duration on a pipeline
82 * query = gst_query_new_duration (GST_FORMAT_TIME);
83 * res = gst_element_query (pipeline, query);
86 * gst_query_parse_duration (query, NULL, duration);
87 * g_print ("duration = %"GST_TIME_FORMAT, GST_TIME_ARGS (duration));
90 * g_print ("duration query failed...");
92 * gst_query_unref (query);
93 * Last reviewed on 2006-02-14 (0.10.4)
98 /** the main Gtk struct */
99 protected GstQuery
* gstQuery
;
102 public GstQuery
* getQueryStruct()
108 /** the main Gtk struct as a void* */
109 protected void* getStruct()
111 return cast(void*)gstQuery
;
115 * Sets our main struct and passes it to the parent class
117 public this (GstQuery
* gstQuery
)
119 this.gstQuery
= gstQuery
;
123 * Constructs a new query stream position query object. Use gst_query_unref()
124 * when done with it. A position query is used to query the current position
125 * of playback in the streams, in some format.
127 * the default GstFormat for the new query
131 public static Query
newPosition(GstFormat format
)
133 // GstQuery* gst_query_new_position (GstFormat format);
134 return new Query( cast(GstQuery
*)gst_query_new_position(format
) );
136 * Constructs a new stream duration query object to query in the given format.
137 * Use gst_query_unref() when done with it. A duration query will give the
138 * total length of the stream.
140 * the GstFormat for this duration query
144 public static Query
newDuration(GstFormat format
)
146 // GstQuery* gst_query_new_duration (GstFormat format);
147 return new Query( cast(GstQuery
*)gst_query_new_duration(format
) );
149 * Constructs a new query object for querying seeking properties of
152 * the default GstFormat for the new query
156 public static Query
newSeeking(GstFormat format
)
158 // GstQuery* gst_query_new_seeking (GstFormat format);
159 return new Query(cast(GstQuery
*)gst_query_new_seeking(format
) );
161 * Constructs a new query object for querying formats of
167 public static Query
newFormats()
169 // GstQuery* gst_query_new_formats (void);
170 return new Query(cast(GstQuery
*)gst_query_new_formats() );
172 * Constructs a new segment query object. Use gst_query_unref()
173 * when done with it. A segment query is used to discover information about the
174 * currently configured segment for playback.
176 * the GstFormat for the new query
180 public static Query
newSegment(GstFormat format
)
182 // GstQuery* gst_query_new_segment (GstFormat format);
183 return new Query(cast(GstQuery
*)gst_query_new_segment(format
) );
195 * Get a printable name for the given query type. Do not modify or free.
199 * a reference to the static name of the query.
201 public static char[] typeGetName(GstQueryType query
)
203 // const gchar* gst_query_type_get_name (GstQueryType query);
204 return Str
.toString(gst_query_type_get_name(query
) );
208 * Get the unique quark for the given query type.
212 * the quark associated with the query type
214 public static GQuark
typeToQuark(GstQueryType query
)
216 // GQuark gst_query_type_to_quark (GstQueryType query);
217 return gst_query_type_to_quark(query
);
221 * Create a new GstQueryType based on the nick or return an
222 * already registered query with that nick
224 * The nick of the new query
226 * The description of the new query
228 * A new GstQueryType or an already registered query
229 * with the same nick.
231 public static GstQueryType
typeRegister(char[] nick
, char[] description
)
233 // GstQueryType gst_query_type_register (const gchar *nick, const gchar *description);
234 return gst_query_type_register(Str
.toStringz(nick
), Str
.toStringz(description
));
238 * Get the query type registered with nick.
240 * The nick of the query
242 * The query registered with nick or GST_QUERY_NONE
243 * if the query was not registered.
245 public static GstQueryType
typeGetByNick(char[] nick
)
247 // GstQueryType gst_query_type_get_by_nick (const gchar *nick);
248 return gst_query_type_get_by_nick(Str
.toStringz(nick
));
252 * See if the given GstQueryType is inside the types query types array.
254 * The query array to search
256 * the GstQueryType to find
258 * TRUE if the type is found inside the array
260 public static int typesContains(GstQueryType
* types
, GstQueryType type
)
262 // gboolean gst_query_types_contains (const GstQueryType *types, GstQueryType type);
263 return gst_query_types_contains(types
, type
);
267 * Get details about the given GstQueryType.
271 * The GstQueryTypeDefinition for type or NULL on failure.
273 public static GstQueryTypeDefinition
* typeGetDetails(GstQueryType type
)
275 // const GstQueryTypeDefinition* gst_query_type_get_details (GstQueryType type);
276 return gst_query_type_get_details(type
);
280 * Get a GstIterator of all the registered query types. The definitions
281 * iterated over are read only.
283 * A GstIterator of GstQueryTypeDefinition.
285 public static GstIterator
* typeIterateDefinitions()
287 // GstIterator* gst_query_type_iterate_definitions (void);
288 return gst_query_type_iterate_definitions();
296 * Constructs a new custom application query object. Use gst_query_unref()
301 * a structure for the query
305 public this (GstQueryType type
, Structure structure
)
307 // GstQuery* gst_query_new_application (GstQueryType type, GstStructure *structure);
308 this(cast(GstQuery
*)gst_query_new_application(type
, (structure
is null) ?
null : structure
.getStructureStruct()) );
312 * Get the structure of a query.
316 * The GstStructure of the query. The structure is still owned
317 * by the query and will therefore be freed when the query is unreffed.
319 public Structure
getStructure()
321 // GstStructure* gst_query_get_structure (GstQuery *query);
322 return new Structure( gst_query_get_structure(gstQuery
) );
326 * Constructs a new convert query object. Use gst_query_unref()
327 * when done with it. A convert query is used to ask for a conversion between
328 * one format and another.
330 * the source GstFormat for the new query
332 * the value to convert
334 * the target GstFormat
338 public this (GstFormat srcFormat
, long value
, GstFormat destFormat
)
340 // GstQuery* gst_query_new_convert (GstFormat src_format, gint64 value, GstFormat dest_format);
341 this(cast(GstQuery
*)gst_query_new_convert(srcFormat
, value
, destFormat
) );
345 * Answer a convert query by setting the requested values.
349 * the source GstFormat
353 * the destination GstFormat
355 * the destination value
357 public void setConvert(GstFormat srcFormat
, long srcValue
, GstFormat destFormat
, long destValue
)
359 // void gst_query_set_convert (GstQuery *query, GstFormat src_format, gint64 src_value, GstFormat dest_format, gint64 dest_value);
360 gst_query_set_convert(gstQuery
, srcFormat
, srcValue
, destFormat
, destValue
);
364 * Parse a convert query answer. Any of src_format, src_value, dest_format,
365 * and dest_value may be NULL, in which case that value is omitted.
369 * the storage for the GstFormat of the source value, or NULL
371 * the storage for the source value, or NULL
373 * the storage for the GstFormat of the destination value, or NULL
375 * the storage for the destination value, or NULL
377 public void parseConvert(GstFormat
* srcFormat
, long* srcValue
, GstFormat
* destFormat
, long* destValue
)
379 // void gst_query_parse_convert (GstQuery *query, GstFormat *src_format, gint64 *src_value, GstFormat *dest_format, gint64 *dest_value);
380 gst_query_parse_convert(gstQuery
, srcFormat
, srcValue
, destFormat
, destValue
);
385 * Answer a position query by setting the requested value in the given format.
387 * a GstQuery with query type GST_QUERY_POSITION
389 * the requested GstFormat
391 * the position to set
393 public void setPosition(GstFormat format
, long cur
)
395 // void gst_query_set_position (GstQuery *query, GstFormat format, gint64 cur);
396 gst_query_set_position(gstQuery
, format
, cur
);
400 * Parse a position query, writing the format into format, and the position
401 * into cur, if the respective parameters are non-NULL.
405 * the storage for the GstFormat of the position values (may be NULL)
407 * the storage for the current position (may be NULL)
409 public void parsePosition(GstFormat
* format
, long* cur
)
411 // void gst_query_parse_position (GstQuery *query, GstFormat *format, gint64 *cur);
412 gst_query_parse_position(gstQuery
, format
, cur
);
417 * Answer a duration query by setting the requested value in the given format.
421 * the GstFormat for the duration
423 * the duration of the stream
425 public void setDuration(GstFormat format
, long duration
)
427 // void gst_query_set_duration (GstQuery *query, GstFormat format, gint64 duration);
428 gst_query_set_duration(gstQuery
, format
, duration
);
432 * Parse a duration query answer. Write the format of the duration into format,
433 * and the value into duration, if the respective variables are non-NULL.
437 * the storage for the GstFormat of the duration value, or NULL.
439 * the storage for the total duration, or NULL.
441 public void parseDuration(GstFormat
* format
, long* duration
)
443 // void gst_query_parse_duration (GstQuery *query, GstFormat *format, gint64 *duration);
444 gst_query_parse_duration(gstQuery
, format
, duration
);
448 * Constructs a new latency query object.
449 * Use gst_query_unref() when done with it. A latency query is usually performed
450 * by sinks to compensate for additional latency introduced by elements in the
458 // GstQuery* gst_query_new_latency (void);
459 this(cast(GstQuery
*)gst_query_new_latency() );
463 * Parse a latency query answer.
467 * storage for live or NULL
469 * the storage for the min latency or NULL
471 * the storage for the max latency or NULL
474 public void parseLatency(int* live
, GstClockTime
* minLatency
, GstClockTime
* maxLatency
)
476 // void gst_query_parse_latency (GstQuery *query, gboolean *live, GstClockTime *min_latency, GstClockTime *max_latency);
477 gst_query_parse_latency(gstQuery
, live
, minLatency
, maxLatency
);
481 * Answer a latency query by setting the requested values in the given format.
485 * if there is a live element upstream
487 * the minimal latency of the live element
489 * the maximal latency of the live element
492 public void setLatency(int live
, GstClockTime minLatency
, GstClockTime maxLatency
)
494 // void gst_query_set_latency (GstQuery *query, gboolean live, GstClockTime min_latency, GstClockTime max_latency);
495 gst_query_set_latency(gstQuery
, live
, minLatency
, maxLatency
);
500 * Set the seeking query result fields in query.
504 * the format to set for the segment_start and segment_end values
506 * the seekable flag to set
508 * the segment_start to set
510 * the segment_end to set
512 public void setSeeking(GstFormat format
, int seekable
, long segmentStart
, long segmentEnd
)
514 // void gst_query_set_seeking (GstQuery *query, GstFormat format, gboolean seekable, gint64 segment_start, gint64 segment_end);
515 gst_query_set_seeking(gstQuery
, format
, seekable
, segmentStart
, segmentEnd
);
519 * Parse a seeking query, writing the format into format, and
520 * other results into the passed parameters, if the respective parameters
523 * a GST_QUERY_SEEKING type query GstQuery
525 * the format to set for the segment_start and segment_end values
527 * the seekable flag to set
529 * the segment_start to set
531 * the segment_end to set
533 public void parseSeeking(GstFormat
* format
, int* seekable
, long* segmentStart
, long* segmentEnd
)
535 // void gst_query_parse_seeking (GstQuery *query, GstFormat *format, gboolean *seekable, gint64 *segment_start, gint64 *segment_end);
536 gst_query_parse_seeking(gstQuery
, format
, seekable
, segmentStart
, segmentEnd
);
541 * Set the formats query result fields in query. The number of formats passed
542 * must be equal to n_formats.
546 * the number of formats to set.
548 * A number of GstFormats equal to n_formats.
550 public void setFormats(int nFormats
, ... )
552 // void gst_query_set_formats (GstQuery *query, gint n_formats, ...);
553 gst_query_set_formats(gstQuery
, nFormats
);
557 * Set the formats query result fields in query. The number of formats passed
558 * in the formats array must be equal to n_formats.
562 * the number of formats to set.
564 * An array containing n_formats GstFormat values.
567 public void setFormatsv(int nFormats
, GstFormat
* formats
)
569 // void gst_query_set_formatsv (GstQuery *query, gint n_formats, GstFormat *formats);
570 gst_query_set_formatsv(gstQuery
, nFormats
, formats
);
574 * Parse the number of formats in the formats query.
578 * the number of formats in this query.
581 public void parseFormatsLength(uint* nFormats
)
583 // void gst_query_parse_formats_length (GstQuery *query, guint *n_formats);
584 gst_query_parse_formats_length(gstQuery
, nFormats
);
588 * Parse the format query and retrieve the nth format from it into
589 * format. If the list contains less elements than nth, format will be
590 * set to GST_FORMAT_UNDEFINED.
594 * the nth format to retrieve.
596 * a pointer to store the nth format
599 public void parseFormatsNth(uint nth
, GstFormat
* format
)
601 // void gst_query_parse_formats_nth (GstQuery *query, guint nth, GstFormat *format);
602 gst_query_parse_formats_nth(gstQuery
, nth
, format
);
607 * Answer a segment query by setting the requested values. The normal
608 * playback segment of a pipeline is 0 to duration at the default rate of
609 * 1.0. If a seek was performed on the pipeline to play a different
610 * segment, this query will return the range specified in the last seek.
611 * start_value and stop_value will respectively contain the configured
612 * playback range start and stop values expressed in format.
613 * The values are always between 0 and the duration of the media and
614 * start_value <= stop_value. rate will contain the playback rate. For
615 * negative rates, playback will actually happen from stop_value to
620 * the rate of the segment
622 * the GstFormat of the segment values (start_value and stop_value)
628 public void setSegment(double rate
, GstFormat format
, long startValue
, long stopValue
)
630 // void gst_query_set_segment (GstQuery *query, gdouble rate, GstFormat format, gint64 start_value, gint64 stop_value);
631 gst_query_set_segment(gstQuery
, rate
, format
, startValue
, stopValue
);
635 * Parse a segment query answer. Any of rate, format, start_value, and
636 * stop_value may be NULL, which will cause this value to be omitted.
637 * See gst_query_set_segment() for an explanation of the function arguments.
641 * the storage for the rate of the segment, or NULL
643 * the storage for the GstFormat of the values, or NULL
645 * the storage for the start value, or NULL
647 * the storage for the stop value, or NULL
651 public void parseSegment(double* rate
, GstFormat
* format
, long* startValue
, long* stopValue
)
653 // void gst_query_parse_segment (GstQuery *query, gdouble *rate, GstFormat *format, gint64 *start_value, gint64 *stop_value);
654 gst_query_parse_segment(gstQuery
, rate
, format
, startValue
, stopValue
);