Class Query

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.gst.Query
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class Query extends ProxyInstance

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:

  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

    Constructors
    Constructor
    Description
    Allocate a new Query.
    Query(Arena arena)
    Allocate a new Query.
    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 Type
    Method
    Description
    static Query
    Constructs a new query object for querying if caps are accepted.
    void
    addAllocationMeta(Type api, @Nullable Structure params)
    Add api with params as one of the supported metadata API to query.
    void
    addAllocationParam(@Nullable Allocator allocator, @Nullable AllocationParams params)
    Add allocator and its params as a supported memory allocator.
    void
    addAllocationPool(@Nullable BufferPool pool, int size, int minBuffers, int maxBuffers)
    Set the pool parameters in query.
    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.
    void
    Add mode as one of the supported scheduling modes to query.
    static Query
    allocation(@Nullable Caps caps, boolean needPool)
    Constructs a new query object for querying the allocation properties.
    static Query
    Constructs a new query object for querying the bitrate.
    static Query
    buffering(Format format)
    Constructs a new query object for querying the buffering status of a stream.
    static Query
    caps(Caps filter)
    Constructs a new query object for querying the caps.
    static Query
    context(String contextType)
    Constructs a new query object for querying the pipeline-local context.
    static Query
    convert(Format srcFormat, long value, Format destFormat)
    Constructs a new convert query object.
    Copies the given query using the copy function of the parent GstStructure.
    static Query
    custom(QueryType type, @Nullable Structure structure)
    Constructs a new custom query object.
    static Query
    Constructs a new query object for querying the drain state.
    static Query
    duration(Format format)
    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 metadata api set.
    static Query
    Constructs a new query object for querying formats of the stream.
    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.
    @Nullable Structure
    Get the structure of a query.
    static @Nullable Type
    Get the GType of the Query class.
    boolean
    Check if this Query has scheduling mode set.
    boolean
    Check if this Query has scheduling mode set and flags is set in query scheduling flags.
    boolean
    Check if this Query has scheduling mode set and flags is set in query scheduling flags.
    static Query
    Constructs a new latency query object.
    void
    Get the caps from query. The caps remains valid as long as this Query remains valid.
    void
    parseAcceptCapsResult(@Nullable Out<Boolean> result)
    Parse the result from this Query and store in result.
    void
    parseAllocation(@Nullable Out<Caps> caps, @Nullable Out<Boolean> needPool)
    Parse an allocation query, writing the requested caps in caps and whether a pool is needed in needPool, 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 into format, 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 query.
    void
    parseCaps(Out<Caps> filter)
    Get the filter from the caps query. The caps remains valid as long as this Query remains valid.
    void
    parseCapsResult(@Nullable Out<Caps> caps)
    Get the caps result from query. The caps remains valid as long as this Query remains valid.
    void
    parseContext(@Nullable Out<Context> context)
    Get the context from the context query. The context remains valid as long as this Query remains valid.
    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 query.
    parseNthAllocationMeta(int index, @Nullable Out<Structure> params)
    Parse an available query and get the metadata API at index 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 at index 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 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 the index of the buffered ranges array.
    void
    parseNthFormat(int nth, @Nullable Out<Format> format)
    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.
    Parse an available query and get the scheduling mode at index of the scheduling modes array.
    void
    parsePosition(@Nullable Out<Format> format, @Nullable Out<Long> cur)
    Parse a position query, writing the format into format, and the position into cur, 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 into format, 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
    parseUri(@Nullable Out<String> uri)
    Parse an URI query, writing the URI into uri 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 into uri as a newly allocated string, if the respective parameters are non-null.
    void
    Parse an URI query, and set permanent to true if there is a redirection and it should be considered permanent.
    static Query
    position(Format format)
    Constructs a new query stream position query object.
    @Nullable MiniObject
    Read the value of the field mini_object.
    Read the value of the field type.
    ref()
    Increases the refcount of the given query by one.
    void
    Remove the metadata API at index of the metadata API array.
    void
    Remove the allocation param at index of the allocation param array.
    void
    Remove the allocation pool at index of the allocation pool array.
    static boolean
    replace(@Nullable Out<Query> oldQuery, @Nullable Query newQuery)
    Modifies a pointer to a GstQuery to point to a different GstQuery.
    static Query
    Constructs a new query object for querying the scheduling properties.
    static Query
    seeking(Format format)
    Constructs a new query object for querying seeking properties of the stream.
    static Query
    segment(Format format)
    Constructs a new segment query object.
    static Query
    Constructs a new query object for querying the stream selection capability.
    void
    setAcceptCapsResult(boolean result)
    Set result as the result for the 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 query.
    void
    setBufferingStats(BufferingMode mode, int avgIn, int avgOut, long bufferingLeft)
    Configures the buffering stats values in query.
    void
    setCapsResult(@Nullable Caps caps)
    Set the caps result in 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 query. The number of formats passed must be equal to nFormats.
    void
    setFormatsv(@Nullable Format @Nullable [] formats)
    Set the formats query result fields in query. The number of formats passed in the formats array must be equal to nFormats.
    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 at index of the allocator array.
    void
    setNthAllocationPool(int index, @Nullable BufferPool pool, int size, int minBuffers, int maxBuffers)
    Set the pool parameters in 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 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
    setUri(@Nullable String uri)
    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
    take(@Nullable Out<Query> oldQuery, @Nullable Query newQuery)
    Modifies a pointer to a GstQuery to point to a different GstQuery.
    void
    Decreases the refcount of the query.
    static Query
    uri()
    Constructs a new query URI query object.
    Get the structure of a query.
    void
    writeMiniObject(@Nullable MiniObject miniObject)
    Write a value in the field mini_object.
    void
    Write a value in the field type.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Query

      public Query(MemorySegment address)
      Create a Query proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Query

      public Query(Arena arena)
      Allocate a new Query.
      Parameters:
      arena - to control the memory allocation scope
    • Query

      public Query()
      Allocate a new Query. The memory is allocated with Arena.ofAuto().
    • Query

      public Query(MiniObject miniObject, QueryType type, Arena arena)
      Allocate a new Query with the fields set to the provided values.
      Parameters:
      miniObject - value for the field miniObject
      type - value for the field type
      arena - to control the memory allocation scope
    • Query

      public Query(MiniObject miniObject, QueryType type)
      Allocate a new Query with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      miniObject - value for the field miniObject
      type - value for the field type
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the Query class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readMiniObject

      public @Nullable MiniObject readMiniObject()
      Read the value of the field mini_object.
      Returns:
      The value of the field mini_object
    • writeMiniObject

      public void writeMiniObject(@Nullable MiniObject miniObject)
      Write a value in the field mini_object.
      Parameters:
      miniObject - The new value for the field mini_object
    • readType

      public QueryType readType()
      Read the value of the field type.
      Returns:
      The value of the field type
    • writeType

      public void writeType(QueryType type)
      Write a value in the field type.
      Parameters:
      type - The new value for the field type
    • acceptCaps

      public static Query acceptCaps(Caps caps)

      Constructs a new query object for querying if caps are accepted.

      Free-function: gst_query_unref()

      Parameters:
      caps - a fixed GstCaps
      Returns:
      a new GstQuery
    • allocation

      public static Query allocation(@Nullable Caps caps, boolean needPool)

      Constructs a new query object for querying the allocation properties.

      Free-function: gst_query_unref()

      Parameters:
      caps - the negotiated caps
      needPool - return a pool
      Returns:
      a new GstQuery
    • bitrate

      public static Query bitrate()

      Constructs a new query object for querying the bitrate.

      Free-function: gst_query_unref()

      Returns:
      a new GstQuery
      Since:
      1.16
    • buffering

      public static Query buffering(Format format)

      Constructs a new query object for querying the buffering status of a stream.

      Free-function: gst_query_unref()

      Parameters:
      format - the default GstFormat for the new query
      Returns:
      a new GstQuery
    • caps

      public static Query caps(Caps filter)

      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()

      Parameters:
      filter - a filter
      Returns:
      a new GstQuery
    • context

      public static Query context(String contextType)

      Constructs a new query object for querying the pipeline-local context.

      Free-function: gst_query_unref()

      Parameters:
      contextType - Context type to query
      Returns:
      a new GstQuery
      Since:
      1.2
    • convert

      public static Query convert(Format srcFormat, long value, Format destFormat)

      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 source GstFormat for the new query
      value - the value to convert
      destFormat - the target GstFormat
      Returns:
      a GstQuery
    • custom

      public static Query custom(QueryType type, @Nullable Structure structure)

      Constructs a new custom query object. Use gst_query_unref() when done with it.

      Free-function: gst_query_unref()

      Parameters:
      type - the query type
      structure - a structure for the query
      Returns:
      a new GstQuery
    • drain

      public static Query drain()

      Constructs a new query object for querying the drain state.

      Free-function: gst_query_unref()

      Returns:
      a new GstQuery
    • duration

      public static Query duration(Format format)

      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 - the GstFormat for this duration query
      Returns:
      a new GstQuery
    • formats

      public static Query formats()

      Constructs a new query object for querying formats of the stream.

      Free-function: gst_query_unref()

      Returns:
      a new GstQuery
    • latency

      public static Query 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

      public static Query position(Format format)

      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 default GstFormat for the new query
      Returns:
      a new GstQuery
    • scheduling

      public static Query scheduling()

      Constructs a new query object for querying the scheduling properties.

      Free-function: gst_query_unref()

      Returns:
      a new GstQuery
    • seeking

      public static Query seeking(Format format)

      Constructs a new query object for querying seeking properties of the stream.

      Free-function: gst_query_unref()

      Parameters:
      format - the default GstFormat for the new query
      Returns:
      a new GstQuery
    • segment

      public static Query segment(Format format)

      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 - the GstFormat for the new query
      Returns:
      a new GstQuery
    • selectable

      public static Query 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

      public static Query 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 Out<Query> oldQuery, @Nullable Query newQuery)

      Modifies a pointer to a GstQuery to point to a different GstQuery. 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 the GstQuery pointed to by oldQuery may be null.

      Parameters:
      oldQuery - pointer to a pointer to a GstQuery to be replaced.
      newQuery - pointer to a GstQuery that will replace the query pointed to by oldQuery.
      Returns:
      true if newQuery was different from oldQuery
    • take

      public static boolean take(@Nullable Out<Query> oldQuery, @Nullable Query newQuery)

      Modifies a pointer to a GstQuery to point to a different GstQuery. This function is similar to gst_query_replace() except that it takes ownership of newQuery.

      Either newQuery or the GstQuery pointed to by oldQuery may be null.

      Parameters:
      oldQuery - pointer to a pointer to a GstQuery to be stolen.
      newQuery - pointer to a GstQuery that will replace the query pointed to by oldQuery.
      Returns:
      true if newQuery was different from oldQuery
      Since:
      1.16
    • addAllocationMeta

      public void addAllocationMeta(Type api, @Nullable Structure params)
      Add api with params as one of the supported metadata API to query.
      Parameters:
      api - the metadata API
      params - API specific parameters
    • addAllocationParam

      public void addAllocationParam(@Nullable Allocator allocator, @Nullable AllocationParams params)
      Add allocator and its params as a supported memory allocator.
      Parameters:
      allocator - the memory allocator
      params - a GstAllocationParams
    • addAllocationPool

      public void addAllocationPool(@Nullable BufferPool pool, int size, int minBuffers, int maxBuffers)
      Set the pool parameters in query.
      Parameters:
      pool - the GstBufferPool
      size - the buffer size
      minBuffers - the min buffers
      maxBuffers - 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.
      Parameters:
      start - start position of the range
      stop - stop position of the range
      Returns:
      a gboolean indicating if the range was added or not.
    • addSchedulingMode

      public void addSchedulingMode(PadMode mode)
      Add mode as one of the supported scheduling modes to query.
      Parameters:
      mode - a GstPadMode
    • copy

      public Query copy()

      Copies the given query using the copy function of the parent GstStructure.

      Free-function: gst_query_unref

      Returns:
      a new copy of q.
    • findAllocationMeta

      public boolean findAllocationMeta(Type api, @Nullable Out<Integer> index)
      Check if this Query has metadata api set. When this function returns true, index will contain the index where the requested API and the parameters can be found.
      Parameters:
      api - the metadata API
      index - the index
      Returns:
      true when api 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

      public @Nullable Structure 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

      public boolean hasSchedulingMode(PadMode mode)

      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 when mode is in the list of scheduling modes.
    • hasSchedulingModeWithFlags

      public boolean hasSchedulingModeWithFlags(PadMode mode, Set<SchedulingFlags> flags)
      Check if this Query has scheduling mode set and flags is set in query scheduling flags.
      Parameters:
      mode - the scheduling mode
      flags - GstSchedulingFlags
      Returns:
      true when mode is in the list of scheduling modes and flags are compatible with query flags.
    • hasSchedulingModeWithFlags

      public boolean hasSchedulingModeWithFlags(PadMode mode, SchedulingFlags... flags)
      Check if this Query has scheduling mode set and flags is set in query scheduling flags.
      Parameters:
      mode - the scheduling mode
      flags - GstSchedulingFlags
      Returns:
      true when mode is in the list of scheduling modes and flags are compatible with query flags.
    • parseAcceptCaps

      public void parseAcceptCaps(Out<Caps> caps)
      Get the caps from query. The caps remains valid as long as this Query remains valid.
      Parameters:
      caps - A pointer to the caps
    • parseAcceptCapsResult

      public void parseAcceptCapsResult(@Nullable Out<Boolean> result)
      Parse the result from this Query and store in result.
      Parameters:
      result - location for the result
    • parseAllocation

      public void parseAllocation(@Nullable Out<Caps> caps, @Nullable Out<Boolean> needPool)

      Parse an allocation query, writing the requested caps in caps and whether a pool is needed in needPool, 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 - The GstCaps
      needPool - Whether a GstBufferPool is needed
    • parseBitrate

      public void parseBitrate(@Nullable Out<Integer> nominalBitrate)
      Get the results of a bitrate query. See also gst_query_set_bitrate().
      Parameters:
      nominalBitrate - The resulting bitrate in bits per second
      Since:
      1.16
    • parseBufferingPercent

      public void parseBufferingPercent(@Nullable Out<Boolean> busy, @Nullable Out<Integer> percent)
      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.
      Parameters:
      busy - if buffering is busy, or null
      percent - a buffering percent, or null
    • 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 into format, and other results into the passed parameters, if the respective parameters are non-null
      Parameters:
      format - the format to set for the segmentStart and segmentEnd values, or null
      start - the start to set, or null
      stop - the stop to set, or null
      estimatedTotal - estimated total amount of download time remaining in milliseconds, or null
    • 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 from query.
      Parameters:
      mode - a buffering mode, or null
      avgIn - the average input rate, or null
      avgOut - the average output rat, or null
      bufferingLeft - amount of buffering time left in milliseconds, or null
    • parseCaps

      public void parseCaps(Out<Caps> filter)
      Get the filter from the caps query. The caps remains valid as long as this Query remains valid.
      Parameters:
      filter - A pointer to the caps filter
    • parseCapsResult

      public void parseCapsResult(@Nullable Out<Caps> caps)
      Get the caps result from query. The caps remains valid as long as this Query remains valid.
      Parameters:
      caps - A pointer to the caps
    • parseContext

      public void parseContext(@Nullable Out<Context> context)
      Get the context from the context query. The context remains valid as long as this Query remains valid.
      Parameters:
      context - A pointer to store the GstContext
      Since:
      1.2
    • parseContextType

      public boolean parseContextType(@Nullable Out<String> contextType)
      Parse a context type from an existing GST_QUERY_CONTEXT query.
      Parameters:
      contextType - the context type, or null
      Returns:
      a gboolean indicating if the parsing succeeded.
      Since:
      1.2
    • 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 of srcFormat, srcValue, destFormat, and destValue may be null, in which case that value is omitted.
      Parameters:
      srcFormat - the storage for the GstFormat of the source value, or null
      srcValue - the storage for the source value, or null
      destFormat - the storage for the GstFormat of the destination value, or null
      destValue - the storage for the destination value, or null
    • parseDuration

      public void parseDuration(@Nullable Out<Format> format, @Nullable Out<Long> duration)
      Parse a duration query answer. Write the format of the duration into format, and the value into duration, if the respective variables are non-null.
      Parameters:
      format - the storage for the GstFormat of the duration value, or null.
      duration - the storage for the total duration, or null.
    • parseLatency

      public void parseLatency(@Nullable Out<Boolean> live, @Nullable ClockTime minLatency, @Nullable ClockTime maxLatency)
      Parse a latency query answer.
      Parameters:
      live - storage for live or null
      minLatency - the storage for the min latency or null
      maxLatency - the storage for the max latency or null
    • parseNFormats

      public void parseNFormats(@Nullable Out<Integer> nFormats)
      Parse the number of formats in the formats query.
      Parameters:
      nFormats - the number of formats in this query.
    • parseNthAllocationMeta

      public Type parseNthAllocationMeta(int index, @Nullable Out<Structure> params)
      Parse an available query and get the metadata API at index of the metadata API array.
      Parameters:
      index - position in the metadata API array to read
      params - API specific parameters
      Returns:
      a GType of the metadata API at index.
    • parseNthAllocationParam

      public void parseNthAllocationParam(int index, @Nullable Out<Allocator> allocator, @Nullable AllocationParams params)
      Parse an available query and get the allocator and its params at index of the allocator array.
      Parameters:
      index - position in the allocator array to read
      allocator - variable to hold the result
      params - 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 in query.

      Unref pool with gst_object_unref() when it's not needed any more.

      Parameters:
      index - index to parse
      pool - the GstBufferPool
      size - the buffer size
      minBuffers - the min buffers
      maxBuffers - 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 the index of the buffered ranges array.
      Parameters:
      index - position in the buffered-ranges array to read
      start - the start position to set, or null
      stop - the stop position to set, or null
      Returns:
      a gboolean indicating if the parsing succeeded.
    • parseNthFormat

      public void parseNthFormat(int nth, @Nullable Out<Format> format)
      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.
      Parameters:
      nth - the nth format to retrieve.
      format - a pointer to store the nth format
    • parseNthSchedulingMode

      public PadMode parseNthSchedulingMode(int index)
      Parse an available query and get the scheduling mode at index of the scheduling modes array.
      Parameters:
      index - position in the scheduling modes array to read
      Returns:
      a GstPadMode of the scheduling mode at index.
    • parsePosition

      public void parsePosition(@Nullable Out<Format> format, @Nullable Out<Long> cur)
      Parse a position query, writing the format into format, and the position into cur, if the respective parameters are non-null.
      Parameters:
      format - the storage for the GstFormat of the position values (may be null)
      cur - the storage for the current position (may be null)
    • 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 - GstSchedulingFlags
      minsize - the suggested minimum size of pull requests
      maxsize - 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 into format, and other results into the passed parameters, if the respective parameters are non-null
      Parameters:
      format - the format to set for the segmentStart and segmentEnd values, or null
      seekable - the seekable flag to set, or null
      segmentStart - the segment_start to set, or null
      segmentEnd - the segment_end to set, or null
    • 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 of rate, format, startValue, and stopValue may be null, 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, or null
      format - the storage for the GstFormat of the values, or null
      startValue - the storage for the start value, or null
      stopValue - the storage for the stop value, or null
    • parseSelectable

      public void parseSelectable(@Nullable Out<Boolean> selectable)
      Get the results of a selectable query. See also gst_query_set_selectable().
      Parameters:
      selectable - The resulting stream selection capability
      Since:
      1.22
    • parseUri

      public void parseUri(@Nullable Out<String> uri)
      Parse an URI query, writing the URI into uri as a newly allocated string, if the respective parameters are non-null. Free the string with g_free() after usage.
      Parameters:
      uri - the storage for the current URI (may be null)
    • parseUriRedirection

      public void parseUriRedirection(@Nullable Out<String> uri)
      Parse an URI query, writing the URI into uri as a newly allocated string, if the respective parameters are non-null. Free the string with g_free() after usage.
      Parameters:
      uri - the storage for the redirect URI (may be null)
      Since:
      1.2
    • parseUriRedirectionPermanent

      public void parseUriRedirectionPermanent(@Nullable Out<Boolean> permanent)
      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.
      Parameters:
      permanent - if the URI redirection is permanent (may be null)
      Since:
      1.4
    • ref

      public Query ref()
      Increases the refcount of the given query by one.
      Returns:
      this Query
    • removeNthAllocationMeta

      public void removeNthAllocationMeta(int index)
      Remove the metadata API at index 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 at index of 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 at index of the allocation pool array.
      Parameters:
      index - position in the allocation pool array to remove
      Since:
      1.2
    • setAcceptCapsResult

      public void setAcceptCapsResult(boolean result)
      Set result as the result for the 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
      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. The busy indicator is true when the buffering is in progress.
      Parameters:
      busy - if buffering is busy
      percent - a buffering percent
    • setBufferingRange

      public void setBufferingRange(Format format, long start, long stop, long estimatedTotal)
      Set the available query result fields in query.
      Parameters:
      format - the format to set for the start and stop values
      start - the start to set
      stop - the stop to set
      estimatedTotal - estimated total amount of download time remaining in milliseconds
    • setBufferingStats

      public void setBufferingStats(BufferingMode mode, int avgIn, int avgOut, long bufferingLeft)
      Configures the buffering stats values in query.
      Parameters:
      mode - a buffering mode
      avgIn - the average input rate
      avgOut - the average output rate
      bufferingLeft - amount of buffering time left in milliseconds
    • setCapsResult

      public void setCapsResult(@Nullable Caps caps)
      Set the caps result in query.
      Parameters:
      caps - A pointer to the caps
    • setContext

      public void setContext(@Nullable Context context)
      Answer a context query by setting the requested context.
      Parameters:
      context - the requested GstContext
      Since:
      1.2
    • setConvert

      public void setConvert(Format srcFormat, long srcValue, Format destFormat, long destValue)
      Answer a convert query by setting the requested values.
      Parameters:
      srcFormat - the source GstFormat
      srcValue - the source value
      destFormat - the destination GstFormat
      destValue - the destination value
    • setDuration

      public void setDuration(Format format, long duration)
      Answer a duration query by setting the requested value in the given format.
      Parameters:
      format - the GstFormat for the duration
      duration - the duration of the stream
    • setFormats

      public void setFormats(int nFormats, Object... varargs)
      Set the formats query result fields in query. The number of formats passed must be equal to nFormats.
      Parameters:
      nFormats - the number of formats to set.
      varargs - A number of GstFormats equal to nFormats.
    • setFormatsv

      public void setFormatsv(@Nullable Format @Nullable [] formats)
      Set the formats query result fields in query. The number of formats passed in the formats array must be equal to nFormats.
      Parameters:
      formats - an array containing nFormats GstFormat values.
    • setLatency

      public void setLatency(boolean live, ClockTime minLatency, ClockTime maxLatency)
      Answer a latency query by setting the requested values in the given format.
      Parameters:
      live - if there is a live element upstream
      minLatency - the minimal latency of the upstream elements
      maxLatency - 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.
      Parameters:
      index - position in the allocator array to set
      allocator - new allocator to set
      params - parameters for the allocator
    • setNthAllocationPool

      public void setNthAllocationPool(int index, @Nullable BufferPool pool, int size, int minBuffers, int maxBuffers)
      Set the pool parameters in query.
      Parameters:
      index - index to modify
      pool - the GstBufferPool
      size - the buffer size
      minBuffers - the min buffers
      maxBuffers - the max buffers
    • setPosition

      public void setPosition(Format format, long cur)
      Answer a position query by setting the requested value in the given format.
      Parameters:
      format - the requested GstFormat
      cur - the position to set
    • setScheduling

      public void setScheduling(Set<SchedulingFlags> flags, int minsize, int maxsize, int align)
      Set the scheduling properties.
      Parameters:
      flags - GstSchedulingFlags
      minsize - the suggested minimum size of pull requests
      maxsize - the suggested maximum size of pull requests
      align - the suggested alignment of pull requests
    • setScheduling

      public void setScheduling(SchedulingFlags flags, int minsize, int maxsize, int align)
      Set the scheduling properties.
      Parameters:
      flags - GstSchedulingFlags
      minsize - the suggested minimum size of pull requests
      maxsize - the suggested maximum size of pull requests
      align - the suggested alignment of pull requests
    • setSeeking

      public void setSeeking(Format format, boolean seekable, long segmentStart, long segmentEnd)
      Set the seeking query result fields in query.
      Parameters:
      format - the format to set for the segmentStart and segmentEnd values
      seekable - the seekable flag to set
      segmentStart - the segment_start to set
      segmentEnd - the segment_end to set
    • setSegment

      public void setSegment(double rate, Format format, long startValue, long stopValue)

      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 and stopValue 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 startValue <= stopValue. rate will contain the playback rate. For negative rates, playback will actually happen from stopValue to startValue.

      Parameters:
      rate - the rate of the segment
      format - the GstFormat of the segment values (startValue and stopValue)
      startValue - the start value
      stopValue - 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.
      Parameters:
      selectable - Whether the element can handle stream selection.
      Since:
      1.22
    • setUri

      public void setUri(@Nullable String uri)
      Answer a URI query by setting the requested URI.
      Parameters:
      uri - the URI to set
    • setUriRedirection

      public void setUriRedirection(@Nullable String uri)
      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

      public Structure 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.