2005-06-30 12:18:19 +00:00
|
|
|
DRAFT Query
|
|
|
|
-----------
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
Purpose
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
Queries are used to get information about the stream.
|
|
|
|
A query is started on a specific pad and travels up or downstream.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
Types of queries
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
- get length of stream
|
|
|
|
- get position in stream
|
|
|
|
- get seeking capabilities
|
|
|
|
- get latency
|
|
|
|
- convert one value to another
|
|
|
|
- query supported formats
|
|
|
|
- query internal links.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
Current implementation
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
The current implementation of query requires pads to implement the
|
|
|
|
following functions:
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
gboolean (*GstPadConvertFunction) (GstPad *pad,
|
|
|
|
GstFormat src_format, gint64 src_value,
|
|
|
|
GstFormat *dest_format, gint64 *dest_value);
|
|
|
|
gboolean (*GstPadQueryFunction) (GstPad *pad, GstQueryType type,
|
|
|
|
GstFormat *format, gint64 *value);
|
|
|
|
GList* (*GstPadIntLinkFunction) (GstPad *pad);
|
|
|
|
const GstFormat* (*GstPadFormatsFunction) (GstPad *pad);
|
|
|
|
const GstEventMask* (*GstPadEventMaskFunction) (GstPad *pad);
|
|
|
|
const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
Most of these functions are not very extensible in particular,
|
|
|
|
the queryfunction can only return one value.
|
|
|
|
|
|
|
|
|
|
|
|
Requirements
|
|
|
|
|
|
|
|
- multiple return values, grouped together when they make sense.
|
|
|
|
- one pad function to perform the query
|
|
|
|
- extensible queries.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
Proposition
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-09-24 11:22:26 +00:00
|
|
|
- define GstQuery extending GstMiniObject and containing a GstStructure (see GstMessage)
|
2005-06-30 12:18:19 +00:00
|
|
|
- define standard query types (see proposed types)
|
|
|
|
- define methods to create a parse the results in the GstQuery.
|
|
|
|
- define pad method:
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
gboolean (*GstPadQueryFunction) (GstPad *pad, GstQuery *query);
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
pad returns result in query structure and TRUE as result or FALSE when
|
|
|
|
query is not supported.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
Proposed types
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
- GST_QUERY_SEEKING:
|
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
get info on how seeking can be done
|
|
|
|
- getrange, with/without offset/size
|
|
|
|
- ranges where seeking is efficient (for caching network sources)
|
|
|
|
- flags describing seeking behaviour (forward, backward, segments,
|
2005-06-30 12:18:19 +00:00
|
|
|
play backwards, ...)
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-06-30 12:18:19 +00:00
|
|
|
- GST_QUERY_POSITION:
|
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
get info on current position of the stream in stream_time.
|
|
|
|
|
|
|
|
- GST_QUERY_DURATION:
|
|
|
|
|
|
|
|
get info on the total duration of the stream.
|
2005-06-30 12:18:19 +00:00
|
|
|
|
|
|
|
- GST_QUERY_LATENCY:
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
get amount of latency introduced in the pipeline.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
- GST_QUERY_SEGMENT:
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
get info about the currently configured playback segment.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
- GST_QUERY_CONVERT:
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
convert format/value to another format/value pair.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
- GST_QUERY_FORMATS:
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
return list of supported formats that can be used for GST_QUERY_CONVERT.
|
2005-04-21 09:37:34 +00:00
|
|
|
|