Next: GstRegistry, Previous: GstPlugin, Up: Top
Dynamically register new query types. Provide functions to create queries, and to set and parse values in them.
GstQuery functions are used to register a new query types to the gstreamer core. Query types can be used to perform queries on pads and elements.
Queries can be created using the gst-query-new-xxx
functions. Query
values can be set using gst-query-set-xxx
, and parsed using
gst-query-parse-xxx
helpers.
The following example shows how to query the duration of a pipeline:
GstQuery *query; gboolean res; query = gst_query_new_duration (GST_FORMAT_TIME); res = gst_element_query (pipeline, query); if (res) { gint64 duration; gst_query_parse_duration (query, NULL, &duration); g_print ("duration = %"GST_TIME_FORMAT, GST_TIME_ARGS (duration)); } else { g_print ("duration query failed..."); } gst_query_unref (query);
Last reviewed on 2006-02-14 (0.10.4)
<gst-query-type*>
) (ret mchars
)Get a printable name for the given query type. Do not modify or free.
- query
- the query type
- ret
- a reference to the static name of the query.
<gst-query-type*>
) (ret unsigned-int
)Get the unique quark for the given query type.
- query
- the query type
- ret
- the quark associated with the query type
mchars
) (description mchars
) (ret <gst-query-type>
)Create a new GstQueryType based on the nick or return an already registered query with that nick
- nick
- The nick of the new query
- description
- The description of the new query
- ret
- A new GstQueryType or an already registered query with the same nick.
mchars
) (ret <gst-query-type>
)Get the query type registered with nick.
- nick
- The nick of the query
- ret
- The query registered with nick or
<gst-query-none>
if the query was not registered.
<gst-query-type*>
) (type <gst-query-type>
) (ret bool
)See if the given
<gst-query-type>
is inside the types query types array.
- types
- The query array to search
- type
- the
<gst-query-type>
to find- ret
- TRUE if the type is found inside the array
<gst-iterator*>
)Get a
<gst-iterator>
of all the registered query types. The definitions iterated over are read only.
- ret
- A
<gst-iterator>
of<gst-query-type-definition>
.
<gst-query-type>
) (structure <gst-structure>
) (ret <gst-query>
)Constructs a new custom application query object. Use
gst-query-unref
when done with it.
- type
- the query type
- structure
- a structure for the query
- ret
- a
<gst-query>
<gst-query>
) (ret <gst-structure>
)Get the structure of a query.
- query
- a
<gst-query>
- ret
- The
<gst-structure>
of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.
<gst-format>
) (value int64
) (dest_format <gst-format>
) (ret <gst-query>
)Constructs a new convert query object. Use
gst-query-unref
when done with it. A convert query is used to ask for a conversion between one format and another.
- src-format
- the source
<gst-format>
for the new query- value
- the value to convert
- dest-format
- the target
<gst-format>
- ret
- A
<gst-query>
<gst-query>
) (src_format <gst-format>
) (src_value int64
) (dest_format <gst-format>
) (dest_value int64
)Answer a convert query by setting the requested values.
- query
- a
<gst-query>
- src-format
- the source
<gst-format>
- src-value
- the source value
- dest-format
- the destination
<gst-format>
- dest-value
- the destination value
<gst-query>
) (src_format <gst-format*>
) (dest_format <gst-format*>
) (src_value int64
) (dest_value int64
)Parse a convert query answer. Any of src-format, src-value, dest-format, and dest-value may be NULL, in which case that value is omitted.
- query
- a
<gst-query>
- src-format
- the storage for the
<gst-format>
of the source value, or NULL- src-value
- the storage for the source value, or NULL
- dest-format
- the storage for the
<gst-format>
of the destination value, or NULL- dest-value
- the storage for the destination value, or NULL
<gst-format>
) (ret <gst-query>
)Constructs a new query stream position query object. Use
gst-query-unref
when done with it. A position query is used to query the current position of playback in the streams, in some format.
- format
- the default
<gst-format>
for the new query- ret
- A
<gst-query>
<gst-query>
) (format <gst-format>
) (cur int64
)Answer a position query by setting the requested value in the given format.
- query
- a
<gst-query>
with query type GST_QUERY_POSITION- format
- the requested
<gst-format>
- cur
- the position to set
<gst-query>
) (format <gst-format*>
) (cur int64
)Parse a position query, writing the format into format, and the position into cur, if the respective parameters are non-NULL.
- query
- a
<gst-query>
- format
- the storage for the
<gst-format>
of the position values (may be NULL)- cur
- the storage for the current position (may be NULL)
<gst-format>
) (ret <gst-query>
)Constructs a new stream duration query object to query in the given format. Use
gst-query-unref
when done with it. A duration query will give the total length of the stream.
- format
- the
<gst-format>
for this duration query- ret
- A
<gst-query>
<gst-query>
) (format <gst-format>
) (duration int64
)Answer a duration query by setting the requested value in the given format.
- query
- a
<gst-query>
- format
- the
<gst-format>
for the duration- duration
- the duration of the stream
<gst-query>
) (format <gst-format*>
) (duration int64
)Parse a duration query answer. Write the format of the duration into format, and the value into duration, if the respective variables are non-NULL.
- query
- a
<gst-query>
- format
- the storage for the
<gst-format>
of the duration value, or NULL.- duration
- the storage for the total duration, or NULL.
<gst-format>
) (ret <gst-query>
)Constructs a new query object for querying seeking properties of the stream.
- format
- the default
<gst-format>
for the new query- ret
- A
<gst-query>
<gst-query>
) (format <gst-format>
) (seekable bool
) (segment_start int64
) (segment_end int64
)Set the seeking query result fields in query.
- query
- a
<gst-query>
- format
- the format to set for the segment-start and segment-end values
- seekable
- the seekable flag to set
- segment-start
- the segment_start to set
- segment-end
- the segment_end to set
<gst-query>
) (format <gst-format*>
) (seekable bool
) (segment_start int64
) (segment_end int64
)Parse a seeking query, writing the format into format, and other results into the passed parameters, if the respective parameters are non-NULL
- query
- a GST_QUERY_SEEKING type query
<gst-query>
- format
- the format to set for the segment-start and segment-end values
- seekable
- the seekable flag to set
- segment-start
- the segment_start to set
- segment-end
- the segment_end to set
<gst-query>
)Constructs a new query object for querying formats of the stream.
- ret
- A
<gst-query>
Since 0.10.4
<gst-query>
) (n_formats int
) (formats <gst-format*>
)Set the formats query result fields in query. The number of formats passed in the formats array must be equal to n-formats.
- query
- a
<gst-query>
- n-formats
- the number of formats to set.
- formats
- An array containing n-formatsgst-format values.
Since 0.10.4
<gst-query>
) (n_formats unsigned-int
)Parse the number of formats in the formats query.
- query
- a
<gst-query>
- n-formats
- the number of formats in this query.
Since 0.10.4
<gst-query>
) (nth unsigned-int
) (format <gst-format*>
)Parse the format query and retrieve the nth format from it into format. If the list contains less elements than nth, format will be set to GST_FORMAT_UNDEFINED.
- query
- a
<gst-query>
- nth
- the nth format to retrieve.
- format
- a pointer to store the nth format
Since 0.10.4
<gst-format>
) (ret <gst-query>
)Constructs a new segment query object. Use
gst-query-unref
when done with it. A segment query is used to discover information about the currently configured segment for playback.
- format
- the
<gst-format>
for the new query- ret
- a
<gst-query>
<gst-query>
) (rate double
) (format <gst-format>
) (start_value int64
) (stop_value int64
)Answer a segment query by setting the requested values. The normal playback segment of a pipeline is 0 to duration at the default rate of 1.0. If a seek was performed on the pipeline to play a different segment, this query will return the range specified in the last seek.
start-value and stop-value will respectively contain the configured playback range start and stop values expressed in format. The values are always between 0 and the duration of the media and start-value <= stop-value. rate will contain the playback rate. For negative rates, playback will actually happen from stop-value to start-value.
- query
- a
<gst-query>
- rate
- the rate of the segment
- format
- the
<gst-format>
of the segment values (start-value and stop-value)- start-value
- the start value
- stop-value
- the stop value
<gst-query>
) (format <gst-format*>
) (rate double
) (start_value int64
) (stop_value int64
)Parse a segment query answer. Any of rate, format, start-value, and stop-value may be NULL, which will cause this value to be omitted.
See
gst-query-set-segment
for an explanation of the function arguments.
- query
- a
<gst-query>
- rate
- the storage for the rate of the segment, or NULL
- format
- the storage for the
<gst-format>
of the values, or NULL- start-value
- the storage for the start value, or NULL
- stop-value
- the storage for the stop value, or NULL