GstQuery

GstQuery — Dynamically register new query types

Synopsis


#include <gst/gst.h>


enum        GstQueryType;
#define     GST_QUERY_TYPE_RATE_DEN
struct      GstQueryTypeDefinition;
#define     GST_QUERY_TYPE_FUNCTION         (type, functionname, ...)
GstQueryType gst_query_type_register        (const gchar *nick,
                                             const gchar *description);
GstQueryType gst_query_type_get_by_nick     (const gchar *nick);
gboolean    gst_query_types_contains        (const GstQueryType *types,
                                             GstQueryType type);
G_CONST_RETURN GstQueryTypeDefinition* gst_query_type_get_details
                                            (GstQueryType type);
G_CONST_RETURN GList* gst_query_type_get_definitions
                                            (void);


Description

GstQuery functions are used to register a new query types to the gstreamer core. Query types can be used to perform queries on pads and elements.

Details

enum GstQueryType

typedef enum {
  GST_QUERY_NONE = 0,
  GST_QUERY_TOTAL,
  GST_QUERY_POSITION,
  GST_QUERY_LATENCY,
  GST_QUERY_JITTER,
  GST_QUERY_START,
  GST_QUERY_SEGMENT_END,
  GST_QUERY_RATE
} GstQueryType;

Standard predefined Query types

GST_QUERY_NONEinvalid query type
GST_QUERY_TOTALtotal length of stream
GST_QUERY_POSITIONcurrent position in stream
GST_QUERY_LATENCYlatency of stream
GST_QUERY_JITTERcurrent jitter of stream
GST_QUERY_STARTstart of configured segment
GST_QUERY_SEGMENT_ENDend of configured segment
GST_QUERY_RATEcurrent rate of the stream

GST_QUERY_TYPE_RATE_DEN

#define GST_QUERY_TYPE_RATE_DEN          G_GINT64_CONSTANT (1000000)

Rates are relative to this value


struct GstQueryTypeDefinition

struct GstQueryTypeDefinition {

  GstQueryType   value;
  gchar     	*nick;
  gchar     	*description;
};

A Query Type definition

GstQueryType valuethe unique id of the Query type
gchar *nicka short nick
gchar *descriptiona longer description of the query type

GST_QUERY_TYPE_FUNCTION()

#define     GST_QUERY_TYPE_FUNCTION(type, functionname, ...)

Convenience function to define a function that returns an array of query types.

type :Type of first argument for function
functionname :The name of the function
... :query types, 0 to end the list

gst_query_type_register ()

GstQueryType gst_query_type_register        (const gchar *nick,
                                             const gchar *description);

Create a new GstQueryType based on the nick or return an allrady registered query with that nick

nick : The nick of the new query
description : The description of the new query
Returns : A new GstQueryType or an already registered query with the same nick.

gst_query_type_get_by_nick ()

GstQueryType gst_query_type_get_by_nick     (const gchar *nick);

Return the query registered with the given nick.

nick : The nick of the query
Returns : The query with nick or GST_QUERY_NONE if the query was not registered.

gst_query_types_contains ()

gboolean    gst_query_types_contains        (const GstQueryType *types,
                                             GstQueryType type);

See if the given query is inside the query array.

types : The query array to search
type : the querytype to find
Returns : TRUE if the query is found inside the array

gst_query_type_get_details ()

G_CONST_RETURN GstQueryTypeDefinition* gst_query_type_get_details
                                            (GstQueryType type);

Get details about the given query.

type : The query to get details of
Returns : The GstQueryTypeDefinition for query or NULL on failure.

gst_query_type_get_definitions ()

G_CONST_RETURN GList* gst_query_type_get_definitions
                                            (void);

Get a list of all the registered query types.

Returns : A GList of GstQueryTypeDefinition.

See Also

GstPad, GstElement