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
ConstructorsConstructorDescriptionQuery()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 QueryacceptCaps(Caps caps) Constructs a new query object for querying ifcapsare accepted.voidaddAllocationMeta(Type api, @Nullable Structure params) Addapiwithparamsas one of the supported metadata API toquery.voidaddAllocationParam(@Nullable Allocator allocator, @Nullable AllocationParams params) Addallocatorand itsparamsas a supported memory allocator.voidaddAllocationPool(@Nullable BufferPool pool, int size, int minBuffers, int maxBuffers) Set the pool parameters inquery.booleanaddBufferingRange(long start, long stop) Set the buffering-ranges array field inquery.The current last start position of the array should be inferior tostart.voidaddSchedulingMode(PadMode mode) Addmodeas one of the supported scheduling modes toquery.static Queryallocation(@Nullable Caps caps, boolean needPool) Constructs a new query object for querying the allocation properties.static Querybitrate()Constructs a new query object for querying the bitrate.static QueryConstructs a new query object for querying the buffering status of a stream.static QueryConstructs a new query object for querying the caps.static QueryConstructs a new query object for querying the pipeline-local context.static QueryConstructs a new convert query object.copy()Copies the given query using the copy function of the parentGstStructure.static QueryConstructs a new custom query object.static Querydrain()Constructs a new query object for querying the drain state.static QueryConstructs a new stream duration query object to query in the given format.booleanfindAllocationMeta(Type api, @Nullable Out<Integer> index) Check if this Query has metadataapiset.static Queryformats()Constructs a new query object for querying formats of the stream.static MemoryLayoutThe memory layout of the native struct.intRetrieve the number of values currently stored in the meta API array of the query's structure.intRetrieve the number of values currently stored in the allocator params array of the query's structure.intRetrieve the number of values currently stored in the pool array of the query's structure.intRetrieve the number of values currently stored in the buffered-ranges array of the query's structure.intRetrieve the number of values currently stored in the scheduling mode array of the query's structure.@Nullable StructureGet the structure of a query.static @Nullable TypegetType()Get the GType of the Query classbooleanhasSchedulingMode(PadMode mode) Check if this Query has scheduling mode set.booleanhasSchedulingModeWithFlags(PadMode mode, Set<SchedulingFlags> flags) Check if this Query has scheduling mode set andflagsis set in query scheduling flags.booleanhasSchedulingModeWithFlags(PadMode mode, SchedulingFlags... flags) Check if this Query has scheduling mode set andflagsis set in query scheduling flags.static Querylatency()Constructs a new latency query object.voidparseAcceptCaps(Out<Caps> caps) Get the caps fromquery.The caps remains valid as long as this Query remains valid.voidparseAcceptCapsResult(@Nullable Out<Boolean> result) Parse the result from this Query and store inresult.voidparseAllocation(@Nullable Out<Caps> caps, @Nullable Out<Boolean> needPool) Parse an allocation query, writing the requested caps incapsand whether a pool is needed inneedPool,if the respective parameters are non-null.voidparseBitrate(@Nullable Out<Integer> nominalBitrate) Get the results of a bitrate query.voidparseBufferingPercent(@Nullable Out<Boolean> busy, @Nullable Out<Integer> percent) Get the percentage of buffered data.voidparseBufferingRange(@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-nullvoidparseBufferingStats(@Nullable Out<BufferingMode> mode, @Nullable Out<Integer> avgIn, @Nullable Out<Integer> avgOut, @Nullable Out<Long> bufferingLeft) Extracts the buffering stats values fromquery.voidGet the filter from the capsquery.The caps remains valid as long as this Query remains valid.voidparseCapsResult(@Nullable Out<Caps> caps) Get the caps result fromquery.The caps remains valid as long as this Query remains valid.voidparseContext(@Nullable Out<Context> context) Get the context from the contextquery.The context remains valid as long as this Query remains valid.booleanparseContextType(@Nullable Out<String> contextType) Parse a context type from an existing GST_QUERY_CONTEXT query.voidparseConvert(@Nullable Out<Format> srcFormat, @Nullable Out<Long> srcValue, @Nullable Out<Format> destFormat, @Nullable Out<Long> destValue) Parse a convert query answer.voidparseDuration(@Nullable Out<Format> format, @Nullable Out<Long> duration) Parse a duration query answer.voidparseLatency(@Nullable Out<Boolean> live, @Nullable ClockTime minLatency, @Nullable ClockTime maxLatency) Parse a latency query answer.voidparseNFormats(@Nullable Out<Integer> nFormats) Parse the number of formats in the formatsquery.parseNthAllocationMeta(int index, @Nullable Out<Structure> params) Parse an available query and get the metadata API atindexof the metadata API array.voidparseNthAllocationParam(int index, @Nullable Out<Allocator> allocator, @Nullable AllocationParams params) Parse an available query and get the allocator and its params atindexof the allocator array.voidparseNthAllocationPool(int index, @Nullable Out<BufferPool> pool, @Nullable Out<Integer> size, @Nullable Out<Integer> minBuffers, @Nullable Out<Integer> maxBuffers) Get the pool parameters inquery.booleanparseNthBufferingRange(int index, @Nullable Out<Long> start, @Nullable Out<Long> stop) Parse an available query and get the start and stop values stored at theindexof the buffered ranges array.voidparseNthFormat(int nth, @Nullable Out<Format> format) Parse the format query and retrieve thenthformat from it intoformat.If the list contains less elements thannth,formatwill be set to GST_FORMAT_UNDEFINED.parseNthSchedulingMode(int index) Parse an available query and get the scheduling mode atindexof the scheduling modes array.voidparsePosition(@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.voidparseScheduling(@Nullable Out<Set<SchedulingFlags>> flags, @Nullable Out<Integer> minsize, @Nullable Out<Integer> maxsize, @Nullable Out<Integer> align) Set the scheduling properties.voidparseSeeking(@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-nullvoidparseSegment(@Nullable Out<Double> rate, @Nullable Out<Format> format, @Nullable Out<Long> startValue, @Nullable Out<Long> stopValue) Parse a segment query answer.voidparseSelectable(@Nullable Out<Boolean> selectable) Get the results of a selectable query.voidParse an URI query, writing the URI intourias a newly allocated string, if the respective parameters are non-null.voidparseUriRedirection(@Nullable Out<String> uri) Parse an URI query, writing the URI intourias a newly allocated string, if the respective parameters are non-null.voidparseUriRedirectionPermanent(@Nullable Out<Boolean> permanent) Parse an URI query, and setpermanenttotrueif there is a redirection and it should be considered permanent.static QueryConstructs a new query stream position query object.@Nullable MiniObjectRead the value of the fieldmini_object.readType()Read the value of the fieldtype.ref()Increases the refcount of the given query by one.voidremoveNthAllocationMeta(int index) Remove the metadata API atindexof the metadata API array.voidremoveNthAllocationParam(int index) Remove the allocation param atindexof the allocation param array.voidremoveNthAllocationPool(int index) Remove the allocation pool atindexof the allocation pool array.static booleanModifies a pointer to aGstQueryto point to a differentGstQuery.static QueryConstructs a new query object for querying the scheduling properties.static QueryConstructs a new query object for querying seeking properties of the stream.static QueryConstructs a new segment query object.static QueryConstructs a new query object for querying the stream selection capability.voidsetAcceptCapsResult(boolean result) Setresultas the result for thequery.voidsetBitrate(int nominalBitrate) Set the results of a bitrate query.voidsetBufferingPercent(boolean busy, int percent) Set the percentage of buffered data.voidsetBufferingRange(Format format, long start, long stop, long estimatedTotal) Set the available query result fields inquery.voidsetBufferingStats(BufferingMode mode, int avgIn, int avgOut, long bufferingLeft) Configures the buffering stats values inquery.voidsetCapsResult(@Nullable Caps caps) Set thecapsresult inquery.voidsetContext(@Nullable Context context) Answer a context query by setting the requested context.voidsetConvert(Format srcFormat, long srcValue, Format destFormat, long destValue) Answer a convert query by setting the requested values.voidsetDuration(Format format, long duration) Answer a duration query by setting the requested value in the given format.voidsetFormats(int nFormats, Object... varargs) Set the formats query result fields inquery.The number of formats passed must be equal tonFormats.voidsetFormatsv(@Nullable Format @Nullable [] formats) Set the formats query result fields inquery.The number of formats passed in theformatsarray must be equal tonFormats.voidsetLatency(boolean live, ClockTime minLatency, ClockTime maxLatency) Answer a latency query by setting the requested values in the given format.voidsetNthAllocationParam(int index, @Nullable Allocator allocator, @Nullable AllocationParams params) Parse an available query and get the allocator and its params atindexof the allocator array.voidsetNthAllocationPool(int index, @Nullable BufferPool pool, int size, int minBuffers, int maxBuffers) Set the pool parameters inquery.voidsetPosition(Format format, long cur) Answer a position query by setting the requested value in the given format.voidsetScheduling(Set<SchedulingFlags> flags, int minsize, int maxsize, int align) Set the scheduling properties.voidsetScheduling(SchedulingFlags flags, int minsize, int maxsize, int align) Set the scheduling properties.voidsetSeeking(Format format, boolean seekable, long segmentStart, long segmentEnd) Set the seeking query result fields inquery.voidsetSegment(double rate, Format format, long startValue, long stopValue) Answer a segment query by setting the requested values.voidsetSelectable(boolean selectable) Set the results of a selectable query.voidAnswer a URI query by setting the requested URI.voidsetUriRedirection(@Nullable String uri) Answer a URI query by setting the requested URI redirection.voidsetUriRedirectionPermanent(boolean permanent) Answer a URI query by setting the requested URI redirection to permanent or not.static booleanModifies a pointer to aGstQueryto point to a differentGstQuery.voidunref()Decreases the refcount of the query.static Queryuri()Constructs a new query URI query object.Get the structure of a query.voidwriteMiniObject(@Nullable MiniObject miniObject) Write a value in the fieldmini_object.voidWrite a value in the fieldtype.Methods inherited from class org.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 fieldminiObjecttype- value for the fieldtypearena- 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 fieldminiObjecttype- 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 - Since:
- 1.16
-
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
filteris used to restrict the result caps, only the caps matchingfiltershould 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 sourceGstFormatfor 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- theGstFormatfor 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 defaultGstFormatfor 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- theGstFormatfor 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 - Since:
- 1.22
-
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
Modifies a pointer to aGstQueryto 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
newQueryor theGstQuerypointed to byoldQuerymay benull.- Parameters:
oldQuery- pointer to a pointer to aGstQueryto be replaced.newQuery- pointer to aGstQuerythat will replace the query pointed to byoldQuery.- Returns:
trueifnewQuerywas different fromoldQuery
-
take
Modifies a pointer to aGstQueryto point to a differentGstQuery. This function is similar to gst_query_replace() except that it takes ownership ofnewQuery.Either
newQueryor theGstQuerypointed to byoldQuerymay benull.- Parameters:
oldQuery- pointer to a pointer to aGstQueryto be stolen.newQuery- pointer to aGstQuerythat will replace the query pointed to byoldQuery.- Returns:
trueifnewQuerywas different fromoldQuery- Since:
- 1.16
-
addAllocationMeta
-
addAllocationParam
Addallocatorand itsparamsas a supported memory allocator.- Parameters:
allocator- the memory allocatorparams- aGstAllocationParams
-
addAllocationPool
Set the pool parameters inquery.- Parameters:
pool- theGstBufferPoolsize- the buffer sizeminBuffers- the min buffersmaxBuffers- the max buffers
-
addBufferingRange
public boolean addBufferingRange(long start, long stop) Set the buffering-ranges array field inquery.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
gbooleanindicating if the range was added or not.
-
addSchedulingMode
Addmodeas one of the supported scheduling modes toquery.- 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
q.
-
findAllocationMeta
Check if this Query has metadataapiset. When this function returnstrue,indexwill contain the index where the requested API and the parameters can be found.- Parameters:
api- the metadata APIindex- the index- Returns:
truewhenapiis 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
GstStructureof 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:
truewhenmodeis in the list of scheduling modes.
-
hasSchedulingModeWithFlags
Check if this Query has scheduling mode set andflagsis set in query scheduling flags.- Parameters:
mode- the scheduling modeflags-GstSchedulingFlags- Returns:
truewhenmodeis in the list of scheduling modes andflagsare compatible with query flags.
-
hasSchedulingModeWithFlags
Check if this Query has scheduling mode set andflagsis set in query scheduling flags.- Parameters:
mode- the scheduling modeflags-GstSchedulingFlags- Returns:
truewhenmodeis in the list of scheduling modes andflagsare compatible with query flags.
-
parseAcceptCaps
-
parseAcceptCapsResult
-
parseAllocation
Parse an allocation query, writing the requested caps incapsand 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- TheGstCapsneedPool- Whether aGstBufferPoolis needed
-
parseBitrate
-
parseBufferingPercent
Get the percentage of buffered data. This is a value between 0 and 100. Thebusyindicator istruewhen the buffering is in progress.- Parameters:
busy- if buffering is busy, ornullpercent- a buffering percent, ornull
-
parseBufferingRange
public 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- Parameters:
format- the format to set for thesegmentStartandsegmentEndvalues, ornullstart- the start to set, ornullstop- the stop to set, ornullestimatedTotal- estimated total amount of download time remaining in milliseconds, ornull
-
parseBufferingStats
public void parseBufferingStats(@Nullable Out<BufferingMode> mode, @Nullable Out<Integer> avgIn, @Nullable Out<Integer> avgOut, @Nullable Out<Long> bufferingLeft) Extracts the buffering stats values fromquery.- Parameters:
mode- a buffering mode, ornullavgIn- the average input rate, ornullavgOut- the average output rat, ornullbufferingLeft- amount of buffering time left in milliseconds, ornull
-
parseCaps
-
parseCapsResult
-
parseContext
-
parseContextType
-
parseConvert
public void parseConvert(@Nullable Out<Format> srcFormat, @Nullable Out<Long> srcValue, @Nullable Out<Format> destFormat, @Nullable Out<Long> destValue) Parse a convert query answer. Any ofsrcFormat,srcValue,destFormat,anddestValuemay benull, in which case that value is omitted.- Parameters:
srcFormat- the storage for theGstFormatof the source value, ornullsrcValue- the storage for the source value, ornulldestFormat- the storage for theGstFormatof the destination value, ornulldestValue- the storage for the destination value, ornull
-
parseDuration
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 theGstFormatof the duration value, ornull.duration- the storage for the total duration, ornull.
-
parseLatency
-
parseNFormats
-
parseNthAllocationMeta
Parse an available query and get the metadata API atindexof the metadata API array.- Parameters:
index- position in the metadata API array to readparams- API specific parameters- Returns:
- a
GTypeof the metadata API atindex.
-
parseNthAllocationParam
public void parseNthAllocationParam(int index, @Nullable Out<Allocator> allocator, @Nullable AllocationParams params) Parse an available query and get the allocator and its params atindexof 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 Out<BufferPool> pool, @Nullable Out<Integer> size, @Nullable Out<Integer> minBuffers, @Nullable Out<Integer> maxBuffers) Get the pool parameters inquery.Unref
poolwith gst_object_unref() when it's not needed any more.- Parameters:
index- index to parsepool- theGstBufferPoolsize- the buffer sizeminBuffers- the min buffersmaxBuffers- the max buffers
-
parseNthBufferingRange
public 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 theindexof the buffered ranges array.- Parameters:
index- position in the buffered-ranges array to readstart- the start position to set, ornullstop- the stop position to set, ornull- Returns:
- a
gbooleanindicating if the parsing succeeded.
-
parseNthFormat
Parse the format query and retrieve thenthformat from it intoformat.If the list contains less elements thannth,formatwill 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 atindexof the scheduling modes array.- Parameters:
index- position in the scheduling modes array to read- Returns:
- a
GstPadModeof the scheduling mode atindex.
-
parsePosition
Parse a position query, writing the format intoformat,and the position intocur,if the respective parameters are non-null.- Parameters:
format- the storage for theGstFormatof the position values (may benull)cur- the storage for the current position (may benull)
-
parseScheduling
public void parseScheduling(@Nullable Out<Set<SchedulingFlags>> flags, @Nullable Out<Integer> minsize, @Nullable Out<Integer> maxsize, @Nullable Out<Integer> align) Set the scheduling properties.- Parameters:
flags-GstSchedulingFlagsminsize- 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 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- Parameters:
format- the format to set for thesegmentStartandsegmentEndvalues, ornullseekable- the seekable flag to set, ornullsegmentStart- the segment_start to set, ornullsegmentEnd- the segment_end to set, ornull
-
parseSegment
public void parseSegment(@Nullable Out<Double> rate, @Nullable Out<Format> format, @Nullable Out<Long> startValue, @Nullable Out<Long> stopValue) Parse a segment query answer. Any ofrate,format,startValue,andstopValuemay 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, ornullformat- the storage for theGstFormatof the values, ornullstartValue- the storage for the start value, ornullstopValue- the storage for the stop value, ornull
-
parseSelectable
-
parseUri
-
parseUriRedirection
-
parseUriRedirectionPermanent
Parse an URI query, and setpermanenttotrueif 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)- Since:
- 1.4
-
ref
-
removeNthAllocationMeta
public void removeNthAllocationMeta(int index) Remove the metadata API atindexof the metadata API array.- Parameters:
index- position in the metadata API array to remove
-
removeNthAllocationParam
public void removeNthAllocationParam(int index) Remove the allocation param atindexof the allocation param array.- Parameters:
index- position in the allocation param array to remove- Since:
- 1.2
-
removeNthAllocationPool
public void removeNthAllocationPool(int index) Remove the allocation pool atindexof the allocation pool array.- Parameters:
index- position in the allocation pool array to remove- Since:
- 1.2
-
setAcceptCapsResult
public void setAcceptCapsResult(boolean result) Setresultas the result for thequery.- 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- Since:
- 1.16
-
setBufferingPercent
public void setBufferingPercent(boolean busy, int percent) Set the percentage of buffered data. This is a value between 0 and 100. Thebusyindicator istruewhen the buffering is in progress.- Parameters:
busy- if buffering is busypercent- a buffering percent
-
setBufferingRange
Set the available query result fields inquery.- Parameters:
format- the format to set for thestartandstopvaluesstart- the start to setstop- the stop to setestimatedTotal- estimated total amount of download time remaining in milliseconds
-
setBufferingStats
Configures the buffering stats values inquery.- Parameters:
mode- a buffering modeavgIn- the average input rateavgOut- the average output ratebufferingLeft- amount of buffering time left in milliseconds
-
setCapsResult
Set thecapsresult inquery.- Parameters:
caps- A pointer to the caps
-
setContext
Answer a context query by setting the requested context.- Parameters:
context- the requestedGstContext- Since:
- 1.2
-
setConvert
-
setDuration
Answer a duration query by setting the requested value in the given format.- Parameters:
format- theGstFormatfor the durationduration- the duration of the stream
-
setFormats
Set the formats query result fields inquery.The number of formats passed must be equal tonFormats.- Parameters:
nFormats- the number of formats to set.varargs- A number ofGstFormatsequal tonFormats.
-
setFormatsv
Set the formats query result fields inquery.The number of formats passed in theformatsarray must be equal tonFormats.- Parameters:
formats- an array containingnFormatsGstFormatvalues.
-
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 Allocator allocator, @Nullable AllocationParams params) Parse an available query and get the allocator and its params atindexof 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 BufferPool pool, int size, int minBuffers, int maxBuffers) Set the pool parameters inquery.- Parameters:
index- index to modifypool- theGstBufferPoolsize- 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 requestedGstFormatcur- the position to set
-
setScheduling
Set the scheduling properties.- Parameters:
flags-GstSchedulingFlagsminsize- 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-GstSchedulingFlagsminsize- 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 inquery.- Parameters:
format- the format to set for thesegmentStartandsegmentEndvaluesseekable- 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.startValueandstopValuewill 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.ratewill contain the playback rate. For negative rates, playback will actually happen fromstopValuetostartValue.- Parameters:
rate- the rate of the segmentformat- theGstFormatof the segment values (startValueandstopValue)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,selectableshould be set totrue.- Parameters:
selectable- Whether the element can handle stream selection.- Since:
- 1.22
-
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- Since:
- 1.2
-
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- Since:
- 1.4
-
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
GstStructureof the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.
-