Query

Description 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: Last reviewed on 2006-02-14 (0.10.4)

class Query {}

Constructors

this
this(GstQuery* gstQuery)

Sets our main struct and passes it to the parent class

this
this(GstQueryType type, Structure structure)

Constructs a new custom application query object. Use gst_query_unref() when done with it.

this
this(GstFormat srcFormat, long value, GstFormat destFormat)

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.

this
this()

Constructs a new latency query object. Use gst_query_unref() when done with it. A latency query is usually performed by sinks to compensate for additional latency introduced by elements in the pipeline.

Members

Functions

getQueryStruct
GstQuery* getQueryStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

getStructure
Structure getStructure()

Get the structure of a query.

parseConvert
void parseConvert(GstFormat srcFormat, long srcValue, GstFormat destFormat, long destValue)

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.

parseDuration
void parseDuration(GstFormat format, long duration)

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.

parseFormatsLength
void parseFormatsLength(uint nFormats)

Parse the number of formats in the formats query.

parseFormatsNth
void parseFormatsNth(uint nth, GstFormat 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.

parseLatency
void parseLatency(int live, GstClockTime minLatency, GstClockTime maxLatency)

Parse a latency query answer.

parsePosition
void parsePosition(GstFormat format, long cur)

Parse a position query, writing the format into format, and the position into cur, if the respective parameters are non-NULL.

parseSeeking
void parseSeeking(GstFormat format, int seekable, long segmentStart, long segmentEnd)

Parse a seeking query, writing the format into format, and other results into the passed parameters, if the respective parameters are non-NULL

parseSegment
void parseSegment(double rate, GstFormat format, long startValue, long stopValue)

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.

setConvert
void setConvert(GstFormat srcFormat, long srcValue, GstFormat destFormat, long destValue)

Answer a convert query by setting the requested values.

setDuration
void setDuration(GstFormat format, long duration)

Answer a duration query by setting the requested value in the given format.

setFormatsv
void setFormatsv(GstFormat[] formats)

Set the formats query result fields in query. The number of formats passed in the formats array must be equal to n_formats.

setLatency
void setLatency(int live, GstClockTime minLatency, GstClockTime maxLatency)

Answer a latency query by setting the requested values in the given format.

setPosition
void setPosition(GstFormat format, long cur)

Answer a position query by setting the requested value in the given format.

setSeeking
void setSeeking(GstFormat format, int seekable, long segmentStart, long segmentEnd)

Set the seeking query result fields in query.

setSegment
void setSegment(double rate, GstFormat format, long startValue, long stopValue)

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.

Static functions

newDuration
Query newDuration(GstFormat format)
Undocumented in source. Be warned that the author may not have intended to support it.
newFormats
Query newFormats()
Undocumented in source. Be warned that the author may not have intended to support it.
newPosition
Query newPosition(GstFormat format)

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.

newSeeking
Query newSeeking(GstFormat format)
Undocumented in source. Be warned that the author may not have intended to support it.
newSegment
Query newSegment(GstFormat format)
Undocumented in source. Be warned that the author may not have intended to support it.
typeGetByNick
GstQueryType typeGetByNick(string nick)

Get the query type registered with nick.

typeGetDetails
GstQueryTypeDefinition* typeGetDetails(GstQueryType type)

Get details about the given GstQueryType.

typeGetName
string typeGetName(GstQueryType query)

Get a printable name for the given query type. Do not modify or free.

typeIterateDefinitions
Iterator typeIterateDefinitions()

Get a GstIterator of all the registered query types. The definitions iterated over are read only.

typeRegister
GstQueryType typeRegister(string nick, string description)

Create a new GstQueryType based on the nick or return an already registered query with that nick

typeToQuark
GQuark typeToQuark(GstQueryType query)

Get the unique quark for the given query type.

typesContains
int typesContains(GstQueryType* types, GstQueryType type)

See if the given GstQueryType is inside the types query types array.

Variables

gstQuery
GstQuery* gstQuery;

the main Gtk struct

Meta