Package ch.bailu.gtk.gst
Klasse Query
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gst.Query
- Alle implementierten Schnittstellen:
PointerInterface
Queries can be performed on pads (gst_pad_query()) and elements
(gst_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:
(gst_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:
<!-- language="C" --> 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);
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addAllocationMeta
(long api, Structure params) Add @api with @params as one of the supported metadata API to @query.void
addAllocationParam
(Allocator allocator, AllocationParams params) Add @allocator and its @params as a supported memory allocator.void
addAllocationPool
(BufferPool pool, int size, int min_buffers, int max_buffers) Set the pool parameters in @query.boolean
addBufferingRange
(long start, long stop) Set the buffering-ranges array field in @query.void
addSchedulingMode
(int mode) Add @mode as one of the supported scheduling modes to @query.static ClassHandler
int
the #GstQueryTypestatic int
int
Retrieve the number of values currently stored in the
meta API array of the query's structure.int
Retrieve the number of values currently stored in the
allocator params array of the query's structure.int
Retrieve the number of values currently stored in the
pool array of the query's structure.int
Retrieve the number of values currently stored in the
buffered-ranges array of the query's structure.int
Retrieve the number of values currently stored in the
scheduling mode array of the query's structure.static long
static TypeSystem.TypeSize
Get the structure of a query.static long
static TypeSystem.TypeSize
boolean
hasSchedulingMode
(int mode) Check if @query has scheduling mode set.boolean
hasSchedulingModeWithFlags
(int mode, int flags) Check if @query has scheduling mode set and @flags is set in
query scheduling flags.static Query
newAcceptCapsQuery
(Caps caps) Constructs a new query object for querying if @caps are accepted.static Query
newAllocationQuery
(Caps caps, boolean need_pool) Constructs a new query object for querying the allocation properties.static Query
Constructs a new query object for querying the bitrate.static Query
newBufferingQuery
(int format) Constructs a new query object for querying the buffering status of
a stream.static Query
newCapsQuery
(Caps filter) Constructs a new query object for querying the caps.static Query
newContextQuery
(Str context_type) Constructs a new query object for querying the pipeline-local context.static Query
newContextQuery
(String context_type) Constructs a new query object for querying the pipeline-local context.static Query
newConvertQuery
(int src_format, long value, int dest_format) Constructs a new convert query object.static Query
newCustomQuery
(int type, Structure structure) Constructs a new custom query object.static Query
Constructs a new query object for querying the drain state.static Query
newDurationQuery
(int format) Constructs a new stream duration query object to query in the given format.static Query
Constructs a new query object for querying formats of
the stream.static Query
Constructs a new latency query object.static Query
newPositionQuery
(int format) Constructs a new query stream position query object.static Query
Constructs a new query object for querying the scheduling properties.static Query
newSeekingQuery
(int format) Constructs a new query object for querying seeking properties of
the stream.static Query
newSegmentQuery
(int format) Constructs a new segment query object.static Query
Constructs a new query object for querying the stream selection capability.static Query
Constructs a new query URI query object.void
parseAcceptCapsResult
(Int result) Parse the result from @query and store in @result.void
parseBufferingPercent
(Int busy, Int percent) Get the percentage of buffered data.void
parseNthFormat
(int nth, Int format) Parse the format query and retrieve the @nth format from it into
@format.int
parseNthSchedulingMode
(int index) Parse an available query and get the scheduling mode
at @index of the scheduling modes array.void
parseScheduling
(Int flags, Int minsize, Int maxsize, Int align) Set the scheduling properties.void
parseSelectable
(Int selectable) Get the results of a selectable query.void
parseUriRedirectionPermanent
(Int permanent) Parse an URI query, and set @permanent to %TRUE if there is a redirection
and it should be considered permanent.void
removeNthAllocationMeta
(int index) Remove the metadata API at @index of the metadata API array.void
removeNthAllocationParam
(int index) Remove the allocation param at @index of the allocation param array.void
removeNthAllocationPool
(int index) Remove the allocation pool at @index of the allocation pool array.void
setAcceptCapsResult
(boolean result) Set @result as the result for the @query.void
setBitrate
(int nominal_bitrate) Set the results of a bitrate query.void
setBufferingPercent
(boolean busy, int percent) Set the percentage of buffered data.void
setBufferingRange
(int format, long start, long stop, long estimated_total) Set the available query result fields in @query.void
setBufferingStats
(int mode, int avg_in, int avg_out, long buffering_left) Configures the buffering stats values in @query.void
setCapsResult
(Caps caps) Set the @caps result in @query.void
setContext
(Context context) Answer a context query by setting the requested context.void
setConvert
(int src_format, long src_value, int dest_format, long dest_value) Answer a convert query by setting the requested values.void
setDuration
(int format, long duration) Answer a duration query by setting the requested value in the given format.void
setFieldType
(int type) the #GstQueryTypevoid
setFormats
(int n_formats, Object... _ellipsis) Set the formats query result fields in @query.void
setLatency
(boolean live, long min_latency, long max_latency) Answer a latency query by setting the requested values in the given format.void
setNthAllocationParam
(int index, Allocator allocator, AllocationParams params) Parse an available query and get the allocator and its params
at @index of the allocator array.void
setNthAllocationPool
(int index, BufferPool pool, int size, int min_buffers, int max_buffers) Set the pool parameters in @query.void
setPosition
(int format, long cur) Answer a position query by setting the requested value in the given format.void
setScheduling
(int flags, int minsize, int maxsize, int align) Set the scheduling properties.void
setSeeking
(int format, boolean seekable, long segment_start, long segment_end) Set the seeking query result fields in @query.void
setSegment
(double rate, int format, long start_value, long stop_value) Answer a segment query by setting the requested values.void
setSelectable
(boolean selectable) Set the results of a selectable query.void
Answer a URI query by setting the requested URI.void
Answer a URI query by setting the requested URI.void
setUriRedirection
(Str uri) Answer a URI query by setting the requested URI redirection.void
setUriRedirection
(String uri) Answer a URI query by setting the requested URI redirection.void
setUriRedirectionPermanent
(boolean permanent) Answer a URI query by setting the requested URI redirection
to permanent or not.Get the structure of a query.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
MINI_OBJECT
The parent #GstMiniObject type
Private field: direct-type- Siehe auch:
-
TYPE
the #GstQueryType- Siehe auch:
-
-
Konstruktordetails
-
Query
-
Query
public Query()
-
-
Methodendetails
-
getClassHandler
-
setFieldType
public void setFieldType(int type) the #GstQueryType -
getFieldType
public int getFieldType()the #GstQueryType -
newAcceptCapsQuery
Constructs a new query object for querying if @caps are accepted.
Free-function: gst_query_unref()- Parameter:
caps
- a fixed #GstCaps- Gibt zurück:
- a new #GstQuery
-
newAllocationQuery
Constructs a new query object for querying the allocation properties.
Free-function: gst_query_unref()- Parameter:
caps
- the negotiated capsneed_pool
- return a pool- Gibt zurück:
- a new #GstQuery
-
newBitrateQuery
Constructs a new query object for querying the bitrate.
Free-function: gst_query_unref()- Gibt zurück:
- a new #GstQuery
-
newBufferingQuery
Constructs a new query object for querying the buffering status of
a stream.
Free-function: gst_query_unref()- Parameter:
format
- the default #GstFormat for the new query- Gibt zurück:
- a new #GstQuery
-
newCapsQuery
Constructs a new query object for querying the caps.
The CAPS query should return the allowable caps for a pad in the context
of the element's state, its link to other elements, and the devices or files
it has opened. These caps must be a subset of the pad template caps. In the
NULL state with no links, the CAPS query should ideally return the same caps
as the pad template. In rare circumstances, an object property can affect
the caps returned by the CAPS query, but this is discouraged.
For most filters, the caps returned by CAPS query is directly affected by the
allowed caps on other pads. For demuxers and decoders, the caps returned by
the srcpad's getcaps function is directly related to the stream data. Again,
the CAPS query should return the most specific caps it reasonably can, since this
helps with autoplugging.
The @filter is used to restrict the result caps, only the caps matching
@filter should be returned from the CAPS query. Specifying a filter might
greatly reduce the amount of processing an element needs to do.
Free-function: gst_query_unref()- Parameter:
filter
- a filter- Gibt zurück:
- a new #GstQuery
-
newContextQuery
Constructs a new query object for querying the pipeline-local context.
Free-function: gst_query_unref()- Parameter:
context_type
- Context type to query- Gibt zurück:
- a new #GstQuery
-
newContextQuery
Constructs a new query object for querying the pipeline-local context.
Free-function: gst_query_unref()- Parameter:
context_type
- Context type to query- Gibt zurück:
- a new #GstQuery
-
newConvertQuery
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.
Free-function: gst_query_unref()- Parameter:
src_format
- the source #GstFormat for the new queryvalue
- the value to convertdest_format
- the target #GstFormat- Gibt zurück:
- a #GstQuery
-
newCustomQuery
Constructs a new custom query object. Use gst_query_unref()
when done with it.
Free-function: gst_query_unref()- Parameter:
type
- the query typestructure
- a structure for the query- Gibt zurück:
- a new #GstQuery
-
newDrainQuery
Constructs a new query object for querying the drain state.
Free-function: gst_query_unref()- Gibt zurück:
- a new #GstQuery
-
newDurationQuery
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.
Free-function: gst_query_unref()- Parameter:
format
- the #GstFormat for this duration query- Gibt zurück:
- a new #GstQuery
-
newFormatsQuery
Constructs a new query object for querying formats of
the stream.
Free-function: gst_query_unref()- Gibt zurück:
- a new #GstQuery
-
newLatencyQuery
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.
Free-function: gst_query_unref()- Gibt zurück:
- a #GstQuery
-
newPositionQuery
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.
Free-function: gst_query_unref()- Parameter:
format
- the default #GstFormat for the new query- Gibt zurück:
- a new #GstQuery
-
newSchedulingQuery
Constructs a new query object for querying the scheduling properties.
Free-function: gst_query_unref()- Gibt zurück:
- a new #GstQuery
-
newSeekingQuery
Constructs a new query object for querying seeking properties of
the stream.
Free-function: gst_query_unref()- Parameter:
format
- the default #GstFormat for the new query- Gibt zurück:
- a new #GstQuery
-
newSegmentQuery
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.
Free-function: gst_query_unref()- Parameter:
format
- the #GstFormat for the new query- Gibt zurück:
- a new #GstQuery
-
newSelectableQuery
Constructs a new query object for querying the stream selection capability.
Free-function: gst_query_unref()- Gibt zurück:
- a new #GstQuery
-
newUriQuery
Constructs 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.
Free-function: gst_query_unref()- Gibt zurück:
- a new #GstQuery
-
addAllocationMeta
Add @api with @params as one of the supported metadata API to @query.- Parameter:
api
- the metadata APIparams
- API specific parameters
-
addAllocationParam
Add @allocator and its @params as a supported memory allocator.- Parameter:
allocator
- the memory allocatorparams
- a #GstAllocationParams
-
addAllocationPool
public void addAllocationPool(@Nullable BufferPool pool, int size, int min_buffers, int max_buffers) Set the pool parameters in @query.- Parameter:
pool
- the #GstBufferPoolsize
- the buffer sizemin_buffers
- the min buffersmax_buffers
- the max buffers
-
addBufferingRange
public boolean addBufferingRange(long start, long stop) Set the buffering-ranges array field in @query. The current last
start position of the array should be inferior to @start.- Parameter:
start
- start position of the rangestop
- stop position of the range- Gibt zurück:
- a #gboolean indicating if the range was added or not.
-
addSchedulingMode
public void addSchedulingMode(int mode) Add @mode as one of the supported scheduling modes to @query.- Parameter:
mode
- a #GstPadMode
-
getNAllocationMetas
public int getNAllocationMetas()Retrieve the number of values currently stored in the
meta API array of the query's structure.- Gibt zurück:
- the metadata API array size as a #guint.
-
getNAllocationParams
public int getNAllocationParams()Retrieve the number of values currently stored in the
allocator params array of the query's structure.
If no memory allocator is specified, the downstream element can handle
the default memory allocator. The first memory allocator in the query
should be generic and allow mapping to system memory, all following
allocators should be ordered by preference with the preferred one first.- Gibt zurück:
- the allocator array size as a #guint.
-
getNAllocationPools
public int getNAllocationPools()Retrieve the number of values currently stored in the
pool array of the query's structure.- Gibt zurück:
- the pool array size as a #guint.
-
getNBufferingRanges
public int getNBufferingRanges()Retrieve the number of values currently stored in the
buffered-ranges array of the query's structure.- Gibt zurück:
- the range array size as a #guint.
-
getNSchedulingModes
public int getNSchedulingModes()Retrieve the number of values currently stored in the
scheduling mode array of the query's structure.- Gibt zurück:
- the scheduling mode array size as a #guint.
-
getStructure
Get the structure of a query.- Gibt zurück:
- the #GstStructure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.
-
hasSchedulingMode
public boolean hasSchedulingMode(int mode) Check if @query has scheduling mode set.
> When checking if upstream supports pull mode, it is usually not
> enough to just check for GST_PAD_MODE_PULL with this function, you
> also want to check whether the scheduling flags returned by
> gst_query_parse_scheduling() have the seeking flag set (meaning
> random access is supported, not only sequential pulls).- Parameter:
mode
- the scheduling mode- Gibt zurück:
- %TRUE when @mode is in the list of scheduling modes.
-
hasSchedulingModeWithFlags
public boolean hasSchedulingModeWithFlags(int mode, int flags) Check if @query has scheduling mode set and @flags is set in
query scheduling flags.- Parameter:
mode
- the scheduling modeflags
- #GstSchedulingFlags- Gibt zurück:
- %TRUE when @mode is in the list of scheduling modes and @flags are compatible with query flags.
-
parseAcceptCapsResult
Parse the result from @query and store in @result.- Parameter:
result
- location for the result
-
parseBufferingPercent
Get the percentage of buffered data. This is a value between 0 and 100.
The @busy indicator is %TRUE when the buffering is in progress.- Parameter:
busy
- if buffering is busy, or %NULLpercent
- a buffering percent, or %NULL
-
parseNthFormat
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.- Parameter:
nth
- the nth format to retrieve.format
- a pointer to store the nth format
-
parseNthSchedulingMode
public int parseNthSchedulingMode(int index) Parse an available query and get the scheduling mode
at @index of the scheduling modes array.- Parameter:
index
- position in the scheduling modes array to read- Gibt zurück:
- a #GstPadMode of the scheduling mode at @index.
-
parseScheduling
public void parseScheduling(@Nullable Int flags, @Nullable Int minsize, @Nullable Int maxsize, @Nullable Int align) Set the scheduling properties.- Parameter:
flags
- #GstSchedulingFlagsminsize
- the suggested minimum size of pull requestsmaxsize
- the suggested maximum size of pull requests:align
- the suggested alignment of pull requests
-
parseSelectable
Get the results of a selectable query. See also gst_query_set_selectable().- Parameter:
selectable
- The resulting stream selection capability
-
parseUriRedirectionPermanent
Parse 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 the URI, otherwise
they should make all future requests to the original URI.- Parameter:
permanent
- if the URI redirection is permanent (may be %NULL)
-
removeNthAllocationMeta
public void removeNthAllocationMeta(int index) Remove the metadata API at @index of the metadata API array.- Parameter:
index
- position in the metadata API array to remove
-
removeNthAllocationParam
public void removeNthAllocationParam(int index) Remove the allocation param at @index of the allocation param array.- Parameter:
index
- position in the allocation param array to remove
-
removeNthAllocationPool
public void removeNthAllocationPool(int index) Remove the allocation pool at @index of the allocation pool array.- Parameter:
index
- position in the allocation pool array to remove
-
setAcceptCapsResult
public void setAcceptCapsResult(boolean result) Set @result as the result for the @query.- Parameter:
result
- the result to set
-
setBitrate
public void setBitrate(int nominal_bitrate) Set 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).- Parameter:
nominal_bitrate
- the nominal bitrate in bits per second
-
setBufferingPercent
public void setBufferingPercent(boolean busy, int percent) Set the percentage of buffered data. This is a value between 0 and 100.
The @busy indicator is %TRUE when the buffering is in progress.- Parameter:
busy
- if buffering is busypercent
- a buffering percent
-
setBufferingRange
public void setBufferingRange(int format, long start, long stop, long estimated_total) Set the available query result fields in @query.- Parameter:
format
- the format to set for the @start and @stop valuesstart
- the start to setstop
- the stop to setestimated_total
- estimated total amount of download time remaining in milliseconds
-
setBufferingStats
public void setBufferingStats(int mode, int avg_in, int avg_out, long buffering_left) Configures the buffering stats values in @query.- Parameter:
mode
- a buffering modeavg_in
- the average input rateavg_out
- the average output ratebuffering_left
- amount of buffering time left in milliseconds
-
setCapsResult
Set the @caps result in @query.- Parameter:
caps
- A pointer to the caps
-
setContext
Answer a context query by setting the requested context.- Parameter:
context
- the requested #GstContext
-
setConvert
public void setConvert(int src_format, long src_value, int dest_format, long dest_value) Answer a convert query by setting the requested values.- Parameter:
src_format
- the source #GstFormatsrc_value
- the source valuedest_format
- the destination #GstFormatdest_value
- the destination value
-
setDuration
public void setDuration(int format, long duration) Answer a duration query by setting the requested value in the given format.- Parameter:
format
- the #GstFormat for the durationduration
- the duration of the stream
-
setFormats
Set the formats query result fields in @query. The number of formats passed
must be equal to @n_formats.- Parameter:
n_formats
- the number of formats to set._ellipsis
- A number of @GstFormats equal to @n_formats.
-
setLatency
public void setLatency(boolean live, long min_latency, long max_latency) Answer a latency query by setting the requested values in the given format.- Parameter:
live
- if there is a live element upstreammin_latency
- the minimal latency of the upstream elementsmax_latency
- the maximal latency of the upstream elements
-
setNthAllocationParam
public void setNthAllocationParam(int index, @Nullable Allocator allocator, @Nullable AllocationParams params) Parse an available query and get the allocator and its params
at @index of the allocator array.- Parameter:
index
- position in the allocator array to setallocator
- new allocator to setparams
- parameters for the allocator
-
setNthAllocationPool
public void setNthAllocationPool(int index, @Nullable BufferPool pool, int size, int min_buffers, int max_buffers) Set the pool parameters in @query.- Parameter:
index
- index to modifypool
- the #GstBufferPoolsize
- the buffer sizemin_buffers
- the min buffersmax_buffers
- the max buffers
-
setPosition
public void setPosition(int format, long cur) Answer a position query by setting the requested value in the given format.- Parameter:
format
- the requested #GstFormatcur
- the position to set
-
setScheduling
public void setScheduling(int flags, int minsize, int maxsize, int align) Set the scheduling properties.- Parameter:
flags
- #GstSchedulingFlagsminsize
- the suggested minimum size of pull requestsmaxsize
- the suggested maximum size of pull requestsalign
- the suggested alignment of pull requests
-
setSeeking
public void setSeeking(int format, boolean seekable, long segment_start, long segment_end) Set the seeking query result fields in @query.- Parameter:
format
- the format to set for the @segment_start and @segment_end valuesseekable
- the seekable flag to setsegment_start
- the segment_start to setsegment_end
- the segment_end to set
-
setSegment
public void setSegment(double rate, int format, long start_value, long stop_value) 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.- Parameter:
rate
- the rate of the segmentformat
- the #GstFormat of the segment values (@start_value and @stop_value)start_value
- the start valuestop_value
- the stop value
-
setSelectable
public void setSelectable(boolean selectable) Set the results of a selectable query. If the element answering the query can
handle stream selection, @selectable should be set to %TRUE.- Parameter:
selectable
- Whether the element can handle stream selection.
-
setUri
Answer a URI query by setting the requested URI.- Parameter:
uri
- the URI to set
-
setUri
Answer a URI query by setting the requested URI.- Parameter:
uri
- the URI to set
-
setUriRedirection
Answer a URI query by setting the requested URI redirection.- Parameter:
uri
- the URI to set
-
setUriRedirection
Answer a URI query by setting the requested URI redirection.- Parameter:
uri
- the URI to set
-
setUriRedirectionPermanent
public void setUriRedirectionPermanent(boolean permanent) Answer a URI query by setting the requested URI redirection
to permanent or not.- Parameter:
permanent
- whether the redirect is permanent or not
-
writableStructure
Get the structure of a query. This method should be called with a writable
@query so that the returned structure is guaranteed to be writable.- Gibt zurück:
- the #GstStructure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-