Klasse Query

Alle implementierten Schnittstellen:
PointerInterface

public class Query extends Record
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:
<!-- language="C" -->
   GstQuery *query;
   gboolean res;
   query = gst_query_new_duration (GST_FORMAT_TIME);
   res = gst_element_query (pipeline, query);
   if (res) {
     gint64 duration;
     gst_query_parse_duration (query, NULL, &duration);
     g_print ("duration = %"GST_TIME_FORMAT, GST_TIME_ARGS (duration));
   } else {
     g_print ("duration query failed...");
   }
   gst_query_unref (query);
 

https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html

  • Felddetails

  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • setFieldType

      public void setFieldType(int type)
      the #GstQueryType
    • getFieldType

      public int getFieldType()
      the #GstQueryType
    • newAcceptCapsQuery

      public static Query newAcceptCapsQuery(@Nonnull Caps caps)
      Constructs a new query object for querying if @caps are accepted.

      Free-function: gst_query_unref()
      Parameter:
      caps - a fixed #GstCaps
      Gibt zurück:
      a new #GstQuery
    • newAllocationQuery

      public static Query newAllocationQuery(@Nullable Caps caps, boolean need_pool)
      Constructs a new query object for querying the allocation properties.

      Free-function: gst_query_unref()
      Parameter:
      caps - the negotiated caps
      need_pool - return a pool
      Gibt zurück:
      a new #GstQuery
    • newBitrateQuery

      public static Query newBitrateQuery()
      Constructs a new query object for querying the bitrate.

      Free-function: gst_query_unref()
      Gibt zurück:
      a new #GstQuery
    • newBufferingQuery

      public static Query newBufferingQuery(int format)
      Constructs a new query object for querying the buffering status of
      a stream.

      Free-function: gst_query_unref()
      Parameter:
      format - the default #GstFormat for the new query
      Gibt zurück:
      a new #GstQuery
    • newCapsQuery

      public static Query newCapsQuery(@Nonnull 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()
      Parameter:
      filter - a filter
      Gibt zurück:
      a new #GstQuery
    • newContextQuery

      public static Query newContextQuery(@Nonnull Str context_type)
      Constructs a new query object for querying the pipeline-local context.

      Free-function: gst_query_unref()
      Parameter:
      context_type - Context type to query
      Gibt zurück:
      a new #GstQuery
    • newContextQuery

      public static Query newContextQuery(String context_type)
      Constructs a new query object for querying the pipeline-local context.

      Free-function: gst_query_unref()
      Parameter:
      context_type - Context type to query
      Gibt zurück:
      a new #GstQuery
    • newConvertQuery

      public static Query newConvertQuery(int src_format, long value, int dest_format)
      Constructs a new convert query object. Use gst_query_unref()
      when done with it. A convert query is used to ask for a conversion between
      one format and another.

      Free-function: gst_query_unref()
      Parameter:
      src_format - the source #GstFormat for the new query
      value - the value to convert
      dest_format - the target #GstFormat
      Gibt zurück:
      a #GstQuery
    • newCustomQuery

      public static Query newCustomQuery(int type, @Nullable Structure structure)
      Constructs a new custom query object. Use gst_query_unref()
      when done with it.

      Free-function: gst_query_unref()
      Parameter:
      type - the query type
      structure - a structure for the query
      Gibt zurück:
      a new #GstQuery
    • newDrainQuery

      public static Query newDrainQuery()
      Constructs a new query object for querying the drain state.

      Free-function: gst_query_unref()
      Gibt zurück:
      a new #GstQuery
    • newDurationQuery

      public static Query newDurationQuery(int 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()
      Parameter:
      format - the #GstFormat for this duration query
      Gibt zurück:
      a new #GstQuery
    • newFormatsQuery

      public static Query newFormatsQuery()
      Constructs a new query object for querying formats of
      the stream.

      Free-function: gst_query_unref()
      Gibt zurück:
      a new #GstQuery
    • newLatencyQuery

      public static Query newLatencyQuery()
      Constructs a new latency query object.
      Use gst_query_unref() when done with it. A latency query is usually performed
      by sinks to compensate for additional latency introduced by elements in the
      pipeline.

      Free-function: gst_query_unref()
      Gibt zurück:
      a #GstQuery
    • newPositionQuery

      public static Query newPositionQuery(int 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()
      Parameter:
      format - the default #GstFormat for the new query
      Gibt zurück:
      a new #GstQuery
    • newSchedulingQuery

      public static Query newSchedulingQuery()
      Constructs a new query object for querying the scheduling properties.

      Free-function: gst_query_unref()
      Gibt zurück:
      a new #GstQuery
    • newSeekingQuery

      public static Query newSeekingQuery(int format)
      Constructs a new query object for querying seeking properties of
      the stream.

      Free-function: gst_query_unref()
      Parameter:
      format - the default #GstFormat for the new query
      Gibt zurück:
      a new #GstQuery
    • newSegmentQuery

      public static Query newSegmentQuery(int 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()
      Parameter:
      format - the #GstFormat for the new query
      Gibt zurück:
      a new #GstQuery
    • newSelectableQuery

      public static Query newSelectableQuery()
      Constructs a new query object for querying the stream selection capability.

      Free-function: gst_query_unref()
      Gibt zurück:
      a new #GstQuery
    • newUriQuery

      public static Query newUriQuery()
      Constructs a new query URI query object. Use gst_query_unref()
      when done with it. An URI query is used to query the current URI
      that is used by the source or sink.

      Free-function: gst_query_unref()
      Gibt zurück:
      a new #GstQuery
    • addAllocationMeta

      public void addAllocationMeta(long api, @Nullable Structure params)
      Add @api with @params as one of the supported metadata API to @query.
      Parameter:
      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.
      Parameter:
      allocator - the memory allocator
      params - a #GstAllocationParams
    • addAllocationPool

      public void addAllocationPool(@Nullable BufferPool pool, int size, int min_buffers, int max_buffers)
      Set the pool parameters in @query.
      Parameter:
      pool - the #GstBufferPool
      size - the buffer size
      min_buffers - the min buffers
      max_buffers - the max buffers
    • addBufferingRange

      public boolean addBufferingRange(long start, long stop)
      Set the buffering-ranges array field in @query. The current last
      start position of the array should be inferior to @start.
      Parameter:
      start - start position of the range
      stop - stop position of the range
      Gibt zurück:
      a #gboolean indicating if the range was added or not.
    • addSchedulingMode

      public void addSchedulingMode(int mode)
      Add @mode as one of the supported scheduling modes to @query.
      Parameter:
      mode - a #GstPadMode
    • getNAllocationMetas

      public int getNAllocationMetas()
      Retrieve the number of values currently stored in the
      meta API array of the query's structure.
      Gibt zurück:
      the metadata API array size as a #guint.
    • getNAllocationParams

      public int getNAllocationParams()
      Retrieve the number of values currently stored in the
      allocator params array of the query's structure.

      If no memory allocator is specified, the downstream element can handle
      the default memory allocator. The first memory allocator in the query
      should be generic and allow mapping to system memory, all following
      allocators should be ordered by preference with the preferred one first.
      Gibt zurück:
      the allocator array size as a #guint.
    • getNAllocationPools

      public int getNAllocationPools()
      Retrieve the number of values currently stored in the
      pool array of the query's structure.
      Gibt zurück:
      the pool array size as a #guint.
    • getNBufferingRanges

      public int getNBufferingRanges()
      Retrieve the number of values currently stored in the
      buffered-ranges array of the query's structure.
      Gibt zurück:
      the range array size as a #guint.
    • getNSchedulingModes

      public int getNSchedulingModes()
      Retrieve the number of values currently stored in the
      scheduling mode array of the query's structure.
      Gibt zurück:
      the scheduling mode array size as a #guint.
    • getStructure

      public Structure getStructure()
      Get the structure of a query.
      Gibt zurück:
      the #GstStructure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.
    • hasSchedulingMode

      public boolean hasSchedulingMode(int mode)
      Check if @query has scheduling mode set.

      > When checking if upstream supports pull mode, it is usually not
      > enough to just check for GST_PAD_MODE_PULL with this function, you
      > also want to check whether the scheduling flags returned by
      > gst_query_parse_scheduling() have the seeking flag set (meaning
      > random access is supported, not only sequential pulls).
      Parameter:
      mode - the scheduling mode
      Gibt zurück:
      %TRUE when @mode is in the list of scheduling modes.
    • hasSchedulingModeWithFlags

      public boolean hasSchedulingModeWithFlags(int mode, int flags)
      Check if @query has scheduling mode set and @flags is set in
      query scheduling flags.
      Parameter:
      mode - the scheduling mode
      flags - #GstSchedulingFlags
      Gibt zurück:
      %TRUE when @mode is in the list of scheduling modes and @flags are compatible with query flags.
    • parseAcceptCapsResult

      public void parseAcceptCapsResult(@Nullable Int result)
      Parse the result from @query and store in @result.
      Parameter:
      result - location for the result
    • parseBufferingPercent

      public void parseBufferingPercent(@Nullable Int busy, @Nullable Int 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.
      Parameter:
      busy - if buffering is busy, or %NULL
      percent - a buffering percent, or %NULL
    • parseNthFormat

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

      public int parseNthSchedulingMode(int index)
      Parse an available query and get the scheduling mode
      at @index of the scheduling modes array.
      Parameter:
      index - position in the scheduling modes array to read
      Gibt zurück:
      a #GstPadMode of the scheduling mode at @index.
    • parseScheduling

      public void parseScheduling(@Nullable Int flags, @Nullable Int minsize, @Nullable Int maxsize, @Nullable Int align)
      Set the scheduling properties.
      Parameter:
      flags - #GstSchedulingFlags
      minsize - the suggested minimum size of pull requests
      maxsize - the suggested maximum size of pull requests:
      align - the suggested alignment of pull requests
    • parseSelectable

      public void parseSelectable(@Nullable Int selectable)
      Get the results of a selectable query. See also gst_query_set_selectable().
      Parameter:
      selectable - The resulting stream selection capability
    • parseUriRedirectionPermanent

      public void parseUriRedirectionPermanent(@Nullable Int 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.
      Parameter:
      permanent - if the URI redirection is permanent (may be %NULL)
    • removeNthAllocationMeta

      public void removeNthAllocationMeta(int index)
      Remove the metadata API at @index of the metadata API array.
      Parameter:
      index - position in the metadata API array to remove
    • removeNthAllocationParam

      public void removeNthAllocationParam(int index)
      Remove the allocation param at @index of the allocation param array.
      Parameter:
      index - position in the allocation param array to remove
    • removeNthAllocationPool

      public void removeNthAllocationPool(int index)
      Remove the allocation pool at @index of the allocation pool array.
      Parameter:
      index - position in the allocation pool array to remove
    • setAcceptCapsResult

      public void setAcceptCapsResult(boolean result)
      Set @result as the result for the @query.
      Parameter:
      result - the result to set
    • setBitrate

      public void setBitrate(int nominal_bitrate)
      Set the results of a bitrate query. The nominal bitrate is the average
      bitrate expected over the length of the stream as advertised in file
      headers (or similar).
      Parameter:
      nominal_bitrate - the nominal bitrate in bits per second
    • setBufferingPercent

      public void setBufferingPercent(boolean busy, int percent)
      Set the percentage of buffered data. This is a value between 0 and 100.
      The @busy indicator is %TRUE when the buffering is in progress.
      Parameter:
      busy - if buffering is busy
      percent - a buffering percent
    • setBufferingRange

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

      public void setBufferingStats(int mode, int avg_in, int avg_out, long buffering_left)
      Configures the buffering stats values in @query.
      Parameter:
      mode - a buffering mode
      avg_in - the average input rate
      avg_out - the average output rate
      buffering_left - amount of buffering time left in milliseconds
    • setCapsResult

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

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

      public void setConvert(int src_format, long src_value, int dest_format, long dest_value)
      Answer a convert query by setting the requested values.
      Parameter:
      src_format - the source #GstFormat
      src_value - the source value
      dest_format - the destination #GstFormat
      dest_value - the destination value
    • setDuration

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

      public void setFormats(int n_formats, Object... _ellipsis)
      Set the formats query result fields in @query. The number of formats passed
      must be equal to @n_formats.
      Parameter:
      n_formats - the number of formats to set.
      _ellipsis - A number of @GstFormats equal to @n_formats.
    • setLatency

      public void setLatency(boolean live, long min_latency, long max_latency)
      Answer a latency query by setting the requested values in the given format.
      Parameter:
      live - if there is a live element upstream
      min_latency - the minimal latency of the upstream elements
      max_latency - the maximal latency of the upstream elements
    • setNthAllocationParam

      public void setNthAllocationParam(int index, @Nullable Allocator allocator, @Nullable AllocationParams params)
      Parse an available query and get the allocator and its params
      at @index of the allocator array.
      Parameter:
      index - position in the allocator array to set
      allocator - new allocator to set
      params - parameters for the allocator
    • setNthAllocationPool

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

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

      public void setScheduling(int flags, int minsize, int maxsize, int align)
      Set the scheduling properties.
      Parameter:
      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(int format, boolean seekable, long segment_start, long segment_end)
      Set the seeking query result fields in @query.
      Parameter:
      format - the format to set for the @segment_start and @segment_end values
      seekable - the seekable flag to set
      segment_start - the segment_start to set
      segment_end - the segment_end to set
    • setSegment

      public void setSegment(double rate, int format, long start_value, long stop_value)
      Answer a segment query by setting the requested values. The normal
      playback segment of a pipeline is 0 to duration at the default rate of
      1.0. If a seek was performed on the pipeline to play a different
      segment, this query will return the range specified in the last seek.

      @start_value and @stop_value will respectively contain the configured
      playback range start and stop values expressed in @format.
      The values are always between 0 and the duration of the media and
      @start_value <= @stop_value. @rate will contain the playback rate. For
      negative rates, playback will actually happen from @stop_value to
      @start_value.
      Parameter:
      rate - the rate of the segment
      format - the #GstFormat of the segment values (@start_value and @stop_value)
      start_value - the start value
      stop_value - the stop value
    • setSelectable

      public void setSelectable(boolean selectable)
      Set the results of a selectable query. If the element answering the query can
      handle stream selection, @selectable should be set to %TRUE.
      Parameter:
      selectable - Whether the element can handle stream selection.
    • setUri

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

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

      public void setUriRedirection(@Nullable Str uri)
      Answer a URI query by setting the requested URI redirection.
      Parameter:
      uri - the URI to set
    • setUriRedirection

      public void setUriRedirection(String uri)
      Answer a URI query by setting the requested URI redirection.
      Parameter:
      uri - the URI to set
    • setUriRedirectionPermanent

      public void setUriRedirectionPermanent(boolean permanent)
      Answer a URI query by setting the requested URI redirection
      to permanent or not.
      Parameter:
      permanent - whether the redirect is permanent or not
    • writableStructure

      public Structure writableStructure()
      Get the structure of a query. This method should be called with a writable
      @query so that the returned structure is guaranteed to be writable.
      Gibt zurück:
      the #GstStructure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()