Class Query
- All Implemented Interfaces:
Proxy
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);
-
Constructor Summary
ConstructorDescriptionQuery()
Allocate a new Query.Allocate a new Query.Query
(MemorySegment address) Create a Query proxy instance for the provided memory address.Query
(MiniObject miniObject, QueryType type) Allocate a new Query with the fields set to the provided values.Query
(MiniObject miniObject, QueryType type, Arena arena) Allocate a new Query with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic Query
acceptCaps
(Caps caps) Constructs a new query object for querying ifcaps
are accepted.void
addAllocationMeta
(Type api, @Nullable Structure params) Addapi
withparams
as one of the supported metadata API to this Query.void
addAllocationParam
(@Nullable Allocator allocator, @Nullable AllocationParams params) Addallocator
and itsparams
as a supported memory allocator.void
addAllocationPool
(@Nullable BufferPool pool, int size, int minBuffers, int maxBuffers) Set the pool parameters in this Query.boolean
addBufferingRange
(long start, long stop) Set the buffering-ranges array field in this Query.void
addSchedulingMode
(PadMode mode) Addmode
as one of the supported scheduling modes to this Query.static Query
allocation
(@Nullable Caps caps, boolean needPool) Constructs a new query object for querying the allocation properties.static Query
bitrate()
Constructs a new query object for querying the bitrate.static Query
Constructs a new query object for querying the buffering status of a stream.static Query
Constructs a new query object for querying the caps.static Query
Constructs a new query object for querying the pipeline-local context.static Query
Constructs a new convert query object.copy()
Copies the given query using the copy function of the parentGstStructure
.static Query
Constructs a new custom query object.static Query
drain()
Constructs a new query object for querying the drain state.static Query
Constructs a new stream duration query object to query in the given format.boolean
findAllocationMeta
(Type api, @Nullable Out<Integer> index) Check if this Query has metadataapi
set.static Query
formats()
Constructs a new query object for querying formats of the stream.static MemoryLayout
The memory layout of the native struct.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.Get the structure of a query.static Type
getType()
Get the GType of the Query classboolean
hasSchedulingMode
(PadMode mode) Check if this Query has scheduling mode set.boolean
hasSchedulingModeWithFlags
(PadMode mode, Set<SchedulingFlags> flags) Check if this Query has scheduling mode set andflags
is set in query scheduling flags.boolean
hasSchedulingModeWithFlags
(PadMode mode, SchedulingFlags... flags) Check if this Query has scheduling mode set andflags
is set in query scheduling flags.static Query
latency()
Constructs a new latency query object.void
parseAcceptCaps
(Out<Caps> caps) Get the caps from this Query.void
parseAcceptCapsResult
(@Nullable Out<Boolean> result) Parse the result from this Query and store inresult
.void
parseAllocation
(@Nullable Out<Caps> caps, @Nullable Out<Boolean> needPool) Parse an allocation query, writing the requested caps incaps
and whether a pool is needed inneedPool
, if the respective parameters are non-null
.void
parseBitrate
(@Nullable Out<Integer> nominalBitrate) Get the results of a bitrate query.void
parseBufferingPercent
(@Nullable Out<Boolean> busy, @Nullable Out<Integer> percent) Get the percentage of buffered data.void
parseBufferingRange
(@Nullable Out<Format> format, @Nullable Out<Long> start, @Nullable Out<Long> stop, @Nullable Out<Long> estimatedTotal) Parse an available query, writing the format intoformat
, and other results into the passed parameters, if the respective parameters are non-null
void
parseBufferingStats
(@Nullable Out<BufferingMode> mode, @Nullable Out<Integer> avgIn, @Nullable Out<Integer> avgOut, @Nullable Out<Long> bufferingLeft) Extracts the buffering stats values from this Query.void
Get the filter from the caps this Query.void
parseCapsResult
(@Nullable Out<Caps> caps) Get the caps result from this Query.void
parseContext
(@Nullable Out<Context> context) Get the context from the context this Query.boolean
parseContextType
(@Nullable Out<String> contextType) Parse a context type from an existing GST_QUERY_CONTEXT query.void
parseConvert
(@Nullable Out<Format> srcFormat, @Nullable Out<Long> srcValue, @Nullable Out<Format> destFormat, @Nullable Out<Long> destValue) Parse a convert query answer.void
parseDuration
(@Nullable Out<Format> format, @Nullable Out<Long> duration) Parse a duration query answer.void
parseLatency
(@Nullable Out<Boolean> live, @Nullable ClockTime minLatency, @Nullable ClockTime maxLatency) Parse a latency query answer.void
parseNFormats
(@Nullable Out<Integer> nFormats) Parse the number of formats in the formats this Query.parseNthAllocationMeta
(int index, @Nullable Out<Structure> params) Parse an available query and get the metadata API atindex
of the metadata API array.void
parseNthAllocationParam
(int index, @Nullable Out<Allocator> allocator, @Nullable AllocationParams params) Parse an available query and get the allocator and its params atindex
of the allocator array.void
parseNthAllocationPool
(int index, @Nullable Out<BufferPool> pool, @Nullable Out<Integer> size, @Nullable Out<Integer> minBuffers, @Nullable Out<Integer> maxBuffers) Get the pool parameters in this Query.boolean
parseNthBufferingRange
(int index, @Nullable Out<Long> start, @Nullable Out<Long> stop) Parse an available query and get the start and stop values stored at theindex
of the buffered ranges array.void
parseNthFormat
(int nth, @Nullable Out<Format> format) Parse the format query and retrieve thenth
format from it intoformat
.parseNthSchedulingMode
(int index) Parse an available query and get the scheduling mode atindex
of the scheduling modes array.void
parsePosition
(@Nullable Out<Format> format, @Nullable Out<Long> cur) Parse a position query, writing the format intoformat
, and the position intocur
, if the respective parameters are non-null
.void
parseScheduling
(@Nullable Out<Set<SchedulingFlags>> flags, @Nullable Out<Integer> minsize, @Nullable Out<Integer> maxsize, @Nullable Out<Integer> align) Set the scheduling properties.void
parseSeeking
(@Nullable Out<Format> format, @Nullable Out<Boolean> seekable, @Nullable Out<Long> segmentStart, @Nullable Out<Long> segmentEnd) Parse a seeking query, writing the format intoformat
, and other results into the passed parameters, if the respective parameters are non-null
void
parseSegment
(@Nullable Out<Double> rate, @Nullable Out<Format> format, @Nullable Out<Long> startValue, @Nullable Out<Long> stopValue) Parse a segment query answer.void
parseSelectable
(@Nullable Out<Boolean> selectable) Get the results of a selectable query.void
Parse an URI query, writing the URI intouri
as a newly allocated string, if the respective parameters are non-null
.void
parseUriRedirection
(@Nullable Out<String> uri) Parse an URI query, writing the URI intouri
as a newly allocated string, if the respective parameters are non-null
.void
parseUriRedirectionPermanent
(@Nullable Out<Boolean> permanent) Parse an URI query, and setpermanent
totrue
if there is a redirection and it should be considered permanent.static Query
Constructs a new query stream position query object.Read the value of the fieldmini_object
.readType()
Read the value of the fieldtype
.ref()
Increases the refcount of the given query by one.void
removeNthAllocationMeta
(int index) Remove the metadata API atindex
of the metadata API array.void
removeNthAllocationParam
(int index) Remove the allocation param atindex
of the allocation param array.void
removeNthAllocationPool
(int index) Remove the allocation pool atindex
of the allocation pool array.static boolean
Modifies a pointer to aGstQuery
to point to a differentGstQuery
.static Query
Constructs a new query object for querying the scheduling properties.static Query
Constructs a new query object for querying seeking properties of the stream.static Query
Constructs a new segment query object.static Query
Constructs a new query object for querying the stream selection capability.void
setAcceptCapsResult
(boolean result) Setresult
as the result for the this Query.void
setBitrate
(int nominalBitrate) Set the results of a bitrate query.void
setBufferingPercent
(boolean busy, int percent) Set the percentage of buffered data.void
setBufferingRange
(Format format, long start, long stop, long estimatedTotal) Set the available query result fields in this Query.void
setBufferingStats
(BufferingMode mode, int avgIn, int avgOut, long bufferingLeft) Configures the buffering stats values in this Query.void
setCapsResult
(@Nullable Caps caps) Set thecaps
result in this Query.void
setContext
(@Nullable Context context) Answer a context query by setting the requested context.void
setConvert
(Format srcFormat, long srcValue, Format destFormat, long destValue) Answer a convert query by setting the requested values.void
setDuration
(Format format, long duration) Answer a duration query by setting the requested value in the given format.void
setFormats
(int nFormats, Object... varargs) Set the formats query result fields in this Query.void
setFormatsv
(Format[] formats) Set the formats query result fields in this Query.void
setLatency
(boolean live, ClockTime minLatency, ClockTime maxLatency) Answer a latency query by setting the requested values in the given format.void
setNthAllocationParam
(int index, @Nullable Allocator allocator, @Nullable AllocationParams params) Parse an available query and get the allocator and its params atindex
of the allocator array.void
setNthAllocationPool
(int index, @Nullable BufferPool pool, int size, int minBuffers, int maxBuffers) Set the pool parameters in this Query.void
setPosition
(Format format, long cur) Answer a position query by setting the requested value in the given format.void
setScheduling
(Set<SchedulingFlags> flags, int minsize, int maxsize, int align) Set the scheduling properties.void
setScheduling
(SchedulingFlags flags, int minsize, int maxsize, int align) Set the scheduling properties.void
setSeeking
(Format format, boolean seekable, long segmentStart, long segmentEnd) Set the seeking query result fields in this Query.void
setSegment
(double rate, Format format, long startValue, long stopValue) 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
setUriRedirection
(@Nullable 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.static boolean
Modifies a pointer to aGstQuery
to point to a differentGstQuery
.void
unref()
Decreases the refcount of the query.static Query
uri()
Constructs a new query URI query object.Get the structure of a query.void
writeMiniObject
(MiniObject miniObject) Write a value in the fieldmini_object
.void
Write a value in the fieldtype
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Query
Create a Query proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Query
Allocate a new Query.- Parameters:
arena
- to control the memory allocation scope
-
Query
public Query()Allocate a new Query. The memory is allocated withArena.ofAuto()
. -
Query
Allocate a new Query with the fields set to the provided values.- Parameters:
miniObject
- value for the fieldminiObject
type
- value for the fieldtype
arena
- to control the memory allocation scope
-
Query
Allocate a new Query with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
miniObject
- value for the fieldminiObject
type
- value for the fieldtype
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readMiniObject
Read the value of the fieldmini_object
.- Returns:
- The value of the field
mini_object
-
writeMiniObject
Write a value in the fieldmini_object
.- Parameters:
miniObject
- The new value for the fieldmini_object
-
readType
-
writeType
Write a value in the fieldtype
.- Parameters:
type
- The new value for the fieldtype
-
acceptCaps
-
allocation
-
bitrate
Constructs a new query object for querying the bitrate.Free-function: gst_query_unref()
- Returns:
- a new
GstQuery
-
buffering
-
caps
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 matchingfilter
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()
- Parameters:
filter
- a filter- Returns:
- a new
GstQuery
-
context
-
convert
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()
- Parameters:
srcFormat
- the sourceGstFormat
for the new queryvalue
- the value to convertdestFormat
- the targetGstFormat
- Returns:
- a
GstQuery
-
custom
-
drain
Constructs a new query object for querying the drain state.Free-function: gst_query_unref()
- Returns:
- a new
GstQuery
-
duration
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()
- Parameters:
format
- theGstFormat
for this duration query- Returns:
- a new
GstQuery
-
formats
Constructs a new query object for querying formats of the stream.Free-function: gst_query_unref()
- Returns:
- a new
GstQuery
-
latency
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()
- Returns:
- a
GstQuery
-
position
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()
- Parameters:
format
- the defaultGstFormat
for the new query- Returns:
- a new
GstQuery
-
scheduling
Constructs a new query object for querying the scheduling properties.Free-function: gst_query_unref()
- Returns:
- a new
GstQuery
-
seeking
-
segment
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()
- Parameters:
format
- theGstFormat
for the new query- Returns:
- a new
GstQuery
-
selectable
Constructs a new query object for querying the stream selection capability.Free-function: gst_query_unref()
- Returns:
- a new
GstQuery
-
uri
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()
- Returns:
- a new
GstQuery
-
replace
public static boolean replace(@Nullable @Nullable Out<Query> oldQuery, @Nullable @Nullable Query newQuery) Modifies a pointer to aGstQuery
to point to a differentGstQuery
. The modification is done atomically (so this is useful for ensuring thread safety in some cases), and the reference counts are updated appropriately (the old query is unreffed, the new one is reffed).Either
newQuery
or theGstQuery
pointed to byoldQuery
may benull
.- Parameters:
oldQuery
- pointer to a pointer to aGstQuery
to be replaced.newQuery
- pointer to aGstQuery
that will replace the query pointed to byoldQuery
.- Returns:
true
ifnewQuery
was different fromoldQuery
-
take
public static boolean take(@Nullable @Nullable Out<Query> oldQuery, @Nullable @Nullable Query newQuery) Modifies a pointer to aGstQuery
to point to a differentGstQuery
. This function is similar to gst_query_replace() except that it takes ownership ofnewQuery
.Either
newQuery
or theGstQuery
pointed to byoldQuery
may benull
.- Parameters:
oldQuery
- pointer to a pointer to aGstQuery
to be stolen.newQuery
- pointer to aGstQuery
that will replace the query pointed to byoldQuery
.- Returns:
true
ifnewQuery
was different fromoldQuery
-
addAllocationMeta
-
addAllocationParam
public void addAllocationParam(@Nullable @Nullable Allocator allocator, @Nullable @Nullable AllocationParams params) Addallocator
and itsparams
as a supported memory allocator.- Parameters:
allocator
- the memory allocatorparams
- aGstAllocationParams
-
addAllocationPool
public void addAllocationPool(@Nullable @Nullable BufferPool pool, int size, int minBuffers, int maxBuffers) Set the pool parameters in this Query.- Parameters:
pool
- theGstBufferPool
size
- the buffer sizeminBuffers
- the min buffersmaxBuffers
- the max buffers
-
addBufferingRange
public boolean addBufferingRange(long start, long stop) Set the buffering-ranges array field in this Query. The current last start position of the array should be inferior tostart
.- Parameters:
start
- start position of the rangestop
- stop position of the range- Returns:
- a
gboolean
indicating if the range was added or not.
-
addSchedulingMode
Addmode
as one of the supported scheduling modes to this Query.- Parameters:
mode
- aGstPadMode
-
copy
Copies the given query using the copy function of the parentGstStructure
.Free-function: gst_query_unref
- Returns:
- a new copy of this Query.
-
findAllocationMeta
Check if this Query has metadataapi
set. When this function returnstrue
,index
will contain the index where the requested API and the parameters can be found.- Parameters:
api
- the metadata APIindex
- the index- Returns:
true
whenapi
is in the list of metadata.
-
getNAllocationMetas
public int getNAllocationMetas()Retrieve 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
.
-
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.
- Returns:
- 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.- Returns:
- 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.- Returns:
- 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.- Returns:
- the scheduling mode array size as a
guint
.
-
getStructure
Get 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.
-
hasSchedulingMode
Check if this 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).
- Parameters:
mode
- the scheduling mode- Returns:
true
whenmode
is in the list of scheduling modes.
-
hasSchedulingModeWithFlags
Check if this Query has scheduling mode set andflags
is set in query scheduling flags.- Parameters:
mode
- the scheduling modeflags
-GstSchedulingFlags
- Returns:
true
whenmode
is in the list of scheduling modes andflags
are compatible with query flags.
-
hasSchedulingModeWithFlags
Check if this Query has scheduling mode set andflags
is set in query scheduling flags.- Parameters:
mode
- the scheduling modeflags
-GstSchedulingFlags
- Returns:
true
whenmode
is in the list of scheduling modes andflags
are compatible with query flags.
-
parseAcceptCaps
-
parseAcceptCapsResult
-
parseAllocation
public void parseAllocation(@Nullable @Nullable Out<Caps> caps, @Nullable @Nullable Out<Boolean> needPool) Parse an allocation query, writing the requested caps incaps
and whether a pool is needed inneedPool
, if the respective parameters are non-null
.Pool details can be retrieved using gst_query_get_n_allocation_pools() and gst_query_parse_nth_allocation_pool().
- Parameters:
caps
- TheGstCaps
needPool
- Whether aGstBufferPool
is needed
-
parseBitrate
-
parseBufferingPercent
public void parseBufferingPercent(@Nullable @Nullable Out<Boolean> busy, @Nullable @Nullable Out<Integer> percent) Get the percentage of buffered data. This is a value between 0 and 100. Thebusy
indicator istrue
when the buffering is in progress.- Parameters:
busy
- if buffering is busy, ornull
percent
- a buffering percent, ornull
-
parseBufferingRange
public void parseBufferingRange(@Nullable @Nullable Out<Format> format, @Nullable @Nullable Out<Long> start, @Nullable @Nullable Out<Long> stop, @Nullable @Nullable Out<Long> estimatedTotal) Parse an available query, writing the format intoformat
, and other results into the passed parameters, if the respective parameters are non-null
- Parameters:
format
- the format to set for thesegmentStart
andsegmentEnd
values, ornull
start
- the start to set, ornull
stop
- the stop to set, ornull
estimatedTotal
- estimated total amount of download time remaining in milliseconds, ornull
-
parseBufferingStats
public void parseBufferingStats(@Nullable @Nullable Out<BufferingMode> mode, @Nullable @Nullable Out<Integer> avgIn, @Nullable @Nullable Out<Integer> avgOut, @Nullable @Nullable Out<Long> bufferingLeft) Extracts the buffering stats values from this Query.- Parameters:
mode
- a buffering mode, ornull
avgIn
- the average input rate, ornull
avgOut
- the average output rat, ornull
bufferingLeft
- amount of buffering time left in milliseconds, ornull
-
parseCaps
-
parseCapsResult
-
parseContext
-
parseContextType
-
parseConvert
public void parseConvert(@Nullable @Nullable Out<Format> srcFormat, @Nullable @Nullable Out<Long> srcValue, @Nullable @Nullable Out<Format> destFormat, @Nullable @Nullable Out<Long> destValue) Parse a convert query answer. Any ofsrcFormat
,srcValue
,destFormat
, anddestValue
may benull
, in which case that value is omitted.- Parameters:
srcFormat
- the storage for theGstFormat
of the source value, ornull
srcValue
- the storage for the source value, ornull
destFormat
- the storage for theGstFormat
of the destination value, ornull
destValue
- the storage for the destination value, ornull
-
parseDuration
public void parseDuration(@Nullable @Nullable Out<Format> format, @Nullable @Nullable Out<Long> duration) Parse a duration query answer. Write the format of the duration intoformat
, and the value intoduration
, if the respective variables are non-null
.- Parameters:
format
- the storage for theGstFormat
of the duration value, ornull
.duration
- the storage for the total duration, ornull
.
-
parseLatency
public void parseLatency(@Nullable @Nullable Out<Boolean> live, @Nullable @Nullable ClockTime minLatency, @Nullable @Nullable ClockTime maxLatency) Parse a latency query answer.- Parameters:
live
- storage for live ornull
minLatency
- the storage for the min latency ornull
maxLatency
- the storage for the max latency ornull
-
parseNFormats
-
parseNthAllocationMeta
Parse an available query and get the metadata API atindex
of the metadata API array.- Parameters:
index
- position in the metadata API array to readparams
- API specific parameters- Returns:
- a
GType
of the metadata API atindex
.
-
parseNthAllocationParam
public void parseNthAllocationParam(int index, @Nullable @Nullable Out<Allocator> allocator, @Nullable @Nullable AllocationParams params) Parse an available query and get the allocator and its params atindex
of the allocator array.- Parameters:
index
- position in the allocator array to readallocator
- variable to hold the resultparams
- parameters for the allocator
-
parseNthAllocationPool
public void parseNthAllocationPool(int index, @Nullable @Nullable Out<BufferPool> pool, @Nullable @Nullable Out<Integer> size, @Nullable @Nullable Out<Integer> minBuffers, @Nullable @Nullable Out<Integer> maxBuffers) Get the pool parameters in this Query.Unref
pool
with gst_object_unref() when it's not needed any more.- Parameters:
index
- index to parsepool
- theGstBufferPool
size
- the buffer sizeminBuffers
- the min buffersmaxBuffers
- the max buffers
-
parseNthBufferingRange
public boolean parseNthBufferingRange(int index, @Nullable @Nullable Out<Long> start, @Nullable @Nullable Out<Long> stop) Parse an available query and get the start and stop values stored at theindex
of the buffered ranges array.- Parameters:
index
- position in the buffered-ranges array to readstart
- the start position to set, ornull
stop
- the stop position to set, ornull
- Returns:
- a
gboolean
indicating if the parsing succeeded.
-
parseNthFormat
Parse the format query and retrieve thenth
format from it intoformat
. If the list contains less elements thannth
,format
will be set to GST_FORMAT_UNDEFINED.- Parameters:
nth
- the nth format to retrieve.format
- a pointer to store the nth format
-
parseNthSchedulingMode
Parse an available query and get the scheduling mode atindex
of the scheduling modes array.- Parameters:
index
- position in the scheduling modes array to read- Returns:
- a
GstPadMode
of the scheduling mode atindex
.
-
parsePosition
public void parsePosition(@Nullable @Nullable Out<Format> format, @Nullable @Nullable Out<Long> cur) Parse a position query, writing the format intoformat
, and the position intocur
, if the respective parameters are non-null
.- Parameters:
format
- the storage for theGstFormat
of the position values (may benull
)cur
- the storage for the current position (may benull
)
-
parseScheduling
public void parseScheduling(@Nullable @Nullable Out<Set<SchedulingFlags>> flags, @Nullable @Nullable Out<Integer> minsize, @Nullable @Nullable Out<Integer> maxsize, @Nullable @Nullable Out<Integer> align) Set the scheduling properties.- Parameters:
flags
-GstSchedulingFlags
minsize
- the suggested minimum size of pull requestsmaxsize
- the suggested maximum size of pull requests:align
- the suggested alignment of pull requests
-
parseSeeking
public void parseSeeking(@Nullable @Nullable Out<Format> format, @Nullable @Nullable Out<Boolean> seekable, @Nullable @Nullable Out<Long> segmentStart, @Nullable @Nullable Out<Long> segmentEnd) Parse a seeking query, writing the format intoformat
, and other results into the passed parameters, if the respective parameters are non-null
- Parameters:
format
- the format to set for thesegmentStart
andsegmentEnd
values, ornull
seekable
- the seekable flag to set, ornull
segmentStart
- the segment_start to set, ornull
segmentEnd
- the segment_end to set, ornull
-
parseSegment
public void parseSegment(@Nullable @Nullable Out<Double> rate, @Nullable @Nullable Out<Format> format, @Nullable @Nullable Out<Long> startValue, @Nullable @Nullable Out<Long> stopValue) Parse a segment query answer. Any ofrate
,format
,startValue
, andstopValue
may benull
, which will cause this value to be omitted.See gst_query_set_segment() for an explanation of the function arguments.
- Parameters:
rate
- the storage for the rate of the segment, ornull
format
- the storage for theGstFormat
of the values, ornull
startValue
- the storage for the start value, ornull
stopValue
- the storage for the stop value, ornull
-
parseSelectable
-
parseUri
-
parseUriRedirection
-
parseUriRedirectionPermanent
Parse an URI query, and setpermanent
totrue
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.- Parameters:
permanent
- if the URI redirection is permanent (may benull
)
-
ref
-
removeNthAllocationMeta
public void removeNthAllocationMeta(int index) Remove the metadata API atindex
of the metadata API array.- Parameters:
index
- position in the metadata API array to remove
-
removeNthAllocationParam
public void removeNthAllocationParam(int index) Remove the allocation param atindex
of the allocation param array.- Parameters:
index
- position in the allocation param array to remove
-
removeNthAllocationPool
public void removeNthAllocationPool(int index) Remove the allocation pool atindex
of the allocation pool array.- Parameters:
index
- position in the allocation pool array to remove
-
setAcceptCapsResult
public void setAcceptCapsResult(boolean result) Setresult
as the result for the this Query.- Parameters:
result
- the result to set
-
setBitrate
public void setBitrate(int nominalBitrate) 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).- Parameters:
nominalBitrate
- 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. Thebusy
indicator istrue
when the buffering is in progress.- Parameters:
busy
- if buffering is busypercent
- a buffering percent
-
setBufferingRange
Set the available query result fields in this Query.- Parameters:
format
- the format to set for thestart
andstop
valuesstart
- the start to setstop
- the stop to setestimatedTotal
- estimated total amount of download time remaining in milliseconds
-
setBufferingStats
Configures the buffering stats values in this Query.- Parameters:
mode
- a buffering modeavgIn
- the average input rateavgOut
- the average output ratebufferingLeft
- amount of buffering time left in milliseconds
-
setCapsResult
Set thecaps
result in this Query.- Parameters:
caps
- A pointer to the caps
-
setContext
Answer a context query by setting the requested context.- Parameters:
context
- the requestedGstContext
-
setConvert
-
setDuration
Answer a duration query by setting the requested value in the given format.- Parameters:
format
- theGstFormat
for the durationduration
- the duration of the stream
-
setFormats
Set the formats query result fields in this Query. The number of formats passed must be equal tonFormats
.- Parameters:
nFormats
- the number of formats to set.varargs
- A number ofGstFormats
equal tonFormats
.
-
setFormatsv
Set the formats query result fields in this Query. The number of formats passed in theformats
array must be equal tonFormats
.- Parameters:
formats
- an array containingnFormats
GstFormat
values.
-
setLatency
Answer a latency query by setting the requested values in the given format.- Parameters:
live
- if there is a live element upstreamminLatency
- the minimal latency of the upstream elementsmaxLatency
- the maximal latency of the upstream elements
-
setNthAllocationParam
public void setNthAllocationParam(int index, @Nullable @Nullable Allocator allocator, @Nullable @Nullable AllocationParams params) Parse an available query and get the allocator and its params atindex
of the allocator array.- Parameters:
index
- position in the allocator array to setallocator
- new allocator to setparams
- parameters for the allocator
-
setNthAllocationPool
public void setNthAllocationPool(int index, @Nullable @Nullable BufferPool pool, int size, int minBuffers, int maxBuffers) Set the pool parameters in this Query.- Parameters:
index
- index to modifypool
- theGstBufferPool
size
- the buffer sizeminBuffers
- the min buffersmaxBuffers
- the max buffers
-
setPosition
Answer a position query by setting the requested value in the given format.- Parameters:
format
- the requestedGstFormat
cur
- the position to set
-
setScheduling
Set the scheduling properties.- Parameters:
flags
-GstSchedulingFlags
minsize
- the suggested minimum size of pull requestsmaxsize
- the suggested maximum size of pull requestsalign
- the suggested alignment of pull requests
-
setScheduling
Set the scheduling properties.- Parameters:
flags
-GstSchedulingFlags
minsize
- the suggested minimum size of pull requestsmaxsize
- the suggested maximum size of pull requestsalign
- the suggested alignment of pull requests
-
setSeeking
Set the seeking query result fields in this Query.- Parameters:
format
- the format to set for thesegmentStart
andsegmentEnd
valuesseekable
- the seekable flag to setsegmentStart
- the segment_start to setsegmentEnd
- the segment_end to set
-
setSegment
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.startValue
andstopValue
will respectively contain the configured playback range start and stop values expressed informat
. The values are always between 0 and the duration of the media andstartValue
<=stopValue
.rate
will contain the playback rate. For negative rates, playback will actually happen fromstopValue
tostartValue
.- Parameters:
rate
- the rate of the segmentformat
- theGstFormat
of the segment values (startValue
andstopValue
)startValue
- the start valuestopValue
- 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 totrue
.- Parameters:
selectable
- Whether the element can handle stream selection.
-
setUri
Answer a URI query by setting the requested URI.- Parameters:
uri
- the URI to set
-
setUriRedirection
Answer a URI query by setting the requested URI redirection.- Parameters:
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.- Parameters:
permanent
- whether the redirect is permanent or not
-
unref
public void unref()Decreases the refcount of the query. If the refcount reaches 0, the query will be freed. -
writableStructure
Get the structure of a query. This method should be called with a writable this Query so that the returned structure is guaranteed to be writable.- Returns:
- the
GstStructure
of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.
-