gst.query
Module for [Query] class
class Query
Types 1
classQuery : gobject.boxed.Boxed
Queries can be performed on pads (gst.pad.Pad.query) and elements (gst.element.Element.query). Please note that some queries might need a running pipeline to work.
Queries can be created using the gst_query_new_*() functions. Query values can be set using gst_query_set_*(), and parsed using gst_query_parse_*() 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);Methods
gst.mini_object.MiniObject miniObject() @property nothrowGet `miniObject` field. Returns: The parent #GstMiniObject typevoid type(gst.types.QueryType propval) @property nothrowSet `type` field. Params: propval = the #GstQueryTypegst.query.Query newAcceptCaps(gst.caps.Caps caps) static nothrowConstructs a new query object for querying if caps are accepted.gst.query.Query newAllocation(gst.caps.Caps caps, bool needPool) static nothrowConstructs a new query object for querying the allocation properties.gst.query.Query newBuffering(gst.types.Format format) static nothrowConstructs a new query object for querying the buffering status of a stream.gst.query.Query newCaps(gst.caps.Caps filter) static nothrowConstructs a new query object for querying the caps.gst.query.Query newContext(string contextType) static nothrowConstructs a new query object for querying the pipeline-local context.gst.query.Query newConvert(gst.types.Format srcFormat, long value, gst.types.Format destFormat) static nothrowConstructs 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.gst.query.Query newCustom(gst.types.QueryType type, gst.structure.Structure structure = null) static nothrowConstructs a new custom query object. Use gst_query_unref() when done with it.gst.query.Query newDrain() static nothrowConstructs a new query object for querying the drain state.gst.query.Query newDuration(gst.types.Format format) static nothrowConstructs 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.gst.query.Query newFormats() static nothrowConstructs a new query object for querying formats of the stream.gst.query.Query newLatency() static nothrowConstructs 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 pipe...gst.query.Query newPosition(gst.types.Format format) static nothrowConstructs 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.gst.query.Query newScheduling() static nothrowConstructs a new query object for querying the scheduling properties.gst.query.Query newSeeking(gst.types.Format format) static nothrowConstructs a new query object for querying seeking properties of the stream.gst.query.Query newSegment(gst.types.Format format) static nothrowConstructs 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.gst.query.Query newSelectable() static nothrowConstructs a new query object for querying the stream selection capability.gst.query.Query newUri() static nothrowConstructs a new query URI query object. Use gst_query_unref() when done with it. An URI query is used to query the current URI that is used by the source or sink.void addAllocationMeta(gobject.types.GType api, gst.structure.Structure params = null) nothrowAdd api with params as one of the supported metadata API to query.void addAllocationParam(gst.allocator.Allocator allocator, gst.allocation_params.AllocationParams params) nothrowAdd allocator and its params as a supported memory allocator.void addAllocationPool(gst.buffer_pool.BufferPool pool, uint size, uint minBuffers, uint maxBuffers) nothrowSet the pool parameters in query.bool addBufferingRange(long start, long stop) nothrowSet the buffering-ranges array field in query. The current last start position of the array should be inferior to start.void addSchedulingMode(gst.types.PadMode mode) nothrowAdd mode as one of the supported scheduling modes to query.bool findAllocationMeta(gobject.types.GType api, out uint index) nothrowCheck if query has metadata api set. When this function returns true, index will contain the index where the requested API and the parameters can be found.uint getNAllocationMetas() nothrowRetrieve the number of values currently stored in the meta API array of the query's structure. Returns: the metadata API array size as a #guint.uint getNAllocationParams() nothrowRetrieve the number of values currently stored in the allocator params array of the query's structure.uint getNAllocationPools() nothrowRetrieve the number of values currently stored in the pool array of the query's structure. Returns: the pool array size as a #guint.uint getNBufferingRanges() nothrowRetrieve the number of values currently stored in the buffered-ranges array of the query's structure. Returns: the range array size as a #guint.uint getNSchedulingModes() nothrowRetrieve the number of values currently stored in the scheduling mode array of the query's structure. Returns: the scheduling mode array size as a #guint.gst.structure.Structure getStructure() nothrowGet the structure of a query. Returns: the #GstStructure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.bool hasSchedulingModeWithFlags(gst.types.PadMode mode, gst.types.SchedulingFlags flags) nothrowCheck if query has scheduling mode set and flags is set in query scheduling flags.void parseAcceptCaps(out gst.caps.Caps caps) nothrowGet the caps from query. The caps remains valid as long as query remains valid.void parseAllocation(out gst.caps.Caps caps, out bool needPool) nothrowParse an allocation query, writing the requested caps in caps and whether a pool is needed in need_pool, if the respective parameters are non-null.void parseBitrate(out uint nominalBitrate) nothrowGet the results of a bitrate query. See also [gst.query.Query.setBitrate].void parseBufferingPercent(out bool busy, out int percent) nothrowGet the percentage of buffered data. This is a value between 0 and 100. The busy indicator is true when the buffering is in progress.void parseBufferingRange(out gst.types.Format format, out long start, out long stop, out long estimatedTotal) nothrowParse an available query, writing the format into format, and other results into the passed parameters, if the respective parameters are non-nullvoid parseBufferingStats(out gst.types.BufferingMode mode, out int avgIn, out int avgOut, out long bufferingLeft) nothrowExtracts the buffering stats values from query.void parseCaps(out gst.caps.Caps filter) nothrowGet the filter from the caps query. The caps remains valid as long as query remains valid.void parseCapsResult(out gst.caps.Caps caps) nothrowGet the caps result from query. The caps remains valid as long as query remains valid.void parseContext(out gst.context.Context context) nothrowGet the context from the context query. The context remains valid as long as query remains valid.bool parseContextType(out string contextType) nothrowParse a context type from an existing GST_QUERY_CONTEXT query.void parseConvert(out gst.types.Format srcFormat, out long srcValue, out gst.types.Format destFormat, out long destValue) nothrowParse 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.void parseDuration(out gst.types.Format format, out long duration) nothrowParse a duration query answer. Write the format of the duration into format, and the value into duration, if the respective variables are non-null.void parseLatency(out bool live, out gst.types.ClockTime minLatency, out gst.types.ClockTime maxLatency) nothrowParse a latency query answer.gobject.types.GType parseNthAllocationMeta(uint index, out gst.structure.Structure params) nothrowParse an available query and get the metadata API at index of the metadata API array.void parseNthAllocationParam(uint index, out gst.allocator.Allocator allocator, out gst.allocation_params.AllocationParams params) nothrowParse an available query and get the allocator and its params at index of the allocator array.void parseNthAllocationPool(uint index, out gst.buffer_pool.BufferPool pool, out uint size, out uint minBuffers, out uint maxBuffers) nothrowGet the pool parameters in query.bool parseNthBufferingRange(uint index, out long start, out long stop) nothrowParse an available query and get the start and stop values stored at the index of the buffered ranges array.void parseNthFormat(uint nth, out gst.types.Format format) nothrowParse 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.gst.types.PadMode parseNthSchedulingMode(uint index) nothrowParse an available query and get the scheduling mode at index of the scheduling modes array.void parsePosition(out gst.types.Format format, out long cur) nothrowParse a position query, writing the format into format, and the position into cur, if the respective parameters are non-null.void parseScheduling(out gst.types.SchedulingFlags flags, out int minsize, out int maxsize, out int align_) nothrowSet the scheduling properties.void parseSeeking(out gst.types.Format format, out bool seekable, out long segmentStart, out long segmentEnd) nothrowParse a seeking query, writing the format into format, and other results into the passed parameters, if the respective parameters are non-nullvoid parseSegment(out double rate, out gst.types.Format format, out long startValue, out long stopValue) nothrowParse a segment query answer. Any of rate, format, start_value, and stop_value may be null, which will cause this value to be omitted.void parseSelectable(out bool selectable) nothrowGet the results of a selectable query. See also [gst.query.Query.setSelectable].void parseUri(out string uri) nothrowParse an URI query, writing the URI into uri as a newly allocated string, if the respective parameters are non-null. Free the string with [glib.global.gfree] after usage.void parseUriRedirection(out string uri) nothrowParse an URI query, writing the URI into uri as a newly allocated string, if the respective parameters are non-null. Free the string with [glib.global.gfree] after usage.void parseUriRedirectionPermanent(out bool permanent) nothrowParse an URI query, and set permanent to true if there is a redirection and it should be considered permanent. If a redirection is permanent, applications should update their internal storage of th...void removeNthAllocationMeta(uint index) nothrowRemove the metadata API at index of the metadata API array.void removeNthAllocationParam(uint index) nothrowRemove the allocation param at index of the allocation param array.void removeNthAllocationPool(uint index) nothrowRemove the allocation pool at index of the allocation pool array.void setBitrate(uint nominalBitrate) nothrowSet the results of a bitrate query. The nominal bitrate is the average bitrate expected over the length of the stream as advertised in file headers (or similar).void setBufferingPercent(bool busy, int percent) nothrowSet the percentage of buffered data. This is a value between 0 and 100. The busy indicator is true when the buffering is in progress.void setBufferingRange(gst.types.Format format, long start, long stop, long estimatedTotal) nothrowSet the available query result fields in query.void setBufferingStats(gst.types.BufferingMode mode, int avgIn, int avgOut, long bufferingLeft) nothrowConfigures the buffering stats values in query.void setContext(gst.context.Context context = null) nothrowAnswer a context query by setting the requested context.void setConvert(gst.types.Format srcFormat, long srcValue, gst.types.Format destFormat, long destValue) nothrowAnswer a convert query by setting the requested values.void setDuration(gst.types.Format format, long duration) nothrowAnswer a duration query by setting the requested value in the given format.void setFormatsv(gst.types.Format[] formats) nothrowSet the formats query result fields in query. The number of formats passed in the formats array must be equal to n_formats.void setLatency(bool live, gst.types.ClockTime minLatency, gst.types.ClockTime maxLatency) nothrowAnswer a latency query by setting the requested values in the given format.void setNthAllocationParam(uint index, gst.allocator.Allocator allocator, gst.allocation_params.AllocationParams params) nothrowParse an available query and get the allocator and its params at index of the allocator array.void setNthAllocationPool(uint index, gst.buffer_pool.BufferPool pool, uint size, uint minBuffers, uint maxBuffers) nothrowSet the pool parameters in query.void setPosition(gst.types.Format format, long cur) nothrowAnswer a position query by setting the requested value in the given format.void setScheduling(gst.types.SchedulingFlags flags, int minsize, int maxsize, int align_) nothrowSet the scheduling properties.void setSeeking(gst.types.Format format, bool seekable, long segmentStart, long segmentEnd) nothrowSet the seeking query result fields in query.void setSegment(double rate, gst.types.Format format, long startValue, long stopValue) nothrowAnswer 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 diff...void setSelectable(bool selectable) nothrowSet the results of a selectable query. If the element answering the query can handle stream selection, selectable should be set to true.void setUriRedirection(string uri = null) nothrowAnswer a URI query by setting the requested URI redirection.void setUriRedirectionPermanent(bool permanent) nothrowAnswer a URI query by setting the requested URI redirection to permanent or not.gst.structure.Structure writableStructure() nothrowGet the structure of a query. This method should be called with a writable query so that the returned structure is guaranteed to be writable. Returns: the #GstStructure of the query. The structure ...Constructors
this(gst.types.QueryType type = gst.types.QueryType.init)Create a `query.Query` boxed type. Params: type = the #GstQueryType