7¤0ì•ÔÚTA¨2ã0333333333*ÃFDJa[äÊÆB›¤�–ª2ù¹�ý�*;�ýŽHÕÕÐÐˆö¿“È/Y3)�	 	Éd"�<"Ëë` Ž’¤Žâh(	rFQ1cŒQ¦ ª‘�  „Ø4=Ë)d                    ))) / (GST_SECOND * 60)) % 60) : 99,	\
    GST_CLOCK_STIME_IS_VALID (t) ?					\
    (guint) ((((GstClockTime)(ABS(t))) / GST_SECOND) % 60) : 99,	\
    GST_CLOCK_STIME_IS_VALID (t) ?					\
    (guint) (((GstClockTime)(ABS(t))) % GST_SECOND) : 999999999

typedef struct _GstClockEntry   GstClockEntry;
typedef struct _GstClock        GstClock;
typedef struct _GstClockClass   GstClockClass;
typedef struct _GstClockPrivate GstClockPrivate;

/* --- prototype for async callbacks --- */
/**
 * GstClockCallback:
 * @clock: The clock that triggered the callback
 * @time: The time it was triggered
 * @id: The #GstClockID that expired
 * @user_data: user data passed in the gst_clock_id_wait_async() function
 *
 * The function prototype of the callback.
 *
 * Returns: %TRUE or %FALSE (currently unused)
 */
typedef gboolean        (*GstClockCallback)     (GstClock *clock, GstClockTime time,
        th LOCK */
  /* our children, subclass are supposed to update these
   * fields to reflect their state with _iterate_*() */
  gint		 numchildren;
  GList		*children;
  guint32	 children_cookie;

  GstBus        *child_bus;
  GList         *messages;

  gboolean	 polling;
  gboolean       state_dirty;

  gboolean       clock_dirty;
  GstClock	*provided_clock;
  GstElement    *clock_provider;

  /*< private >*/
  GstBinPrivate *priv;

  gpointer _gst_reserved[GST_PADDING];
};

/**
 * GstBinClass:
 * @parent_class: bin parent class
 *
 * Subclasses can override #GstBinClass::add_element and #GstBinClass::remove_element
 * to update the list of children in the bin.
 *
 * The #GstBinClass::handle_message method can be overridden to implement custom
 * message handling.
 *
 * #GstBinClass::deep_element_added will be called when a new element has been
 * added to any bin inside this bin, so it will also be called if a new child
 * was added to a sub-bin of this bin. #GstBin implementations that override
 * this message should chain up to the parent class implementation so the
 * #GstBin::deep-element-added signal is emitted on all parents.
 */
struct _GstBinClass {
  GstElementClass parent_class;

  /*< private >*/
  GThreadPool  *pool; /* deprecated */

  /* signals */

  /**
   * GstBinClass::element_added:
   * @bin: the #GstBin
   * @child: the element that was added
   *
   * Method called when an element was added to the bin.
   */
  void		(*element_added)	(GstBin *bin, GstElement *child) (GstPlugin *plugin);

/**
 * GstPluginInitFullFunc:
 * @plugin: The plugin object
 * @user_data: extra data
 *
 * A plugin should provide a pointer to a function of either #GstPluginInitFunc
 * or this type in the plugin_desc struct.
 * The function will be called by the loader at startup. One would then
 * register each #GstPluginFeature. This version allows
 * user data to be passed to init function (useful for bindings).
 *
 * Returns: %TRUE if plugin initialised successfully
 */
/* FIXME 0.11: Merge with GstPluginInitFunc */
typedef gboolean (*GstPluginInitFullFunc) (GstPlugin *plugin, gpointer user_data);

/**
 * GstPluginDesc:
 * @major_version: the major version number of core that plugin was compiled for
 * @minor_version: the minor version number of core that plugin was compiled for
 * @name: a unique name of the plugin
 * @description: description of plugin
 * @plugin_init: pointer to the init function of this plugin.
 * @version: version of the plugin
 * @license: effective license of plugin
 * @source: source module plugin belongs to
 * @package: shipped package plugin belongs to
 * @origin: URL to provider of plugin
 * @release_datetime: (allow-none): date time string in ISO 8601
 *     format (or rather, a subset thereof), or %NULL. Allowed are the
 *     following formats: "YYYY-MM-DD" and "YYY-MM-DDTHH:MMZ" (with
 *     'T' a separator and 'Z' indicating UTC/Zulu time). This field
 *     should be set via the GST_PACKAGE_RELEASE_DATETIME
 *     preprocessor macro.
 *
 #include <gst/base/base-prelude.h>

G_BEGIN_DECLS

/**
 * GstQueueArray: (skip)
 *
 * Deprecated: 1.26: Use #GstVecDeque instead.
 */
typedef struct _GstQueueArray GST_BASE_DEPRECATED_TYPE_FOR(GstVecDeque) GstQueueArray;

GST_BASE_DEPRECATED_FOR(gst_vec_deque_new)
GstQueueArray * gst_queue_array_new       (guint initial_size);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_free)
void            gst_queue_array_free      (GstQueueArray * array);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_set_clear_func)
void            gst_queue_array_set_clear_func (GstQueueArray *array,
                                                GDestroyNotify clear_func);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_clear)
void            gst_queue_array_clear     (GstQueueArray * array);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_pop_head)
gpointer        gst_queue_array_pop_head  (GstQueueArray * array);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_peek_head)
gpointer        gst_queue_array_peek_head (GstQueueArray * array);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_peek_nth)
gpointer        gst_queue_array_peek_nth  (GstQueueArray * array, guint idx);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_pop_tail)
gpointer        gst_queue_array_pop_tail  (GstQueueArray * array);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_peek_tail)
gpointer        gst_queue_array_peek_tail (GstQueueArray * array);

GST_BASE_DEPRECATED_FOR(gst_vec_deque_push_tail)
void            gst_queue_array_push_tail (TANCE_GET_CLASS ((obj), GST_TYPE_PLUGIN_FEATURE, GstPluginFeatureClass))
#define GST_PLUGIN_FEATURE_CAST(obj)            ((GstPluginFeature*)(obj))

/**
 * GstPluginFeature:
 *
 * Opaque #GstPluginFeature structure.
 */
typedef struct _GstPluginFeature GstPluginFeature;
typedef struct _GstPluginFeatureClass GstPluginFeatureClass;

/**
 * GstRank:
 * @GST_RANK_NONE: will be chosen last or not at all
 * @GST_RANK_MARGINAL: unlikely to be chosen
 * @GST_RANK_SECONDARY: likely to be chosen
 * @GST_RANK_PRIMARY: will be chosen first
 *
 * Element priority ranks. Defines the order in which the autoplugger (or
 * similar rank-picking mechanisms, such as e.g. gst_element_make_from_uri())
 * will choose this element over an alternative one with the same function.
 *
 * These constants serve as a rough guidance for defining the rank of a
 * #GstPluginFeature. Any value is valid, including values bigger than
 * @GST_RANK_PRIMARY.
 */
typedef enum {
  GST_RANK_NONE                 = 0,
  GST_RANK_MARGINAL             = 64,
  GST_RANK_SECONDARY            = 128,
  GST_RANK_PRIMARY              = 256
} GstRank;

/**
 * gst_plugin_feature_get_name:
 * @feature: a #GstPluginFeature to get the name of @feature.
 *
 * Returns the name of @feature.
 * For a nameless plugin feature, this returns %NULL.
 *
 * Returns: (transfer none) (nullable): the name of @feature. MT safe.
 *
 */
#define                 gst_plugin_feature_get_name(feature)      GST_OBJECT_NAME(feature)

/**
 * gst_plugin_feature_set_nameGQuark for the "gst-copy" transform.
 */

GST_API GQuark _gst_meta_transform_copy;

/**
 * GST_META_TRANSFORM_IS_COPY:
 * @type: a transform type
 *
 * Check if the transform type is a copy transform
 */
#define GST_META_TRANSFORM_IS_COPY(type) ((type) == _gst_meta_transform_copy)

/**
 * GstMetaTransformCopy:
 * @region: %TRUE if only region is copied
 * @offset: the offset to copy, 0 if @region is %FALSE, otherwise > 0
 * @size: the size to copy, -1 or the buffer size when @region is %FALSE
 *
 * Extra data passed to a "gst-copy" transform #GstMetaTransformFunction.
 */
typedef struct {
  gboolean region;
  gsize offset;
  gsize size;
} GstMetaTransformCopy;

/**
 * GstMetaTransformFunction:
 * @transbuf: a #GstBuffer
 * @meta: a #GstMeta
 * @buffer: a #GstBuffer
 * @type: the transform type
 * @data: transform specific data.
 *
 * Function called for each @meta in @buffer as a result of performing a
 * transformation on @transbuf. Additional @type specific transform data
 * is passed to the function as @data.
 *
 * Implementations should check the @type of the transform and parse
 * additional type specific fields in @data that should be used to update
 * the metadata on @transbuf.
 *
 * Returns: %TRUE if the transform could be performed
 */
typedef gboolean (*GstMetaTransformFunction) (GstBuffer *transbuf,
                                              GstMeta *meta, GstBuffer *buffer,
                                              GQuark type, gpointer data);

/**
 * GstCustomMetaTrate that no output buffer was
 * generated, or from #GstBaseParseClass::pre_push_frame to to forego
 * pushing buffer.
 */
#define GST_BASE_PARSE_FLOW_DROPPED     GST_FLOW_CUSTOM_SUCCESS

/* not public API, use accessor macros below */
#define GST_BASE_PARSE_FLAG_LOST_SYNC (1 << 0)
#define GST_BASE_PARSE_FLAG_DRAINING  (1 << 1)

/**
 * GST_BASE_PARSE_LOST_SYNC:
 * @parse: base parse instance
 *
 * Obtains current sync status.
 */
#define GST_BASE_PARSE_LOST_SYNC(parse) (!!(GST_BASE_PARSE_CAST(parse)->flags & GST_BASE_PARSE_FLAG_LOST_SYNC))

/**
 * GST_BASE_PARSE_DRAINING:
 * @parse: base parse instance
 *
 * Obtains current drain status (ie. whether EOS has been received and
 * the parser is now processing the frames at the end of the stream)
 */
#define GST_BASE_PARSE_DRAINING(parse)  (!!(GST_BASE_PARSE_CAST(parse)->flags & GST_BASE_PARSE_FLAG_DRAINING))

/**
 * GstBaseParseFrameFlags:
 * @GST_BASE_PARSE_FRAME_FLAG_NONE: no flag
 * @GST_BASE_PARSE_FRAME_FLAG_NEW_FRAME: set by baseclass if current frame
 *   is passed for processing to the subclass for the first time
 *   (and not set on subsequent calls with same data).
 * @GST_BASE_PARSE_FRAME_FLAG_NO_FRAME: set to indicate this buffer should not be
 *   counted as frame, e.g. if this frame is dependent on a previous one.
 *   As it is not counted as a frame, bitrate increases but frame to time
 *   conversions are maintained.
 * @GST_BASE_PARSE_FRAME_FLAG_CLIP: @pre_push_frame can set this to indicate
 *    that regular segment clippi    GstAllocator *allocator,
                                                      const GstAllocationParams *params);

GST_API
void            gst_query_remove_nth_allocation_param (GstQuery *query, guint index);

/* metadata */

GST_API
void            gst_query_add_allocation_meta        (GstQuery *query, GType api, const GstStructure *params);

GST_API
guint           gst_query_get_n_allocation_metas     (GstQuery *query);

GST_API
GType           gst_query_parse_nth_allocation_meta  (GstQuery *query, guint index,
                                                      const GstStructure **params);

GST_API
void            gst_query_remove_nth_allocation_meta (GstQuery *query, guint index);

GST_API
gboolean        gst_query_find_allocation_meta       (GstQuery *query, GType api, guint *index);


/* scheduling query */
/**
 * GstSchedulingFlags:
 * @GST_SCHEDULING_FLAG_SEEKABLE: if seeking is possible
 * @GST_SCHEDULING_FLAG_SEQUENTIAL: if sequential access is recommended
 * @GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED: if bandwidth is limited and buffering possible (since 1.2)
 *
 * The different scheduling flags.
 */
typedef enum {
  GST_SCHEDULING_FLAG_SEEKABLE          = (1 << 0),
  GST_SCHEDULING_FLAG_SEQUENTIAL        = (1 << 1),
  GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED = (1 << 2)
} GstSchedulingFlags;

GST_API
GstQuery *      gst_query_new_scheduling          (void) G_GNUC_MALLOC;

GST_API
void            gst_query_set_scheduling          (GstQuery *query, GstSchedulingFlags flags,
  Y_LATENCY: latency of stream
 * @GST_QUERY_JITTER: current jitter of stream
 * @GST_QUERY_RATE: current rate of the stream
 * @GST_QUERY_SEEKING: seeking capabilities
 * @GST_QUERY_SEGMENT: segment start/stop positions
 * @GST_QUERY_CONVERT: convert values between formats
 * @GST_QUERY_FORMATS: query supported formats for convert
 * @GST_QUERY_BUFFERING: query available media for efficient seeking.
 * @GST_QUERY_CUSTOM: a custom application or element defined query.
 * @GST_QUERY_URI: query the URI of the source or sink.
 * @GST_QUERY_ALLOCATION: the buffer allocation properties
 * @GST_QUERY_SCHEDULING: the scheduling properties
 * @GST_QUERY_ACCEPT_CAPS: the accept caps query
 * @GST_QUERY_CAPS: the caps query
 * @GST_QUERY_DRAIN: wait till all serialized data is consumed downstream
 * @GST_QUERY_CONTEXT: query the pipeline-local context from
 *     downstream or upstream (since 1.2)
 * @GST_QUERY_BITRATE: the bitrate query (since 1.16)
 * @GST_QUERY_SELECTABLE: Query stream selection capability (Since: 1.22)
 *
 * Standard predefined Query types
 */
/* NOTE: don't forget to update the table in gstquery.c when changing
 * this enum */
typedef enum {
  GST_QUERY_UNKNOWN      = GST_QUERY_MAKE_TYPE (0, 0),
  GST_QUERY_POSITION     = GST_QUERY_MAKE_TYPE (10, _FLAG(BOTH)),
  GST_QUERY_DURATION     = GST_QUERY_MAKE_TYPE (20, _FLAG(BOTH)),
  GST_QUERY_LATENCY      = GST_QUERY_MAKE_TYPE (30, _FLAG(BOTH)),
  GST_QUERY_JITTER       = GST_QUERY_MAKE_TYPE (40, _FLAG(BOTH)),
  GST_QUERY_RATE      sage *message);

  /**
   * GstBusClass::sync_message:
   * @bus: the #GstBus
   * @message: the message that has been posted synchronously
   *
   * A message has been posted on the bus.
   */
  void (*sync_message)  (GstBus *bus, GstMessage *message);

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

GST_API
GType                   gst_bus_get_type                (void);

GST_API
GstBus*                 gst_bus_new                     (void);

GST_API
gboolean                gst_bus_post                    (GstBus * bus, GstMessage * message);

GST_API
gboolean                gst_bus_have_pending            (GstBus * bus);

GST_API
GstMessage *            gst_bus_peek                    (GstBus * bus);

GST_API
GstMessage *            gst_bus_pop                     (GstBus * bus);

GST_API
GstMessage *            gst_bus_pop_filtered            (GstBus * bus, GstMessageType types);

GST_API
GstMessage *            gst_bus_timed_pop               (GstBus * bus, GstClockTime timeout);

GST_API
GstMessage *            gst_bus_timed_pop_filtered      (GstBus * bus, GstClockTime timeout, GstMessageType types);

GST_API
void                    gst_bus_set_flushing            (GstBus * bus, gboolean flushing);

/* synchronous dispatching */

GST_API
void                    gst_bus_set_sync_handler        (GstBus * bus, GstBusSyncHandler func,
                                                         gpointer user_data, GDestroyNotify notify);

/* asynchronous message notificationLOCATION_COUNTRY                 "geo-location-country"
/**
 * GST_TAG_GEO_LOCATION_CITY:
 *
 * The city (english name) where the media has been produced (string).
 */
#define GST_TAG_GEO_LOCATION_CITY                    "geo-location-city"
/**
 * GST_TAG_GEO_LOCATION_SUBLOCATION:
 *
 * A location 'smaller' than GST_TAG_GEO_LOCATION_CITY that specifies better
 * where the media has been produced. (e.g. the neighborhood) (string).
 *
 * This tag has been added as this is how it is handled/named in XMP's
 * Iptc4xmpcore schema.
 */
#define GST_TAG_GEO_LOCATION_SUBLOCATION             "geo-location-sublocation"
/**
 * GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR:
 *
 * Represents the expected error on the horizontal positioning in
 * meters (double).
 */
#define GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR   "geo-location-horizontal-error"
/**
 * GST_TAG_GEO_LOCATION_MOVEMENT_SPEED:
 *
 * Speed of the capturing device when performing the capture.
 * Represented in m/s. (double)
 *
 * See also #GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION
 */
#define GST_TAG_GEO_LOCATION_MOVEMENT_SPEED       "geo-location-movement-speed"
/**
 * GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION:
 *
 * Indicates the movement direction of the device performing the capture
 * of a media. It is represented as degrees in floating point representation,
 * 0 means the geographic north, and increases clockwise (double from 0 to 360)
 *
 * See also #GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION
 */
#define GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION "geo-ltion unrefs the taglist in the argument and refs the
 * taglist that it returns. Don't access the argument after calling this
 * function. See also: gst_tag_list_ref().
 *
 * Returns: (transfer full): a writable taglist which may or may not be the
 *     same as @taglist
 */
#define gst_tag_list_make_writable(taglist)   GST_TAG_LIST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (taglist)))

/* GStreamer core tags */
/**
 * GST_TAG_TITLE:
 *
 * commonly used title (string)
 *
 * The title as it should be displayed, e.g. 'The Doll House'
 */
#define GST_TAG_TITLE                  "title"
/**
 * GST_TAG_TITLE_SORTNAME:
 *
 * commonly used title, as used for sorting (string)
 *
 * The title as it should be sorted, e.g. 'Doll House, The'
 */
#define GST_TAG_TITLE_SORTNAME         "title-sortname"
/**
 * GST_TAG_ARTIST:
 *
 * person(s) responsible for the recording (string)
 *
 * The artist name as it should be displayed, e.g. 'Jimi Hendrix' or
 * 'The Guitar Heroes'
 */
#define GST_TAG_ARTIST                 "artist"
/**
 * GST_TAG_ARTIST_SORTNAME:
 *
 * person(s) responsible for the recording, as used for sorting (string)
 *
 * The artist name as it should be sorted, e.g. 'Hendrix, Jimi' or
 * 'Guitar Heroes, The'
 */
#define GST_TAG_ARTIST_SORTNAME        "artist-sortname"
/**
 * GST_TAG_ALBUM:
 *
 * album containing this data (string)
 *
 * The album name as it should be displayed, e.g. 'The Jazz Guitar'
 */
#define GST_TAG_ALBUM                  "album"
/**
 * GST_TAG_ALBUM_SORTNAtag is decoded
 * @GST_TAG_FLAG_COUNT: number of tag flags
 *
 * Extra tag flags used when registering tags.
 */
/* FIXME: these are not really flags .. */
typedef enum {
  GST_TAG_FLAG_UNDEFINED,
  GST_TAG_FLAG_META,
  GST_TAG_FLAG_ENCODED,
  GST_TAG_FLAG_DECODED,
  GST_TAG_FLAG_COUNT
} GstTagFlag;

#define GST_TAG_FLAG_IS_VALID(flag)     (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT))

/**
 * GstTagList:
 * @mini_object: the parent type
 *
 * Object describing tags / metadata.
 */
typedef struct _GstTagList GstTagList;
struct _GstTagList {
  GstMiniObject mini_object;
};

GST_API GType _gst_tag_list_type;

#define GST_TAG_LIST(x)       ((GstTagList *) (x))
#define GST_TYPE_TAG_LIST     (_gst_tag_list_type)
#define GST_IS_TAG_LIST(obj)  (GST_IS_MINI_OBJECT_TYPE((obj), GST_TYPE_TAG_LIST))

/**
 * GstTagForeachFunc:
 * @list: the #GstTagList
 * @tag: a name of a tag in @list
 * @user_data: user data
 *
 * A function that will be called in gst_tag_list_foreach(). The function may
 * not modify the tag list.
 */
typedef void (*GstTagForeachFunc) (const GstTagList * list,
                                   const gchar      * tag,
                                   gpointer           user_data);

/**
 * GstTagMergeFunc:
 * @dest: the destination #GValue
 * @src: the source #GValue
 *
 * A function for merging multiple values of a tag used when registering
 * tags.
 */
typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);

GST_API
GType        gst_tag_list_gg_cond_signal (GST_STATE_GET_COND (elem));
#define GST_STATE_BROADCAST(elem)              g_cond_broadcast (GST_STATE_GET_COND (elem));

/**
 * GstElement:
 * @state_lock: Used to serialize execution of gst_element_set_state()
 * @state_cond: Used to signal completion of a state change
 * @state_cookie: Used to detect concurrent execution of
 * gst_element_set_state() and gst_element_get_state()
 * @target_state: the target state of an element as set by the application
 * @current_state: the current state of an element
 * @next_state: the next state of an element, can be #GST_STATE_VOID_PENDING if
 * the element is in the correct state.
 * @pending_state: the final state the element should go to, can be
 * #GST_STATE_VOID_PENDING if the element is in the correct state
 * @last_return: the last return value of an element state change
 * @bus: the bus of the element. This bus is provided to the element by the
 * parent element or the application. A #GstPipeline has a bus of its own.
 * @clock: the clock of the element. This clock is usually provided to the
 * element by the toplevel #GstPipeline.
 * @base_time: the time of the clock right before the element is set to
 * PLAYING. Subtracting @base_time from the current clock time in the PLAYING
 * state will yield the running_time against the clock.
 * @start_time: the running_time of the last PAUSED state
 * @numpads: number of pads of the element, includes both source and sink pads.
 * @pads: (element-type Gst.Pad): list of pads
 * @numsNING_OBJECT (el, "error: %s", __dbg);                        \
  gst_element_message_full (GST_ELEMENT(el),                            \
    GST_MESSAGE_ERROR, GST_ ## domain ## _ERROR,                        \
      GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,        \
      GST_FUNCTION, __LINE__);                                          \
} G_STMT_END

/**
 * GST_ELEMENT_WARNING_WITH_DETAILS:
 * @el:     the element that generates the warning
 * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see [GstGError](gsterror))
 * @code:   error code defined for that domain (see [GstGError](gsterror))
 * @text:   the message to display (format string and args enclosed in
            parentheses)
 * @debug:  debugging information for the message (format string and args
            enclosed in parentheses)
 * @args:   optional name, type, value triplets, which will be stored
 *          in the associated GstStructure. NULL terminator required.
 *          Must be enclosed within parentheses.
 *
 * Utility function that elements can use in case they encountered a non-fatal
 * data processing problem. The pipeline will post a warning message and the
 * application will be informed.
 *
 * Since: 1.10
 */
#define GST_ELEMENT_WARNING_WITH_DETAILS(el, domain, code, text, debug, args)\
G_STMT_START {                                                          \
  gchar *__txt = _gst_element_error_printf text;                        \
  gchar *__dbg = _gst_element_error_printf debug;      _'.
 * @plugin: The #GstPlugin where to register the element.
 *
 * This macro can be used to register an element into a #GstPlugin.
 * This method will be usually called in the plugin init function
 * but can also be called with a NULL plugin,
 * for example with a static registration of the element.
 * It has to be used in combination with #GST_ELEMENT_REGISTER_DECLARE.
 *
 * ```
 * GstPlugin* plugin;
 *
 * ...
 *
 * GST_ELEMENT_REGISTER (stream_filter, plugin);
 * ```
 *
 * Since: 1.20
 */
#define GST_ELEMENT_REGISTER(element, plugin) G_PASTE(gst_element_register_, element) (plugin)

/* gstelement.h and gstelementfactory.h include each other */
typedef struct _GstElement GstElement;
typedef struct _GstElementClass GstElementClass;

/* gstmessage.h needs State */
/**
 * GstState:
 * @GST_STATE_VOID_PENDING: no pending state.
 * @GST_STATE_NULL        : the NULL state or initial state of an element.
 * @GST_STATE_READY       : the element is ready to go to PAUSED.
 * @GST_STATE_PAUSED      : the element is PAUSED, it is ready to accept and
 *                          process data. Sink elements however only accept one
 *                          buffer and then block.
 * @GST_STATE_PLAYING     : the element is PLAYING, the #GstClock is running and
 *                          the data is flowing.
 *
 * The possible states an element can be in. States can be changed using
 * gst_element_set_state() and checked using gst_element_get_state().
 */
typedef enum {
  GST_STATE_VOID_PENDING    TR_NAME().
 *
 * Returns: the value passed to @ptr.
 */
#define GST_DEBUG_FUNCPTR(ptr) \
  (_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr) , ptr)

/**
 * GST_DEBUG_FUNCPTR_NAME:
 * @ptr: address of the function of which to look up the name
 *
 * Retrieves the name of the function, if it was previously registered with
 * GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
 *
 * This macro returns a constant string which must not be modified or
 * freed by the caller.
 */
#define GST_DEBUG_FUNCPTR_NAME(ptr) \
  _gst_debug_nameof_funcptr((GstDebugFuncPtr)ptr)


#else /* GST_DISABLE_GST_DEBUG */


#ifndef GST_INFO_C

#if defined(__GNUC__) && __GNUC__ >= 3
#  pragma GCC poison gst_debug_log
#  pragma GCC poison gst_debug_log_valist
#  pragma GCC poison gst_debug_log_literal
#  pragma GCC poison gst_debug_log_id
#  pragma GCC poison gst_debug_log_id_valist
#  pragma GCC poison gst_debug_log_id_literal
#  pragma GCC poison _gst_debug_category_new
#endif

#define _gst_debug_min GST_LEVEL_NONE

#define gst_debug_set_default_threshold(level)		G_STMT_START{ }G_STMT_END
#define gst_debug_get_default_threshold()		(GST_LEVEL_NONE)

#define gst_debug_level_get_name(level)				("NONE")
#define gst_debug_message_get(message)  			("")
#define gst_debug_message_get_id(message)  			(NULL)
#define gst_debug_add_log_function(func,data,notify)    G_STMT_START{ }G_STMT_END
#define gst_debug_set_active(active)			G_STMT_START{ }G_STMT_END
#define gst_debug_is_active()				(FALSE)
#defiEL_FIXME,   id,  __VA_ARGS__)
#define GST_TRACE_ID(id,...)	GST_CAT_LEVEL_LOG_ID (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   id,  __VA_ARGS__)

#define GST_ERROR(...)			GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
#define GST_WARNING(...)		GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
#define GST_INFO(...)			GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
#define GST_DEBUG(...)			GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
#define GST_LOG(...)			GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
#define GST_FIXME(...)			GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
#define GST_TRACE(...)		GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   NULL, __VA_ARGS__)

#else
#ifdef G_HAVE_GNUC_VARARGS

#define GST_CAT_ERROR_OBJECT(cat,obj,args...)	GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  ##args )
#define GST_CAT_WARNING_OBJECT(cat,obj,args...)	GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  ##args )
#define GST_CAT_INFO_OBJECT(cat,obj,args...)	GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  ##args )
#define GST_CAT_DEBUG_OBJECT(cat,obj,args...)	GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  ##args )
#define GST_CAT_LOG_OBJECT(cat,obj,args...)	GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  ##args )
#define GST_CAT_FIXME_OBJECT(cat,obj,args...)	GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  ##args )
#define GST_CAT_TRACE_OBJECmat, va_list varargs)
{
  if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) {
    gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
        varargs);
  }
}

static inline void
GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
    gpointer object, const char *format, ...)
{
  va_list varargs;

  va_start (varargs, format);
  GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
  va_end (varargs);
}
#endif
#endif /* G_HAVE_ISO_VARARGS */

/**
 * GST_CAT_LEVEL_LOG_ID:
 * @cat: category to use
 * @level: the severity of the message
 * @id: (transfer none) (allow-none): the identifier of the object this message
 *     relates to, or %NULL if none
 * @...: A printf-style message to output
 *
 * Outputs a debugging message. This is the most general macro for outputting
 * debugging messages. You will probably want to use one of the ones described
 * below.
 *
 * There is no need to finish the end of the debug message with a newline
 * character, a newline character will be added automatically.
 *
 * Since: 1.22
 */
#ifdef G_HAVE_ISO_VARARGS
#define GST_CAT_LEVEL_LOG_ID(cat,level,id,...) G_STMT_START{		\
  if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) {						\
    gst_debug_log_id ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,	\
		      (id), __VA_ARGS__);				\
  }									\
}G_STMT_END
#else /* G_HAVE_GNUC_VARARGS */
#ifdef G_HAVE_GNUC_VARARGS
#define GST_CAT_LEVEL_LOG_ID(cat,level,id,args...) Goks up an existing #GstDebugCategory by its @name and sets @cat. If the
 * category is not found, but GST_CAT_DEFAULT is defined, that is assigned to
 * @cat. Otherwise @cat will be %NULL.
 *
 * |[<!-- language="C" -->
 * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
 * #define GST_CAT_DEFAULT gst_myplugin_debug
 * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
 * ...
 * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
 * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
 * ]|
 */
#ifdef GST_CAT_DEFAULT
#define GST_DEBUG_CATEGORY_GET(cat,name)  G_STMT_START{\
  cat = _gst_debug_get_category (name);			\
  if (!cat) {						\
    cat = GST_CAT_DEFAULT;				\
  }							\
}G_STMT_END
#else
#define GST_DEBUG_CATEGORY_GET(cat,name)  G_STMT_START{\
  cat = _gst_debug_get_category (name);			\
}G_STMT_END
#endif

/**
 * GST_CAT_DEFAULT:
 *
 * Default gstreamer core debug log category. Please define your own.
 */

GST_API GstDebugCategory *	GST_CAT_DEFAULT;
/* this symbol may not be used */

GST_API gboolean                 _gst_debug_enabled;

/* the min debug level, used for quickly discarding debug
 * messages that fall under the threshold. */

GST_API GstDebugLevel            _gst_debug_min;

/**
 * GST_CAT_LEVEL_LOG:
 * @cat: category to use
 * @level: the severity of the message
 * @object: (allow-none): the #GObject the message belongs to or %NULL if none
 * @...: A printf-style message to output
 *
 * Outputs a debugging message. This is the momessages that are very common but might be
 *  useful to know. As a rule of thumb a pipeline that is running as expected
 *  should never output anything else but LOG messages whilst processing data.
 *  Use this log level to log recurring information in chain functions and
 *  loop functions, for example.
 * @GST_LEVEL_TRACE: Tracing-related messages.
 *  Examples for this are referencing/dereferencing of objects.
 * @GST_LEVEL_MEMDUMP: memory dump messages are used to log (small) chunks of
 *  data as memory dumps in the log. They will be displayed as hexdump with
 *  ASCII characters.
 * @GST_LEVEL_COUNT: The number of defined debugging levels.
 *
 * The level defines the importance of a debugging message. The more important a
 * message is, the greater the probability that the debugging system outputs it.
 */
typedef enum {
  GST_LEVEL_NONE = 0,
  GST_LEVEL_ERROR = 1,
  GST_LEVEL_WARNING = 2,
  GST_LEVEL_FIXME = 3,
  GST_LEVEL_INFO = 4,
  GST_LEVEL_DEBUG = 5,
  GST_LEVEL_LOG = 6,
  GST_LEVEL_TRACE = 7,
  /* add more */
  GST_LEVEL_MEMDUMP = 9,
  /* add more */
  GST_LEVEL_COUNT
} GstDebugLevel;

/**
 * GST_LEVEL_DEFAULT:
 *
 * Defines the default debugging level to be used with GStreamer. It is normally
 * set to #GST_LEVEL_NONE so nothing get printed.
 * As it can be configured at compile time, developer builds may chose to
 * override that though.
 * You can use this as an argument to gst_debug_set_default_threshold() to
 * reset the debugging output to default behaviour.
 */
#ifnst_buffer_get_reference_timestamp_meta (GstBuffer * buffer,
                                                                     GstCaps   * reference);

G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBuffer, gst_buffer_unref)

G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBufferPool, gst_object_unref)

/**
 * GstBufferMapInfo: (skip):
 *
 * Alias for #GstMapInfo to be used with g_auto():
 * ```c
 * void my_func(GstBuffer *buf)
 * {
 *   g_auto(GstBufferMapInfo) map = GST_MAP_INFO_INIT;
 *   if (!gst_buffer_map(buf, &map, GST_MAP_READWRITE))
 *     return;
 *   ...
 *   // No need to call gst_buffer_unmap()
 * }
 * ```
 *
 * #GstMapInfo cannot be used with g_auto() because it is ambiguous whether it
 * needs to be unmapped using gst_buffer_unmap() or gst_memory_unmap().
 *
 * See also #GstMemoryMapInfo.
 *
 * Since: 1.22
 */
typedef GstMapInfo GstBufferMapInfo;

static inline void _gst_buffer_map_info_clear(GstBufferMapInfo *info)
{
  /* we need to check for NULL, it is possible that we tried to map a buffer
   * without memory and we should be able to unmap that fine */
  if (G_LIKELY (info->memory)) {
    gst_memory_unmap (info->memory, info);
    gst_memory_unref (info->memory);
  }
}

G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GstBufferMapInfo, _gst_buffer_map_info_clear)

G_END_DECLS

#endif /* __GST_BUFFER_H__ */
/* GStreamer
 * Copyright (C) 2015 Centricular Ltd
 *  @author: Edward Hervey <edward@centricular.com>
 *  @author: Jan Schmidt <jan@centricular.com>
 *
 * gststreams.h : Header for GstStream subsystem
 *
 *ue to receive the data
 * @b: (transfer full): a #GstBuffer to assign to the GstValue
 *
 * Sets @b as the value of @v.  Caller gives away reference to buffer.
 */
#define         gst_value_take_buffer(v,b)      g_value_take_boxed(v,(b))
/**
 * gst_value_get_buffer:
 * @v: a #GValue to query
 *
 * Receives a #GstBuffer as the value of @v. Does not return a reference to
 * the buffer, so the pointer is only valid for as long as the caller owns
 * a reference to @v.
 *
 * Returns: (transfer none): buffer
 */
#define         gst_value_get_buffer(v)         GST_BUFFER_CAST (g_value_get_boxed(v))

typedef struct _GstParentBufferMeta GstParentBufferMeta;

/**
 * GstParentBufferMeta:
 * @parent: the parent #GstMeta structure
 * @buffer: the #GstBuffer on which a reference is being held.
 *
 * The #GstParentBufferMeta is a #GstMeta which can be attached to a #GstBuffer
 * to hold a reference to another buffer that is only released when the child
 * #GstBuffer is released.
 *
 * Typically, #GstParentBufferMeta is used when the child buffer is directly
 * using the #GstMemory of the parent buffer, and wants to prevent the parent
 * buffer from being returned to a buffer pool until the #GstMemory is available
 * for re-use.
 *
 * Since: 1.6
 */
struct _GstParentBufferMeta
{
  GstMeta parent;

  /*< public >*/
  GstBuffer *buffer;
};

GST_API
GType gst_parent_buffer_meta_api_get_type (void);
#ifndef GST_DISABLE_DEPRECATED
#define GST_TYPE_PARENT_BUFFER_META_API_TYPE GST_PARENT_BUFFER_META_API_TYPE
cDeque * array);

GST_API
gpointer        gst_vec_deque_peek_head_struct (GstVecDeque * array);

GST_API
gpointer        gst_vec_deque_peek_nth_struct  (GstVecDeque * array, gsize idx);

GST_API
gboolean        gst_vec_deque_drop_struct      (GstVecDeque * array,
                                                gsize           idx,
                                                gpointer        p_struct);
GST_API
gpointer        gst_vec_deque_pop_tail_struct  (GstVecDeque * array);

GST_API
gpointer        gst_vec_deque_peek_tail_struct (GstVecDeque * array);

GST_API
void            gst_vec_deque_push_sorted (GstVecDeque * array, 
                                           gpointer data,
                                           GCompareDataFunc func, 
                                           gpointer user_data);

GST_API
void            gst_vec_deque_push_sorted_struct (GstVecDeque * array, 
                                                  gpointer p_struct,
                                                  GCompareDataFunc func, 
                                                  gpointer user_data);

GST_API
void            gst_vec_deque_sort (GstVecDeque *array,
                                    GCompareDataFunc compare_func,
                                    gpointer user_data);

G_END_DECLS

#endif
/* GStreamer
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
 *                    2000 Wim Taymans <wtay@chello.be>
 *
 * gstbuffer.h: Header for GstBuffer object user_data);


/**
 * GstCollectPadsQueryFunction:
 * @pads: the #GstCollectPads that triggered the callback
 * @pad: the #GstPad that received an event
 * @query: the #GstEvent received
 * @user_data: user data passed to gst_collect_pads_set_query_function()
 *
 * A function that will be called while processing a query. It takes
 * ownership of the query and is responsible for chaining up (to
 * events downstream (with gst_pad_event_default()).
 *
 * Returns: %TRUE if the pad could handle the event
 */
typedef gboolean (*GstCollectPadsQueryFunction)        (GstCollectPads *pads, GstCollectData * pad,
                                                        GstQuery * query, gpointer user_data);

/**
 * GstCollectPadsClipFunction:
 * @pads: a #GstCollectPads
 * @data: a #GstCollectData
 * @inbuffer: (transfer full): the input #GstBuffer
 * @outbuffer: (out): the output #GstBuffer
 * @user_data: user data
 *
 * A function that will be called when @inbuffer is received on the pad managed
 * by @data in the collectpad object @pads.
 *
 * The function should use the segment of @data and the negotiated media type on
 * the pad to perform clipping of @inbuffer.
 *
 * This function takes ownership of @inbuffer and should output a buffer in
 * @outbuffer or return %NULL in @outbuffer if the buffer should be dropped.
 *
 * Returns: a #GstFlowReturn that corresponds to the result of clipping.
 */
typedef GstFlowReturn (*GstCollectPadsClipFunction) (GstCollectPads *pads, GstCollectData *data,
      << 1,
  GST_COLLECT_PADS_STATE_NEW_SEGMENT = 1 << 2,
  GST_COLLECT_PADS_STATE_WAITING = 1 << 3,
  GST_COLLECT_PADS_STATE_LOCKED = 1 << 4
} GstCollectPadsStateFlags;

/**
 * GST_COLLECT_PADS_STATE:
 * @data: a #GstCollectData.
 *
 * A flags word containing #GstCollectPadsStateFlags flags set
 * on this collected pad.
 */
#define GST_COLLECT_PADS_STATE(data)                 (((GstCollectData *) data)->state)
/**
 * GST_COLLECT_PADS_STATE_IS_SET:
 * @data: a #GstCollectData.
 * @flag: the #GstCollectPadsStateFlags to check.
 *
 * Gives the status of a specific flag on a collected pad.
 */
#define GST_COLLECT_PADS_STATE_IS_SET(data,flag)     !!(GST_COLLECT_PADS_STATE (data) & flag)
/**
 * GST_COLLECT_PADS_STATE_SET:
 * @data: a #GstCollectData.
 * @flag: the #GstCollectPadsStateFlags to set.
 *
 * Sets a state flag on a collected pad.
 */
#define GST_COLLECT_PADS_STATE_SET(data,flag)        (GST_COLLECT_PADS_STATE (data) |= flag)
/**
 * GST_COLLECT_PADS_STATE_UNSET:
 * @data: a #GstCollectData.
 * @flag: the #GstCollectPadsStateFlags to clear.
 *
 * Clears a state flag on a collected pad.
 */
#define GST_COLLECT_PADS_STATE_UNSET(data,flag)      (GST_COLLECT_PADS_STATE (data) &= ~(flag))

/**
 * GST_COLLECT_PADS_DTS:
 * @data: A #GstCollectData.
 *
 * Returns the DTS that has been converted to running time when using
 * gst_collect_pads_clip_running_time(). Unlike the value saved into
 * the buffer, this value is of type gint64 and may be negative. This allow
 * properly handling streams wing declares to which scope such a meta data field
 * relates to. If it is e.g. %GST_TRACER_VALUE_SCOPE_PAD, then each of the log
 * events may contain values for different #GstPads.
 *
 * Since: 1.8
 */
typedef enum
{
  GST_TRACER_VALUE_SCOPE_PROCESS,
  GST_TRACER_VALUE_SCOPE_THREAD,
  GST_TRACER_VALUE_SCOPE_ELEMENT,
  GST_TRACER_VALUE_SCOPE_PAD
} GstTracerValueScope;

/**
 * GstTracerValueFlags:
 * @GST_TRACER_VALUE_FLAGS_NONE: no flags
 * @GST_TRACER_VALUE_FLAGS_OPTIONAL: the value is optional. When using this flag
 *   one need to have an additional boolean arg before this value in the
 *   var-args list passed to  gst_tracer_record_log().
 * @GST_TRACER_VALUE_FLAGS_AGGREGATED: the value is a combined figure, since the
 *   start of tracing. Examples are averages or timestamps.
 *
 * Flag that describe the value. These flags help applications processing the
 * logs to understand the values.
 */
typedef enum
{
  GST_TRACER_VALUE_FLAGS_NONE = 0,
  GST_TRACER_VALUE_FLAGS_OPTIONAL = (1 << 0),
  GST_TRACER_VALUE_FLAGS_AGGREGATED = (1 << 1),
} GstTracerValueFlags;

GST_API
GstTracerRecord * gst_tracer_record_new (const gchar * name, const gchar * firstfield, ...) G_GNUC_NULL_TERMINATED;

#ifndef GST_DISABLE_GST_DEBUG
GST_API
void              gst_tracer_record_log (GstTracerRecord *self, ...);
#else
#define gst_tracer_record_log(...) G_STMT_START {} G_STMT_END
#endif

G_END_DECLS

#endif /* __GST_TRACER_RECORD_H__ */
/* GstTestClock - A deterministic clock for GStreamer unit tests
 *
 * Co   * GstControlBindingClass::get_g_value_array:
   * @binding: the control binding
   * @timestamp: the time that should be processed
   * @interval: the time spacing between subsequent values
   * @n_values: the number of values
   * @values: (array length=n_values): array to put control-values in
   *
   * Fetch a series of control-values as g_values
   *
   * Returns: %TRUE if the given array could be filled, %FALSE otherwise
   */
  gboolean (* get_g_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, GValue *values);

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

#define GST_CONTROL_BINDING_PSPEC(cb) (((GstControlBinding *) cb)->pspec)

GST_API
GType               gst_control_binding_get_type (void);

/* Functions */

GST_API
gboolean            gst_control_binding_sync_values        (GstControlBinding * binding, GstObject *object,
                                                            GstClockTime timestamp, GstClockTime last_sync);
GST_API
GValue *            gst_control_binding_get_value          (GstControlBinding *binding,
                                                            GstClockTime timestamp);
GST_API
gboolean            gst_control_binding_get_value_array    (GstControlBinding *binding, GstClockTime timestamp,
                                                            GstClockTime interval, guint n_values, gpointer values);
GST_API
gboolean            gst_control_binding_get_g_value_array  (he #GstAggregatorPads. If the subclass returns
 *                  GST_FLOW_EOS, sending of the eos event will be taken care
 *                  of. Once / if a buffer has been constructed from the
 *                  aggregated buffers, the subclass should call _finish_buffer.
 * @stop:           Optional.
 *                  Called when the element goes from PAUSED to READY.
 *                  The subclass should free all resources and reset its state.
 * @start:          Optional.
 *                  Called when the element goes from READY to PAUSED.
 *                  The subclass should get ready to process
 *                  aggregated buffers.
 * @get_next_time:  Optional.
 *                  Called when the element needs to know the running time of the next
 *                  rendered buffer for live pipelines. This causes deadline
 *                  based aggregation to occur. Defaults to returning
 *                  GST_CLOCK_TIME_NONE causing the element to wait for buffers
 *                  on all sink pads before aggregating.
 * @create_new_pad: Optional.
 *                  Called when a new pad needs to be created. Allows subclass that
 *                  don't have a single sink pad template to provide a pad based
 *                  on the provided information.
 * @update_src_caps: Lets subclasses update the #GstCaps representing
 *                   the src pad caps before usage.  The result should end up
 *                   in @ret. Return %GST_AGGREGATOR_FLOriable name to be declared
 *
 * Declare a #GRecMutexLocker variable with g_autoptr() and lock the pad. The
 * recursive mutex will be unlocked automatically when leaving the scope.
 *
 * ``` c
 * {
 *   GST_PAD_STREAM_AUTO_LOCK (pad, locker);
 *
 *   gst_pad_push_event(pad, event1);
 *   if (cond) {
 *     // No need to unlock
 *     return;
 *   }
 *
 *   // Unlock before end of scope
 *   g_clear_pointer (&locker, g_rec_mutex_locker_free);
 *   gst_pad_push_event(pad, event2);
 * }
 * ```
 * Since: 1.24.0
 */
#define GST_PAD_STREAM_AUTO_LOCK(pad, var) g_autoptr(GRecMutexLocker) G_GNUC_UNUSED var = g_rec_mutex_locker_new(GST_PAD_GET_STREAM_LOCK(pad))

/**
 * GST_PAD_STREAM_TRYLOCK:
 * @pad: a #GstPad
 *
 * Try to take the pad's stream lock, and return %TRUE if the lock could be
 * taken, and otherwise %FALSE.
 */
#define GST_PAD_STREAM_TRYLOCK(pad)     g_rec_mutex_trylock(GST_PAD_GET_STREAM_LOCK(pad))
/**
 * GST_PAD_STREAM_UNLOCK:
 * @pad: a #GstPad
 *
 * Release the pad's stream lock.
 */
#define GST_PAD_STREAM_UNLOCK(pad)      g_rec_mutex_unlock(GST_PAD_GET_STREAM_LOCK(pad))
/**
 * GST_PAD_LAST_FLOW_RETURN:
 * @pad: a #GstPad
 *
 * Gets the last flow return on this pad
 *
 * Since: 1.4
 */
#define GST_PAD_LAST_FLOW_RETURN(pad)   (GST_PAD_CAST(pad)->ABI.abi.last_flowret)

#define GST_PAD_BLOCK_GET_COND(pad)     (&GST_PAD_CAST(pad)->block_cond)
#define GST_PAD_BLOCK_WAIT(pad)         (g_cond_wait(GST_PAD_BLOCK_GET_COND (pad), GST_OBJECT_GET_LOCK (pad)))
#define GST_PAD_BLOCK_SIGNAL(paernal links */
  GstPadIterIntLinkFunction      iterintlinkfunc;
  gpointer                       iterintlinkdata;
  GDestroyNotify                 iterintlinknotify;

  /* counts number of probes attached. */
  gint				 num_probes;
  gint				 num_blocked;

  GstPadPrivate                 *priv;

  union {
    gpointer _gst_reserved[GST_PADDING];
    struct {
      GstFlowReturn last_flowret;
      GstPadEventFullFunction eventfullfunc;
    } abi;
  } ABI;
};

struct _GstPadClass {
  GstObjectClass	parent_class;

  /* signal callbacks */
  void		(*linked)		(GstPad *pad, GstPad *peer);
  void		(*unlinked)		(GstPad *pad, GstPad *peer);

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};


/***** helper macros *****/
/* GstPad */

/**
 * GST_PAD_NAME:
 * @pad: a #GstPad
 *
 * Get name of the given pad.
 * No locking is performed in this function, use gst_pad_get_name() instead.
 */
#define GST_PAD_NAME(pad)		(GST_OBJECT_NAME(pad))
/**
 * GST_PAD_PARENT:
 * @pad: a #GstPad
 *
 * Get the @pad parent.
 * No locking is performed in this function, use gst_pad_get_parent() instead.
 */
#define GST_PAD_PARENT(pad)		(GST_ELEMENT_CAST(GST_OBJECT_PARENT(pad)))
/**
 * GST_PAD_ELEMENT_PRIVATE:
 * @pad: a #GstPad
 *
 * Get the private data of @pad, which is usually some pad- or stream-specific
 * structure created by the element and set on the pad when creating it.
 * No locking is performed in this function.
 */
#define GST_PAD_ELEMENT_PRIVATE(pad)    (GST_PAD_CAST(pad)->element_private)
/**
AG_FIXED_CAPS: the pad is using fixed caps. This means that
 *     once the caps are set on the pad, the default caps query function
 *     will only return those caps.
 * @GST_PAD_FLAG_PROXY_CAPS: the default event and query handler will forward
 *                      all events and queries to the internally linked pads
 *                      instead of discarding them.
 * @GST_PAD_FLAG_PROXY_ALLOCATION: the default query handler will forward
 *                      allocation queries to the internally linked pads
 *                      instead of discarding them.
 * @GST_PAD_FLAG_PROXY_SCHEDULING: the default query handler will forward
 *                      scheduling queries to the internally linked pads
 *                      instead of discarding them.
 * @GST_PAD_FLAG_ACCEPT_INTERSECT: the default accept-caps handler will check
 *                      it the caps intersect the query-caps result instead
 *                      of checking for a subset. This is interesting for
 *                      parsers that can accept incompletely specified caps.
 * @GST_PAD_FLAG_ACCEPT_TEMPLATE: the default accept-caps handler will use
 *                      the template pad caps instead of query caps to
 *                      compare with the accept caps. Use this in combination
 *                      with %GST_PAD_FLAG_ACCEPT_INTERSECT. (Since: 1.6)
 * @GST_PAD_FLAG_LAST: offset to define more flags
 *
 * Pad state flags
 */
typedef enum {
  GST_PAD_FLAG_BLOCKED          = (GST_OBJPad *pad, GstObject *parent);
/**
 * GstPadActivateModeFunction:
 * @pad: a #GstPad
 * @parent: the parent of @pad
 * @mode: the requested activation mode of @pad
 * @active: activate or deactivate the pad.
 *
 * The prototype of the push and pull activate functions.
 *
 * Returns: %TRUE if the pad could be activated or deactivated.
 */
typedef gboolean		(*GstPadActivateModeFunction)	(GstPad *pad, GstObject *parent,
                                                                 GstPadMode mode, gboolean active);


/* data passing */
/**
 * GstPadChainFunction:
 * @pad: the sink #GstPad that performed the chain.
 * @parent: (allow-none): the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT
 *          flag is set, @parent is guaranteed to be not-%NULL and remain valid
 *          during the execution of this function.
 * @buffer: (transfer full): the #GstBuffer that is chained, not %NULL.
 *
 * A function that will be called on sinkpads when chaining buffers.
 * The function typically processes the data contained in the buffer and
 * either consumes the data or passes it on to the internally linked pad(s).
 *
 * The implementer of this function receives a refcount to @buffer and should
 * gst_buffer_unref() when the buffer is no longer needed.
 *
 * When a chain function detects an error in the data stream, it must post an
 * error on the bus and return an appropriate #GstFlowReturn value.
 *
 * Returns: #GST_FLOW_OK for success
 */
typedef GstFlowReturn		(*GstPadChainFunction)		(GstPaION_UNSPECIFIED_SYSTEM_ID "unspecified-system-id"

typedef struct _GstProtectionMeta GstProtectionMeta;
/**
 * GstProtectionMeta:
 * @meta: the parent #GstMeta.
 * @info: the cryptographic information needed to decrypt the sample.
 *
 * Metadata type that holds information about a sample from a protection-protected
 * track, including the information needed to decrypt it (if it is encrypted).
 *
 * Since: 1.6
 */
struct _GstProtectionMeta
{
  GstMeta meta;

  GstStructure *info;
};

/**
 * gst_protection_meta_api_get_type: (attributes doc.skip=true)
 */
GST_API
GType gst_protection_meta_api_get_type (void);

#define GST_PROTECTION_META_API_TYPE (gst_protection_meta_api_get_type())

#define gst_buffer_get_protection_meta(b) \
    ((GstProtectionMeta*)gst_buffer_get_meta ((b), GST_PROTECTION_META_API_TYPE))

#define GST_PROTECTION_META_INFO (gst_protection_meta_get_info())

GST_API
const GstMetaInfo * gst_protection_meta_get_info (void);

GST_API
GstProtectionMeta * gst_buffer_add_protection_meta (GstBuffer * buffer,
                                                    GstStructure * info);
GST_API
const gchar * gst_protection_select_system (const gchar ** system_identifiers);

GST_API
gchar ** gst_protection_filter_systems_by_available_decryptors (
    const gchar ** system_identifiers);

G_END_DECLS
#endif /* __GST_PROTECTION_META_H__ */
/* GStreamer
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
 *                    2000 Wim Taymans <wim.taymans@chello.be>
 *
 * gstpad.ments to indicate that
 * they can be changed when the element is in the PLAYING or lower state.
 * This flag implies GST_PARAM_MUTABLE_PAUSED.
 */
#define GST_PARAM_MUTABLE_PLAYING  (1 << (G_PARAM_USER_SHIFT + 4))

/**
 * GST_PARAM_DOC_SHOW_DEFAULT: (value 8192)
 *
 * Use this flag on GObject properties of GstObject to indicate that
 * during `gst-inspect` and friends, the default value should be used
 * as default instead of the current value.
 *
 * Since: 1.18
 */
#define GST_PARAM_DOC_SHOW_DEFAULT  (1 << (G_PARAM_USER_SHIFT + 5))

/**
 * GST_PARAM_CONDITIONALLY_AVAILABLE: (value 16384)
 *
 * Use this flag on GObject properties of GstObject to indicate that
 * they might not be available depending on environment such as OS, device, etc,
 * so such properties will be installed conditionally only if the GstObject is
 * able to support it.
 *
 * Since: 1.18
 */
#define GST_PARAM_CONDITIONALLY_AVAILABLE  (1 << (G_PARAM_USER_SHIFT + 6))

/**
 * GST_PARAM_USER_SHIFT: (value 65536)
 *
 * Bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications.
 */
#define	GST_PARAM_USER_SHIFT	(1 << (G_PARAM_USER_SHIFT + 8))


/* --- type macros --- */

/**
 * GstParamFraction:
 *
 * A fundamental type that describes a #GParamSpec for fractional
 * properties
 */

#define GST_TYPE_PARAM_FRACTION           (gst_param_spec_fraction_get_type ())
#define GST_IS_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GST_TYPE_PARAM_FRACTION))
#define GST_PARAM_SPEC_FRACTION(pspec)    (G_API
GType           gst_event_get_type              (void);

/* custom event */

GST_API
GstEvent*       gst_event_new_custom            (GstEventType type, GstStructure *structure) G_GNUC_MALLOC;

GST_API
const GstStructure *
                gst_event_get_structure         (GstEvent *event);

GST_API
GstStructure *  gst_event_writable_structure    (GstEvent *event);

GST_API
gboolean        gst_event_has_name              (GstEvent *event, const gchar *name);

GST_DEPRECATED_FOR(gst_event_has_name)
gboolean        gst_event_has_name_id           (GstEvent *event, GQuark name);

/* identifiers for events and messages */

GST_API
guint32         gst_event_get_seqnum            (GstEvent *event);

GST_API
void            gst_event_set_seqnum            (GstEvent *event, guint32 seqnum);

/* accumulated pad offsets for the event */

GST_API
gint64          gst_event_get_running_time_offset (GstEvent *event);

GST_API
void            gst_event_set_running_time_offset (GstEvent *event, gint64 offset);

/* Stream start event */

GST_API
GstEvent *      gst_event_new_stream_start      (const gchar *stream_id) G_GNUC_MALLOC;

GST_API
void            gst_event_parse_stream_start    (GstEvent *event, const gchar **stream_id);

GST_API
void            gst_event_set_stream		(GstEvent *event, GstStream *stream);

GST_API
void            gst_event_parse_stream		(GstEvent *event, GstStream **stream);

GST_API
void            gst_event_set_stream_flags      (GstEvent *event, GstStreamFlags flags);

GS, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED) | _FLAG(STICKY) | _FLAG(STICKY_MULTI)),
  GST_EVENT_CUSTOM_BOTH              = GST_EVENT_MAKE_TYPE (310, _FLAG(BOTH) | _FLAG(SERIALIZED)),
  GST_EVENT_CUSTOM_BOTH_OOB          = GST_EVENT_MAKE_TYPE (320, _FLAG(BOTH))
} GstEventType;
#undef _FLAG

/**
 * GstStreamFlags:
 * @GST_STREAM_FLAG_NONE: This stream has no special attributes
 * @GST_STREAM_FLAG_SPARSE: This stream is a sparse stream (e.g. a subtitle
 *    stream), data may flow only in irregular intervals with large gaps in
 *    between.
 * @GST_STREAM_FLAG_SELECT: This stream should be selected by default. This
 *    flag may be used by demuxers to signal that a stream should be selected
 *    by default in a playback scenario.
 * @GST_STREAM_FLAG_UNSELECT: This stream should not be selected by default.
 *    This flag may be used by demuxers to signal that a stream should not
 *    be selected by default in a playback scenario, but only if explicitly
 *    selected by the user (e.g. an audio track for the hard of hearing or
 *    a director's commentary track).
 *
 * Since: 1.2
 */
typedef enum {
  GST_STREAM_FLAG_NONE,
  GST_STREAM_FLAG_SPARSE       = (1 << 0),
  GST_STREAM_FLAG_SELECT       = (1 << 1),
  GST_STREAM_FLAG_UNSELECT     = (1 << 2)
} GstStreamFlags;

#include <gst/gstminiobject.h>
#include <gst/gstformat.h>
#include <gst/gstobject.h>
#include <gst/gstclock.h>
#include <gst/gststructure.h>
#include <gst/gsttaglist.h>
#include <gst/gstsegment.h>
#include <gst/gstmessage.h>
#it can travel downstream.
 * @GST_EVENT_TYPE_SERIALIZED:   Set if the event should be serialized with data
 *                               flow.
 * @GST_EVENT_TYPE_STICKY:       Set if the event is sticky on the pads.
 * @GST_EVENT_TYPE_STICKY_MULTI: Multiple sticky events can be on a pad, each
 *                               identified by the event name.
 *
 * #GstEventTypeFlags indicate the aspects of the different #GstEventType
 * values. You can get the type flags of a #GstEventType with the
 * gst_event_type_get_flags() function.
 */
typedef enum {
  GST_EVENT_TYPE_UPSTREAM       = 1 << 0,
  GST_EVENT_TYPE_DOWNSTREAM     = 1 << 1,
  GST_EVENT_TYPE_SERIALIZED     = 1 << 2,
  GST_EVENT_TYPE_STICKY         = 1 << 3,
  GST_EVENT_TYPE_STICKY_MULTI   = 1 << 4
} GstEventTypeFlags;

/**
 * GST_EVENT_TYPE_BOTH: (value 3) (type GstEventTypeFlags)
 *
 * The same thing as #GST_EVENT_TYPE_UPSTREAM | #GST_EVENT_TYPE_DOWNSTREAM.
 */
#define GST_EVENT_TYPE_BOTH \
    ((GstEventTypeFlags)(GST_EVENT_TYPE_UPSTREAM | GST_EVENT_TYPE_DOWNSTREAM))

#define GST_EVENT_NUM_SHIFT     (8)

/**
 * GST_EVENT_MAKE_TYPE:
 * @num: the event number to create
 * @flags: the event flags
 *
 * when making custom event types, use this macro with the num and
 * the given flags
 */
#define GST_EVENT_MAKE_TYPE(num,flags) \
    (((num) << GST_EVENT_NUM_SHIFT) | (flags))

#define _FLAG(name) GST_EVENT_TYPE_##name

/**
 * GstEventType:
 * @GST_EVENT_UNKNOWN: unknown event.
 * @GST_EVENT_FLUSH_START: Start a flush operation.K_FLAG_EXCLUSIVE = (1 << 2),

  GST_LOCK_FLAG_LAST      = (1 << 8)
} GstLockFlags;

/**
 * GST_LOCK_FLAG_READWRITE: (value 3) (type GstLockFlags)
 *
 * GstLockFlags value alias for GST_LOCK_FLAG_READ | GST_LOCK_FLAG_WRITE
 */
#define GST_LOCK_FLAG_READWRITE  ((GstLockFlags) (GST_LOCK_FLAG_READ | GST_LOCK_FLAG_WRITE))

/**
 * GST_MINI_OBJECT_REFCOUNT:
 * @obj: a #GstMiniObject
 *
 * Get access to the reference count field of the mini-object.
 */
#define GST_MINI_OBJECT_REFCOUNT(obj)           ((GST_MINI_OBJECT_CAST(obj))->refcount)
/**
 * GST_MINI_OBJECT_REFCOUNT_VALUE:
 * @obj: a #GstMiniObject
 *
 * Get the reference count value of the mini-object.
 */
#define GST_MINI_OBJECT_REFCOUNT_VALUE(obj)     (g_atomic_int_get (&(GST_MINI_OBJECT_CAST(obj))->refcount))

/**
 * GstMiniObject: (ref-func gst_mini_object_ref) (unref-func gst_mini_object_unref) (set-value-func g_value_set_boxed) (get-value-func g_value_get_boxed)
 * @type: the GType of the object
 * @refcount: atomic refcount
 * @lockstate: atomic state of the locks
 * @flags: extra flags.
 * @copy: a copy function
 * @dispose: a dispose function
 * @free: the free function
 *
 * Base class for refcounted lightweight objects.
 */
struct _GstMiniObject {
  GType   type;

  /*< public >*/ /* with COW */
  gint    refcount;
  gint    lockstate;
  guint   flags;

  GstMiniObjectCopyFunction copy;
  GstMiniObjectDisposeFunction dispose;
  GstMiniObjectFreeFunction free;

  /* < private > */
  /* Used to keep track of parents, weak ref notiNGE_TYPE (gst_structure_change_type_get_type())

GST_API
GType gst_stream_status_type_get_type (void);
#define GST_TYPE_STREAM_STATUS_TYPE (gst_stream_status_type_get_type())

GST_API
GType gst_progress_type_get_type (void);
#define GST_TYPE_PROGRESS_TYPE (gst_progress_type_get_type())

/* enumerations from "gstmeta.h" */

GST_API
GType gst_meta_flags_get_type (void);
#define GST_TYPE_META_FLAGS (gst_meta_flags_get_type())

/* enumerations from "gstminiobject.h" */

GST_API
GType gst_mini_object_flags_get_type (void);
#define GST_TYPE_MINI_OBJECT_FLAGS (gst_mini_object_flags_get_type())

GST_API
GType gst_lock_flags_get_type (void);
#define GST_TYPE_LOCK_FLAGS (gst_lock_flags_get_type())

/* enumerations from "gstobject.h" */

GST_API
GType gst_object_flags_get_type (void);
#define GST_TYPE_OBJECT_FLAGS (gst_object_flags_get_type())

/* enumerations from "gstpad.h" */

GST_API
GType gst_pad_direction_get_type (void);
#define GST_TYPE_PAD_DIRECTION (gst_pad_direction_get_type())

GST_API
GType gst_pad_mode_get_type (void);
#define GST_TYPE_PAD_MODE (gst_pad_mode_get_type())

GST_API
GType gst_pad_link_return_get_type (void);
#define GST_TYPE_PAD_LINK_RETURN (gst_pad_link_return_get_type())

GST_API
GType gst_flow_return_get_type (void);
#define GST_TYPE_FLOW_RETURN (gst_flow_return_get_type())

GST_API
GType gst_pad_link_check_get_type (void);
#define GST_TYPE_PAD_LINK_CHECK (gst_pad_link_check_get_type())

GST_API
GType gst_pad_probe_type_get_type (void);
#define GST_TYPE_PAD_PROBE_TYPE__GST_CONTEXT_H__

#include <glib.h>

G_BEGIN_DECLS

typedef struct _GstContext GstContext;

#include <gst/gstminiobject.h>
#include <gst/gststructure.h>

GST_API GType _gst_context_type;

#define GST_TYPE_CONTEXT                         (_gst_context_type)
#define GST_IS_CONTEXT(obj)                      (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_CONTEXT))
#define GST_CONTEXT_CAST(obj)                    ((GstContext*)(obj))
#define GST_CONTEXT(obj)                         (GST_CONTEXT_CAST(obj))



GST_API
GType           gst_context_get_type            (void);

#ifndef GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS
/* refcounting */
static inline GstContext *
gst_context_ref (GstContext * context)
{
  return (GstContext *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (context));
}

static inline void
gst_context_unref (GstContext * context)
{
  gst_mini_object_unref (GST_MINI_OBJECT_CAST (context));
}

static inline void
gst_clear_context (GstContext ** context_ptr)
{
  gst_clear_mini_object ((GstMiniObject **) context_ptr);
}

/* copy context */
static inline GstContext *
gst_context_copy (const GstContext * context)
{
  return GST_CONTEXT_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (context)));
}
#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
GST_API
GstContext * gst_context_ref    (GstContext * context);

GST_API
void         gst_context_unref  (GstContext * context);

GST_API
void         gst_clear_context  (GstContext ** context_ptr);

GST_API
GstContext * gst_context_copy   
gst_clear_caps (GstCaps ** caps_ptr)
{
  gst_clear_mini_object ((GstMiniObject **) caps_ptr);
}
#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
GST_API
GstCaps * gst_caps_ref   (GstCaps * caps);

GST_API
void      gst_caps_unref (GstCaps * caps);

GST_API
void      gst_clear_caps (GstCaps ** caps_ptr);
#endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */

/* copy caps */
GST_API
GstCaps * gst_caps_copy (const GstCaps * caps);

#define gst_caps_copy(caps) GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)))

/**
 * gst_caps_is_writable:
 * @caps: a #GstCaps
 *
 * Tests if you can safely modify @caps. It is only safe to modify caps when
 * there is only one owner of the caps - ie, the object is writable.
 */
#define         gst_caps_is_writable(caps)     gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (caps))

/**
 * gst_caps_make_writable:
 * @caps: (transfer full): a #GstCaps
 *
 * Returns a writable copy of @caps.
 *
 * If there is only one reference count on @caps, the caller must be the owner,
 * and so this function will return the caps object unchanged. If on the other
 * hand there is more than one reference on the object, a new caps object will
 * be returned. The caller's reference on @caps will be removed, and instead the
 * caller will own a reference to the returned object.
 *
 * In short, this function unrefs the caps in the argument and refs the caps
 * that it returns. Don't access the argument after calling this function. See
 * also: gst_caps_ref().
 *
 ** Check if the bufferpool is flushing. Subclasses might want to check the
 * state of the pool in the acquire function.
 */
#define GST_BUFFER_POOL_IS_FLUSHING(pool)  (g_atomic_int_get (&pool->flushing))

/**
 * GstBufferPool:
 * @object: the parent structure
 * @flushing: whether the pool is currently gathering back outstanding buffers
 *
 * The structure of a #GstBufferPool. Use the associated macros to access the public
 * variables.
 */
struct _GstBufferPool {
  GstObject            object;

  /*< protected >*/
  gint                 flushing;

  /*< private >*/
  GstBufferPoolPrivate *priv;

  gpointer _gst_reserved[GST_PADDING];
};

/**
 * GstBufferPoolClass:
 * @object_class:  Object parent class
 *
 * The #GstBufferPool class.
 */
struct _GstBufferPoolClass {
  GstObjectClass    object_class;

  /*< public >*/

  /**
   * GstBufferPoolClass::get_options:
   * @pool: the #GstBufferPool
   *
   * Get a list of options supported by this pool
   *
   * Returns: (array zero-terminated=1) (transfer none): a %NULL terminated array
   *          of strings.
   */
  const gchar ** (*get_options)    (GstBufferPool *pool);

  /**
   * GstBufferPoolClass::set_config:
   * @pool: the #GstBufferPool
   * @config: the required configuration
   *
   * Apply the bufferpool configuration. The default configuration will parse
   * the default config parameters.
   *
   * Returns: whether the configuration could be set.
   */
  gboolean       (*set_config)     (GstBufferPool *pool, GstStructure *coOUND_DOWN_N:
 * @num: integrer value to round down
 * @align: a power of two to round down to
 *
 * Rounds an integer value down to the next multiple of @align. @align MUST be a
 * power of two.
 */
#define GST_ROUND_DOWN_N(num,align) (((num) & ~((align) - 1)))


GST_API
void                    gst_object_default_error        (GstObject    * source,
                                                         const GError * error,
                                                         const gchar  * debug);

/* element functions */

GST_API
void                    gst_element_create_all_pads     (GstElement *element);

GST_API
GstPad*                 gst_element_get_compatible_pad  (GstElement *element, GstPad *pad,
                                                         GstCaps *caps);
GST_API
GstPadTemplate*         gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);

GST_API
const gchar*            gst_element_state_get_name      (GstState state);

GST_API
const gchar *           gst_element_state_change_return_get_name (GstStateChangeReturn state_ret);

GST_API
const gchar *           gst_state_change_get_name       (GstStateChange transition);

GST_API
gboolean                gst_element_link                (GstElement *src, GstElement *dest);

GST_API
gboolean                gst_element_link_many           (GstElement *element_1,
                                                         GstElement *element_2, ...) G_GNUC_NULL_TERMINATED;
GST_Aint8 * data) {
  return _GST_READ_UINT16_BE (data);
}
#define GST_READ_UINT16_LE(data) __gst_slow_read16_le((const guint8 *)(data))
static inline guint16 __gst_slow_read16_le (const guint8 * data) {
  return _GST_READ_UINT16_LE (data);
}
#endif

/**
 * GST_READ_UINT8:
 * @data: memory location
 *
 * Read an 8 bit unsigned integer value from the memory buffer.
 */
#define GST_READ_UINT8(data)            (_GST_GET (data, 0,  8,  0))

/**
 * GST_WRITE_UINT64_BE:
 * @data: memory location
 * @val: value to store
 *
 * Store a 64 bit unsigned integer value in big endian format into the memory buffer.
 */
/**
 * GST_WRITE_UINT64_LE:
 * @data: memory location
 * @val: value to store
 *
 * Store a 64 bit unsigned integer value in little endian format into the memory buffer.
 */
#if GST_HAVE_UNALIGNED_ACCESS
# if (G_BYTE_ORDER == G_BIG_ENDIAN)
#  define GST_WRITE_UINT64_BE(data,val) _GST_FAST_WRITE(64,data,val)
#  define GST_WRITE_UINT64_LE(data,val) _GST_FAST_WRITE_SWAP(64,data,val)
# else
#  define GST_WRITE_UINT64_BE(data,val) _GST_FAST_WRITE_SWAP(64,data,val)
#  define GST_WRITE_UINT64_LE(data,val) _GST_FAST_WRITE(64,data,val)
# endif
#else
#define GST_WRITE_UINT64_BE(data,val)   do { \
                                          gpointer __put_data = data; \
                                          guint64 __put_val = val; \
                                          _GST_PUT (__put_data, 0, 64, 56, __put_val); \
                                          _GST_PUT (__put_data, 1, 64, 48, __putler.  This assumes that there is a variable
 * named parent_class that points to the (duh!) parent class.  Note that
 * this macro is not to be used with things that return something, use
 * the _WITH_DEFAULT version for that
 */
#define GST_CALL_PARENT(parent_class_cast, name, args)                  \
        ((parent_class_cast(parent_class)->name != NULL) ?              \
         parent_class_cast(parent_class)->name args : (void) 0)

/**
 * GST_CALL_PARENT_WITH_DEFAULT:
 * @parent_class_cast: the name of the class cast macro for the parent type
 * @name: name of the function to call
 * @args: arguments enclosed in '( )'
 * @def_return: default result
 *
 * Same as GST_CALL_PARENT(), but in case there is no implementation, it
 * evaluates to @def_return.
 */
#define GST_CALL_PARENT_WITH_DEFAULT(parent_class_cast, name, args, def_return)\
        ((parent_class_cast(parent_class)->name != NULL) ?              \
         parent_class_cast(parent_class)->name args : def_return)

/* Define PUT and GET functions for unaligned memory */
#define _GST_GET(__data, __idx, __size, __shift) \
    (((guint##__size) (((const guint8 *) (__data))[__idx])) << (__shift))

#define _GST_PUT(__data, __idx, __size, __shift, __num) \
    (((guint8 *) (__data))[__idx] = (((guint##__size) (__num)) >> (__shift)) & 0xff)

#ifndef __GTK_DOC_IGNORE__
#if GST_HAVE_UNALIGNED_ACCESS
static inline guint16 __gst_fast_read16(const guint8 *v) {
  return *(const guint16*)(const void*)(v);
}
static inline guint32 __gst_      (GstMessage *message, gint *percent);

GST_API
void            gst_message_set_buffering_stats   (GstMessage *message, GstBufferingMode mode,
                                                   gint avg_in, gint avg_out,
                                                   gint64 buffering_left);
GST_API
void            gst_message_parse_buffering_stats (GstMessage *message, GstBufferingMode *mode,
                                                   gint *avg_in, gint *avg_out,
                                                   gint64 *buffering_left);

/* STATE_CHANGED */

GST_API
GstMessage *    gst_message_new_state_changed   (GstObject * src, GstState oldstate,
                                                 GstState newstate, GstState pending) G_GNUC_MALLOC;
GST_API
void            gst_message_parse_state_changed (GstMessage *message, GstState *oldstate,
                                                 GstState *newstate, GstState *pending);

/* STATE_DIRTY */

GST_API
GstMessage *    gst_message_new_state_dirty     (GstObject * src) G_GNUC_MALLOC;

/* STEP_DONE */

GST_API
GstMessage *    gst_message_new_step_done       (GstObject * src, GstFormat format, guint64 amount,
                                                 gdouble rate, gboolean flush, gboolean intermediate,
                                                 guint64 duration, gboolean eos) G_GNUC_MALLOC;
GST_API
void            gst_message_parse_step_done     (GstMessage * message, GstFormat *format, guint64 *amount,g a #GObject property has
 *     changed (Since: 1.10)
 * @GST_MESSAGE_STREAM_COLLECTION: Message indicating a new #GstStreamCollection
 *     is available (Since: 1.10)
 * @GST_MESSAGE_STREAMS_SELECTED: Message indicating the active selection of
 *     #GstStreams has changed (Since: 1.10)
 * @GST_MESSAGE_REDIRECT: Message indicating to request the application to
 *     try to play the given URL(s). Useful if for example a HTTP 302/303
 *     response is received with a non-HTTP URL inside. (Since: 1.10)
 * @GST_MESSAGE_DEVICE_CHANGED: Message indicating a #GstDevice was changed
 *     a #GstDeviceProvider (Since: 1.16)
 * @GST_MESSAGE_INSTANT_RATE_REQUEST: Message sent by elements to request the
 *     running time from the pipeline when an instant rate change should
 *     be applied (which may be in the past when the answer arrives). (Since: 1.18)
 * @GST_MESSAGE_ANY: mask for all of the above messages.
 *
 * The different message types that are available.
 */
/* NOTE: keep in sync with quark registration in gstmessage.c
 * NOTE: keep GST_MESSAGE_ANY a valid gint to avoid compiler warnings.
 */
/* FIXME: 2.0: Make it NOT flags, just a regular 1,2,3,4.. enumeration */
/* FIXME: For GST_MESSAGE_ANY ~0 -> 0xffffffff see
 *        https://bugzilla.gnome.org/show_bug.cgi?id=732633
 */
typedef enum
{
  GST_MESSAGE_UNKNOWN           = 0,
  GST_MESSAGE_EOS               = (1 << 0),
  GST_MESSAGE_ERROR             = (1 << 1),
  GST_MESSAGE_WARNING           = (1 << 2),
  GST_MESSAGE_INFO                        const GValue * value,
                                                           gulong         sleep);

#define gst_harness_stress_requestpad_start(h, t, n, c, r)                     \
  gst_harness_stress_requestpad_start_full (h, t, n, c, r, G_USEC_PER_SEC / 100)

GST_CHECK_API
GstHarnessThread * gst_harness_stress_requestpad_start_full (GstHarness     * h,
                                                             GstPadTemplate * templ,
                                                             const gchar    * name,
                                                             GstCaps        * caps,
                                                             gboolean         release,
                                                             gulong           sleep);

G_END_DECLS

#endif /* __GST_HARNESS_H__ */

/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */

#pragma once

#include <glib-object.h>
#include <gst/controller/controller-prelude.h>

G_BEGIN_DECLS

/* enumerations from "gstinterpolationcontrolsource.h" */

GST_CONTROLLER_API
GType gst_interpolation_mode_get_type (void);
#define GST_TYPE_INTERPOLATION_MODE (gst_interpolation_mode_get_type())

/* enumerations from "gstlfocontrolsource.h" */

GST_CONTROLLER_API
GType gst_lfo_waveform_get_type (void);
#define GST_TYPE_LFO_WAVEFORM (gst_lfo with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __GST_HARNESS_H__
#define __GST_HARNESS_H__

#include <gst/gst.h>
#include <gst/check/gsttestclock.h>
#include <gst/check/check-prelude.h>

G_BEGIN_DECLS

/**
 * GstHarnessThread:
 *
 * Opaque handle representing a GstHarness stress testing thread.
 *
 * Since: 1.6
 */
typedef struct _GstHarnessThread GstHarnessThread;

typedef struct _GstHarness GstHarness;
typedef struct _GstHarnessPrivate GstHarnessPrivate;

/**
 * GstHarness:
 * @element: the element inside the harness
 * @srcpad: the internal harness source pad
 * @sinkpad: the internal harness sink pad
 * @src_harness: the source (input) harness (if any)
 * @sink_harness: the sink (output) harness (if any)
 *
 * Since: 1.6
 */
struct _GstHarness {
  GstElement * element;

  GstPad * srcpad;
  GstPad * sinkpad;

  GstHarness * src_harness;
  GstHarness * sink_harness;

  /*< private >*/
  GstHarnessPrivate * priv;
};

/* Harness creation */

GST_CHECK_API
GstHarness * gst_harness_new_empty (void);

GST_CHECK_API
void         gst_harness_add_element_full (GstHarness           * h,
                                           GstElement           * element,
                                           GstStaticPadTemplate * hsrc,
                                           const gchar          * element_sinkpad_name,
                                           GstStaticPadTemplate * hsink,
   lushing. (Since: 1.18)
 * @GST_SEEK_FLAG_SKIP: Deprecated backward compatibility flag, replaced
 *                     by %GST_SEEK_FLAG_TRICKMODE
 *
 * Flags to be used with gst_element_seek() or gst_event_new_seek(). All flags
 * can be used together.
 *
 * A non flushing seek might take some time to perform as the currently
 * playing data in the pipeline will not be cleared.
 *
 * An accurate seek might be slower for formats that don't have any indexes
 * or timestamp markers in the stream. Specifying this flag might require a
 * complete scan of the file in those cases.
 *
 * When performing a segment seek: after the playback of the segment completes,
 * no EOS will be emitted by the element that performed the seek, but a
 * %GST_MESSAGE_SEGMENT_DONE message will be posted on the bus by the element.
 * When this message is posted, it is possible to send a new seek event to
 * continue playback. With this seek method it is possible to perform seamless
 * looping or simple linear editing.
 *
 * When only changing the playback rate and not the direction, the
 * %GST_SEEK_FLAG_INSTANT_RATE_CHANGE flag can be used for a non-flushing seek
 * to signal that the rate change should be applied immediately. This requires
 * special support in the seek handlers (e.g. demuxers) and any elements
 * synchronizing to the clock, and in general can't work in all cases (for example
 * UDP streaming where the delivery rate is controlled by a remote server). The
 * instant-rate-change mode supports chastream elements.
 *                      This function must be implemented if the element reads or
 *                      writes the buffer content. The query that was passed to
 *                      the decide_allocation is passed in this method (or %NULL
 *                      when the element is in passthrough mode). The default
 *                      implementation will pass the query downstream when in
 *                      passthrough mode and will copy all the filtered metadata
 *                      API in non-passthrough mode.
 * @transform_size: Optional. Given the size of a buffer in the given direction
 *                  with the given caps, calculate the size in bytes of a buffer
 *                  on the other pad with the given other caps.
 *                  The default implementation uses get_unit_size and keeps
 *                  the number of units the same.
 * @get_unit_size:  Required if the transform is not in-place.
 *                  Get the size in bytes of one unit for the given caps.
 * @start:          Optional.
 *                  Called when the element starts processing.
 *                  Allows opening external resources.
 * @stop:           Optional.
 *                  Called when the element stops processing.
 *                  Allows closing external resources.
 * @sink_event:     Optional.
 *                  Event handler on the sink pad. The default implementation
 *                  handles the event and forwards it downstream.
 * @ Muxer elements
 * @GST_ELEMENT_FACTORY_TYPE_DEMUXER: Demuxer elements
 * @GST_ELEMENT_FACTORY_TYPE_PARSER: Parser elements
 * @GST_ELEMENT_FACTORY_TYPE_PAYLOADER: Payloader elements
 * @GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER: Depayloader elements
 * @GST_ELEMENT_FACTORY_TYPE_DECRYPTOR: Elements handling decryption (Since: 1.6)
 * @GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR: Elements handling encryption (Since: 1.6)
 * @GST_ELEMENT_FACTORY_TYPE_HARDWARE: Hardware based elements (Since: 1.18)
 * @GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS: Private, do not use
 * @GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO: Elements handling video media types
 * @GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO: Elements handling audio media types
 * @GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE: Elements handling image media types
 * @GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE: Elements handling subtitle media types
 * @GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA: Elements handling metadata media types
 *
 * The type of #GstElementFactory to filter.
 *
 * All @GstFactoryListType up to @GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS are exclusive.
 *
 * If one or more of the MEDIA types are specified, then only elements
 * matching the specified media types will be selected.
 */

/**
 * GstElementFactoryListType:
 *
 * A type defining the type of an element factory.
 */
typedef guint64 GstElementFactoryListType;

#define  GST_ELEMENT_FACTORY_TYPE_DECODER        ((GstElementFactoryListType)(G_GUINT64_CONSTANT (1) << 0))
#define  GST_ELEMENT_FACTORY_TYPE_ENCODER ACTORY_H__

/**
 * GstElementFactory:
 *
 * The opaque #GstElementFactory data structure.
 */
typedef struct _GstElementFactory GstElementFactory;
typedef struct _GstElementFactoryClass GstElementFactoryClass;

#include <gst/gstconfig.h>
#include <gst/gstelement.h>
#include <gst/gstpad.h>
#include <gst/gstplugin.h>
#include <gst/gstpluginfeature.h>
#include <gst/gsturi.h>

G_BEGIN_DECLS

#define GST_TYPE_ELEMENT_FACTORY                (gst_element_factory_get_type())
#define GST_ELEMENT_FACTORY(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
                                                 GstElementFactory))
#define GST_ELEMENT_FACTORY_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT_FACTORY,\
                                                 GstElementFactoryClass))
#define GST_IS_ELEMENT_FACTORY(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
#define GST_IS_ELEMENT_FACTORY_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
#define GST_ELEMENT_FACTORY_CAST(obj)           ((GstElementFactory *)(obj))

GST_API
GType                   gst_element_factory_get_type            (void);

GST_API
GstElementFactory *     gst_element_factory_find                (const gchar *name);

GST_API
GType                   gst_element_factory_get_element_type    (GstElementFactory *factory);

GST_API
const gchar *           gst_element_factory_get_metadata        (GstElementFactory *factory, const) (c)) << 16 | ((guint32) (d)) << 24 )

/**
 * GST_STR_FOURCC:
 * @f: a string with at least four characters
 *
 * Transform an input string into a #guint32 fourcc value with host
 * endianness.
 * Caller is responsible for ensuring the input string consists of at least
 * four characters.
 *
 * |[
 * guint32 fourcc = GST_STR_FOURCC ("MJPG");
 * ]|
 *
 */
#define GST_STR_FOURCC(f)               ((guint32)(((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24)))

/**
 * GST_FOURCC_FORMAT: (skip):
 *
 * Can be used together with #GST_FOURCC_ARGS to properly output a
 * #guint32 fourcc value in a printf\()-style text message.
 *
 * |[
 * printf ("fourcc: %" GST_FOURCC_FORMAT "\n", GST_FOURCC_ARGS (fcc));
 * ]|
 *
 */
#define GST_FOURCC_FORMAT "c%c%c%c"

/**
 * GST_FOURCC_ARGS: (skip):
 * @fourcc: a #guint32 fourcc value to output
 *
 * Can be used together with #GST_FOURCC_FORMAT to properly output a
 * #guint32 fourcc value in a printf\()-style text message.
 */

#define __GST_PRINT_CHAR(c) \
  g_ascii_isprint(c) ? (c) : '.'
#define GST_FOURCC_ARGS(fourcc)               \
  __GST_PRINT_CHAR((fourcc) & 0xff),          \
  __GST_PRINT_CHAR(((fourcc) >> 8) & 0xff),   \
  __GST_PRINT_CHAR(((fourcc) >> 16) & 0xff),  \
  __GST_PRINT_CHAR(((fourcc) >> 24) & 0xff)
/**
 * GST_VALUE_HOLDS_INT_RANGE:
 * @x: the #GValue to check
 *
 * Checks if the given #GValue contains a #GstIntRange value.
 */
#define GST_VALUE_HOLDS_INT_RANGE(x)      ((gpointer)(x) != NULL && G_VALUE_TYPE(x) == _gst_int_range_type)

/**
   const gchar            *extension,
                                                          GstTypeFindProbability *prob);

GST_BASE_API
GstCaps * gst_type_find_helper_for_buffer_with_caps (GstObject              *obj,
                                                     GstBuffer              *buf,
                                                     GstCaps                *caps,
                                                     GstTypeFindProbability *prob);

GST_BASE_API
GstCaps * gst_type_find_helper_for_extension (GstObject * obj,
                                              const gchar * extension);

GST_BASE_API
GList * gst_type_find_list_factories_for_caps (GstObject * obj,
                                               GstCaps * caps);

/**
 * GstTypeFindHelperGetRangeFunction:
 * @obj: a #GstObject that will handle the getrange request
 * @parent: (allow-none): the parent of @obj or %NULL
 * @offset: the offset of the range
 * @length: the length of the range
 * @buffer: (out): a memory location to hold the result buffer
 *
 * This function will be called by gst_type_find_helper_get_range() when
 * typefinding functions request to peek at the data of a stream at certain
 * offsets. If this function returns GST_FLOW_OK, the result buffer will be
 * stored in @buffer. The  contents of @buffer is invalid for any other
 * return value.
 *
 * This function is supposed to behave exactly like a #GstPadGetRangeFunction.
 *
 * Returns: GST_FLOW_OK for success
 */
typedef GstFlochar *key);

GST_API
gchar **                gst_device_provider_factory_get_metadata_keys  (GstDeviceProviderFactory *factory);

GST_API
GstDeviceProvider*       gst_device_provider_factory_get                (GstDeviceProviderFactory *factory) G_GNUC_MALLOC;

GST_API
GstDeviceProvider*       gst_device_provider_factory_get_by_name        (const gchar *factoryname) G_GNUC_MALLOC;

GST_API
gboolean                gst_device_provider_register                   (GstPlugin *plugin, const gchar *name,
                                                                       guint rank,
                                                                       GType type);
GST_API
gboolean      gst_device_provider_factory_has_classesv (GstDeviceProviderFactory * factory,
                                                       gchar ** classes);
GST_API
gboolean      gst_device_provider_factory_has_classes (GstDeviceProviderFactory *factory,
                                                       const gchar * classes);
GST_API
GList *       gst_device_provider_factory_list_get_device_providers (
                                                       GstRank minrank) G_GNUC_MALLOC;

G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDeviceProviderFactory, gst_object_unref)

G_END_DECLS

#endif /* __GST_DEVICE_PROVIDER_FACTORY_H__ */
/* GStreamer
 * Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
 * Copyright (C) 2011 Sebastian DrÃ¶ge <sebastian.droege@collabora.co.uk>
 *
 * gstiterator.h: Header for GstIterator
 *
 * de negotiation */
  GstCaps *     (*fixate)       (GstBaseSink *sink, GstCaps *caps);
  /* start or stop a pulling thread */
  gboolean      (*activate_pull)(GstBaseSink *sink, gboolean active);

  /**
   * GstBaseSinkClass::get_times:
   * @start: (out): the start #GstClockTime
   * @end: (out): the end #GstClockTime
   *
   * Get the start and end times for syncing on this buffer.
   */
  void          (*get_times)    (GstBaseSink *sink, GstBuffer *buffer,
                                 GstClockTime *start, GstClockTime *end);

  /* propose allocation parameters for upstream */
  gboolean      (*propose_allocation)   (GstBaseSink *sink, GstQuery *query);

  /* start and stop processing, ideal for opening/closing the resource */
  gboolean      (*start)        (GstBaseSink *sink);
  gboolean      (*stop)         (GstBaseSink *sink);

  /* unlock any pending access to the resource. subclasses should unlock
   * any function ASAP. */
  gboolean      (*unlock)       (GstBaseSink *sink);
  /* Clear a previously indicated unlock request not that unlocking is
   * complete. Sub-classes should clear any command queue or indicator they
   * set during unlock */
  gboolean      (*unlock_stop)  (GstBaseSink *sink);

  /* notify subclass of query */
  gboolean      (*query)        (GstBaseSink *sink, GstQuery *query);

  /* notify subclass of event */
  gboolean      (*event)        (GstBaseSink *sink, GstEvent *event);
  /* wait for eos or gap, subclasses should chain up to parent first */
  G return TRUE; \
} \
\
static inline gboolean \
_gst_bit_reader_peek_bits_uint##bits##_inline (const GstBitReader *reader, guint##bits *val, guint nbits) \
{ \
  g_return_val_if_fail (reader != NULL, FALSE); \
  g_return_val_if_fail (val != NULL, FALSE); \
  g_return_val_if_fail (nbits <= bits, FALSE); \
  \
  if (_gst_bit_reader_get_remaining_unchecked (reader) < nbits) \
    return FALSE; \
\
  *val = gst_bit_reader_peek_bits_uint##bits##_unchecked (reader, nbits); \
  return TRUE; \
}

__GST_BIT_READER_READ_BITS_INLINE (8)
__GST_BIT_READER_READ_BITS_INLINE (16)
__GST_BIT_READER_READ_BITS_INLINE (32)
__GST_BIT_READER_READ_BITS_INLINE (64)

#undef __GST_BIT_READER_READ_BITS_INLINE

#ifndef GST_BIT_READER_DISABLE_INLINES

#define gst_bit_reader_get_size(reader) \
    _gst_bit_reader_get_size_inline (reader)
#define gst_bit_reader_get_pos(reader) \
    _gst_bit_reader_get_pos_inline (reader)
#define gst_bit_reader_get_remaining(reader) \
    _gst_bit_reader_get_remaining_inline (reader)

/* we use defines here so we can add the G_LIKELY() */

#define gst_bit_reader_skip(reader, nbits)\
    G_LIKELY (_gst_bit_reader_skip_inline(reader, nbits))
#define gst_bit_reader_skip_to_byte(reader)\
    G_LIKELY (_gst_bit_reader_skip_to_byte_inline(reader))

#define gst_bit_reader_get_bits_uint8(reader, val, nbits) \
    G_LIKELY (_gst_bit_reader_get_bits_uint8_inline (reader, val, nbits))
#define gst_bit_reader_get_bits_uint16(reader, val, nbits) \
    G_LIKELY (_gst_bit_reader_get_bits_uint16_inline                 guint size,
                                                         guint32 * value);

/**
 * GST_BYTE_READER_INIT:
 * @data: Data from which the #GstByteReader should read
 * @size: Size of @data in bytes
 *
 * A #GstByteReader must be initialized with this macro, before it can be
 * used. This macro can used be to initialize a variable, but it cannot
 * be assigned to a variable. In that case you have to use
 * gst_byte_reader_init().
 */
#define GST_BYTE_READER_INIT(data, size) {data, size, 0}

/* unchecked variants */
static inline void
gst_byte_reader_skip_unchecked (GstByteReader * reader, guint nbytes)
{
  reader->byte += nbytes;
}

#define __GST_BYTE_READER_GET_PEEK_BITS_UNCHECKED(bits,type,lower,upper,adj) \
\
static inline type \
gst_byte_reader_peek_##lower##_unchecked (const GstByteReader * reader) \
{ \
  type val = (type) GST_READ_##upper (reader->data + reader->byte); \
  adj \
  return val; \
} \
\
static inline type \
gst_byte_reader_get_##lower##_unchecked (GstByteReader * reader) \
{ \
  type val = gst_byte_reader_peek_##lower##_unchecked (reader); \
  reader->byte += bits / 8; \
  return val; \
}

__GST_BYTE_READER_GET_PEEK_BITS_UNCHECKED(8,guint8,uint8,UINT8,/* */)
__GST_BYTE_READER_GET_PEEK_BITS_UNCHECKED(8,gint8,int8,UINT8,/* */)

__GST_BYTE_READER_GET_PEEK_BITS_UNCHECKED(16,guint16,uint16_le,UINT16_LE,/* */)
__GST_BYTE_READER_GET_PEEK_BITS_UNCHECKED(16,guint16,uint16_be,UINT16_BE,/* */)
__GST_BYTE_READER_GET_PEEK_BITS_UNCHECKED(16,gint16,int16_l    if (offset >= (gsize) size)
      return;

    size -= offset;
  }

  gst_buffer_extract (buffer, offset,
      (guint8 *) & writer->parent.data[writer->parent.byte], size);
  writer->parent.byte += size;
  writer->parent.size = MAX (writer->parent.size, writer->parent.byte);
}

static inline gboolean
_gst_byte_writer_put_buffer_inline (GstByteWriter * writer, GstBuffer * buffer,
    gsize offset, gssize size)
{
  g_return_val_if_fail (writer != NULL, FALSE);
  g_return_val_if_fail (size >= -1, FALSE);

  if (size == -1) {
    size = gst_buffer_get_size (buffer);

    if (offset >= (gsize) size)
      return TRUE;

    size -= offset;
  }

  if (G_UNLIKELY (!_gst_byte_writer_ensure_free_space_inline (writer, size)))
    return FALSE;

  gst_byte_writer_put_buffer_unchecked (writer, buffer, offset, size);

  return TRUE;
}

#ifndef GST_BYTE_WRITER_DISABLE_INLINES

/* we use defines here so we can add the G_LIKELY() */

#define gst_byte_writer_ensure_free_space(writer, size) \
    G_LIKELY (_gst_byte_writer_ensure_free_space_inline (writer, size))
#define gst_byte_writer_put_uint8(writer, val) \
    G_LIKELY (_gst_byte_writer_put_uint8_inline (writer, val))
#define gst_byte_writer_put_int8(writer, val) \
    G_LIKELY (_gst_byte_writer_put_int8_inline (writer, val))
#define gst_byte_writer_put_uint16_be(writer, val) \
    G_LIKELY (_gst_byte_writer_put_uint16_be_inline (writer, val))
#define gst_byte_writer_put_uint16_le(writer, val) \
    G_LIKELY (_gst_byte_writer_put_uint16_le_inlinet_data      (GstByteWriter *writer);

GST_BASE_API
GstBuffer *     gst_byte_writer_reset_and_get_buffer    (GstByteWriter *writer) G_GNUC_MALLOC;

/**
 * gst_byte_writer_get_pos:
 * @writer: #GstByteWriter instance
 *
 * Returns: The current position of the read/write cursor
 */
/**
 * gst_byte_writer_set_pos:
 * @writer: #GstByteWriter instance
 * @pos: new position
 *
 * Sets the current read/write cursor of @writer. The new position
 * can only be between 0 and the current size.
 *
 * Returns: %TRUE if the new position could be set
 */
/**
 * gst_byte_writer_get_size:
 * @writer: #GstByteWriter instance
 *
 * Returns: The current, initialized size of the data
 */
static inline guint
gst_byte_writer_get_pos (const GstByteWriter *writer)
{
  return gst_byte_reader_get_pos ((const GstByteReader *) writer);
}

static inline gboolean
gst_byte_writer_set_pos (GstByteWriter *writer, guint pos)
{
  return gst_byte_reader_set_pos (GST_BYTE_READER (writer), pos);
}

static inline guint
gst_byte_writer_get_size (const GstByteWriter *writer)
{
  return gst_byte_reader_get_size ((const GstByteReader *) writer);
}

GST_BASE_API
guint           gst_byte_writer_get_remaining     (const GstByteWriter *writer);

GST_BASE_API
gboolean        gst_byte_writer_ensure_free_space (GstByteWriter *writer, guint size);

GST_BASE_API
gboolean        gst_byte_writer_put_uint8         (GstByteWriter *writer, guint8 val);

GST_BASE_API
gboolean        gst_byte_writer_put_int8          (GstByteWriter *writer, ginty));
}

static inline void
gst_memory_unref (GstMemory * memory)
{
  gst_mini_object_unref (GST_MINI_OBJECT_CAST (memory));
}
#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
GST_API
GstMemory *    gst_memory_ref   (GstMemory * memory);

GST_API
void           gst_memory_unref (GstMemory * memory);
#endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */

/* getting/setting memory properties */

GST_API
gsize          gst_memory_get_sizes    (GstMemory *mem, gsize *offset, gsize *maxsize);

GST_API
void           gst_memory_resize       (GstMemory *mem, gssize offset, gsize size);

#define        gst_memory_lock(m,f)        gst_mini_object_lock (GST_MINI_OBJECT_CAST (m), (f))
#define        gst_memory_unlock(m,f)      gst_mini_object_unlock (GST_MINI_OBJECT_CAST (m), (f))
#define        gst_memory_is_writable(m)   gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (m))
/**
 * gst_memory_make_writable:
 * @m: (transfer full): a #GstMemory
 *
 * Returns a writable copy of @m. If the source memory is
 * already writable, this will simply return the same memory.
 *
 * Returns: (transfer full) (nullable): a writable memory (which may or may not be the
 *     same as @m) or %NULL if copying is required but not possible.
 */
#define        gst_memory_make_writable(m) GST_MEMORY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (m)))

/* retrieving data */

GST_API
GstMemory *    gst_memory_make_mapped  (GstMemory *mem, GstMapInfo *info, GstMapFlags flags) G_GNUC_WARN_UNUSED_RESULT;

GST_rivate GstBaseSrcPrivate;

/**
 * GST_BASE_SRC_PAD:
 * @obj: base source instance
 *
 * Gives the pointer to the #GstPad object of the element.
 */
#define GST_BASE_SRC_PAD(obj)                 (GST_BASE_SRC_CAST (obj)->srcpad)


/**
 * GstBaseSrc:
 *
 * The opaque #GstBaseSrc data structure.
 */
struct _GstBaseSrc {
  GstElement     element;

  /*< protected >*/
  GstPad        *srcpad;

  /* available to subclass implementations */
  /* MT-protected (with LIVE_LOCK) */
  GMutex         live_lock;
  GCond          live_cond;
  gboolean       is_live;
  gboolean       live_running;

  /* MT-protected (with LOCK) */
  guint          blocksize;     /* size of buffers when operating push based */
  gboolean       can_activate_push;     /* some scheduling properties */
  gboolean       random_access;

  GstClockID     clock_id;      /* for syncing */

  /* MT-protected (with STREAM_LOCK *and* OBJECT_LOCK) */
  GstSegment     segment;
  /* MT-protected (with STREAM_LOCK) */
  gboolean       need_newsegment;

  gint           num_buffers;
  gint           num_buffers_left;

#ifndef GST_REMOVE_DEPRECATED
  gboolean       typefind;      /* unused */
#endif

  gboolean       running;
  GstEvent      *pending_seek;

  GstBaseSrcPrivate *priv;

  /*< private >*/
  gpointer       _gst_reserved[GST_PADDING_LARGE];
};

/**
 * GstBaseSrcClass:
 * @parent_class: Element parent class
 * @get_caps: Called to get the caps to report
 * @negotiate: Negotiated the caps with the peer.
 * @fixate: Called durinh words separated by '_'.
 * Used to generate `gst_type_find_register_*(GstPlugin* plugin)`.
 * @t_f_n: The public name of the type find
 * @r: The #GstRank of the type find (higher rank means more importance when autoplugging, see #GstRank)
 * @func: The #GstTypeFindFunction to use
 * @extensions: (nullable): Optional comma-separated list of extensions
 *     that could belong to this type
 * @possible_caps: (nullable): Optionally the caps that could be returned when typefinding
 *                 succeeds
 * @data: Optional user data. This user data must be available until the plugin
 *        is unloaded.
 * @data_notify: a #GDestroyNotify that will be called on @data when the plugin
 *        is unloaded.
 *
 * A convenience macro to define the entry point of a
 * type find `gst_type_find_register_*(GstPlugin* plugin)`.
 *
 * Since: 1.20
 */
#define GST_TYPE_FIND_REGISTER_DEFINE(t_f, t_f_n, r, func, extensions, possible_caps, data, data_notify) \
G_BEGIN_DECLS \
gboolean G_PASTE (gst_type_find_register_, t_f) (GstPlugin * plugin) \
{ \
  return gst_type_find_register (plugin, t_f_n, r, func, extensions, possible_caps, data, data_notify); \
} \
G_END_DECLS

/**
 * GST_TYPE_FIND_REGISTER_DECLARE:
 * @t_f: The type find name in lower case, with words separated by '_'.
 *
 * This macro can be used to declare a new type find.
 * It has to be used in combination with #GST_TYPE_FIND_REGISTER_DEFINE macro
 * and must be placed outside any block to declare the type find registration
 * funct
 *
 * Deprecated: Use gst_clock_id_get_clock() instead.
 */
#define GST_CLOCK_ENTRY_CLOCK(entry)    ((entry)->clock)
#endif
/**
 * GST_CLOCK_ENTRY_TYPE:
 * @entry: the entry to query
 *
 * Gets the type of the clock entry
 */
#define GST_CLOCK_ENTRY_TYPE(entry)     ((entry)->type)
/**
 * GST_CLOCK_ENTRY_TIME:
 * @entry: the entry to query
 *
 * Gets the requested time of this entry
 */
#define GST_CLOCK_ENTRY_TIME(entry)     ((entry)->time)
/**
 * GST_CLOCK_ENTRY_INTERVAL:
 * @entry: the entry to query
 *
 * Gets the interval of this periodic entry
 */
#define GST_CLOCK_ENTRY_INTERVAL(entry) ((entry)->interval)
/**
 * GST_CLOCK_ENTRY_STATUS:
 * @entry: the entry to query
 *
 * The status of the entry
 */
#define GST_CLOCK_ENTRY_STATUS(entry)   ((entry)->status)

/**
 * GstClockEntry:
 * @refcount: reference counter (read-only)
 *
 * All pending timeouts or periodic notifies are converted into
 * an entry.
 * Note that GstClockEntry should be treated as an opaque structure. It must
 * not be extended or allocated using a custom allocator.
 */
struct _GstClockEntry {
  gint                  refcount;
  /*< private >*/
#ifndef GST_REMOVE_DEPRECATED
#ifndef GST_DISABLE_DEPRECATED
  GstClock              *clock;
#else
  gpointer               _clock;
#endif
#endif
  GstClockEntryType      type;
  GstClockTime           time;
  GstClockTime           interval;
  GstClockReturn         status;
  GstClockCallback       func;
  gpointer               user_data;
  GDestroyNotify         destroy_r.h>
#include <gst/gstbus.h>

G_BEGIN_DECLS

#define GST_TYPE_BIN             (gst_bin_get_type ())
#define GST_IS_BIN(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_BIN))
#define GST_IS_BIN_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_BIN))
#define GST_BIN_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BIN, GstBinClass))
#define GST_BIN(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BIN, GstBin))
#define GST_BIN_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BIN, GstBinClass))
#define GST_BIN_CAST(obj)        ((GstBin*)(obj))

/**
 * GstBinFlags:
 * @GST_BIN_FLAG_LAST: the last enum in the series of flags for bins.
 * Derived classes can use this as first value in a list of flags.
 *
 * GstBinFlags are a set of flags specific to bins. Most are set/used
 * internally. They can be checked using the GST_OBJECT_FLAG_IS_SET() macro,
 * and (un)set using GST_OBJECT_FLAG_SET() and GST_OBJECT_FLAG_UNSET().
 */
typedef enum {
  /**
   * GST_BIN_FLAG_NO_RESYNC:
   *
   * Don't resync a state change when elements are added or linked in the bin
   *
   * Since: 1.0.5
   */
  GST_BIN_FLAG_NO_RESYNC	= (GST_ELEMENT_FLAG_LAST << 0),

  /**
   * GST_BIN_FLAG_STREAMS_AWARE:
   *
   * Indicates whether the bin can handle elements that add/remove source pads
   * at any point in time without first posting a no-more-pads signal.
   *
   * Since: 1.10
   */
  GST_BIN_FLAG_STREAMS_AWARE	= (GST_ELEMENT_FLAG_LAST << 1),

  /* padding */

  /**me), \
  (gchar *) description, \
  init, \
  version, \
  license, \
  PACKAGE, \
  package, \
  origin, \
  __GST_PACKAGE_RELEASE_DATETIME, \
  GST_PADDING_INIT \
};                                       \
\
const GstPluginDesc * \
G_PASTE(gst_plugin_, G_PASTE(name, _get_desc)) (void) \
{ \
    return &gst_plugin_desc; \
} \
\
void \
G_PASTE(gst_plugin_, G_PASTE(name, _register)) (void) \
{ \
  gst_plugin_register_static (major, minor, G_STRINGIFY(name), \
      description, init, version, license, \
      PACKAGE, package, origin); \
} \
G_END_DECLS

/**
 * GST_LICENSE_UNKNOWN:
 *
 * To be used in GST_PLUGIN_DEFINE if unsure about the licence.
 */
#define GST_LICENSE_UNKNOWN "unknown"


/* function for filters */
/**
 * GstPluginFilter:
 * @plugin: the plugin to check
 * @user_data: the user_data that has been passed on e.g. gst_registry_plugin_filter()
 *
 * A function that can be used with e.g. gst_registry_plugin_filter()
 * to get a list of plugins that match certain criteria.
 *
 * Returns: %TRUE for a positive match, %FALSE otherwise
 */
typedef gboolean        (*GstPluginFilter)              (GstPlugin *plugin,
                                                         gpointer user_data);

GST_API
GType                   gst_plugin_get_type             (void);

GST_API
gboolean		gst_plugin_register_static	(gint major_version,
                                                         gint minor_version,
                                                         const gchar *name,
 klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ALLOCATOR, GstAllocatorClass))
#define GST_ALLOCATOR_CAST(obj)            ((GstAllocator *)(obj))

#define GST_TYPE_ALLOCATION_PARAMS (gst_allocation_params_get_type())

GST_API
GType gst_allocation_params_get_type(void);

typedef struct _GstAllocationParams GstAllocationParams;

/**
 * gst_memory_alignment:
 *
 * The default memory alignment in bytes - 1
 * an alignment of 7 would be the same as what malloc() guarantees.
 */

GST_API gsize gst_memory_alignment;

/**
 * GST_ALLOCATOR_SYSMEM:
 *
 * The allocator name for the default system memory allocator
 */
#define GST_ALLOCATOR_SYSMEM   "SystemMemory"

/**
 * GstAllocationParams:
 * @flags: flags to control allocation
 * @align: the desired alignment of the memory
 * @prefix: the desired prefix
 * @padding: the desired padding
 *
 * Parameters to control the allocation of memory
 */
struct _GstAllocationParams {
  GstMemoryFlags flags;
  gsize          align;
  gsize          prefix;
  gsize          padding;

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

/**
 * GstAllocatorFlags:
 * @GST_ALLOCATOR_FLAG_CUSTOM_ALLOC: The allocator has a custom alloc function.
 *    Only elements designed to work with this allocator should be using it,
 *    other elements should ignore it from allocation propositions.
 *    This implies %GST_ALLOCATOR_FLAG_NO_COPY.
 * @GST_ALLOCATOR_FLAG_NO_COPY: When copying a #GstMemory allocated with this
 *    allocator, the copy will insteer
 * @data: data obtained from #GstMetaSerializeFunction
 * @size: size of data to avoid buffer overflow
 *
 * Recreate a #GstMeta from serialized data returned by
 * #GstMetaSerializeFunction and add it to @buffer.
 *
 * Returns: (transfer none) (nullable): the metadata owned by @buffer, or %NULL.
 *
 * Since: 1.24
 */
typedef GstMeta *(*GstMetaDeserializeFunction) (const GstMetaInfo *info,
    GstBuffer *buffer, const guint8 *data, gsize size, guint8 version);

/**
 * GstMetaClearFunction:
 * @buffer: a #GstBuffer
 * @meta: a #GstMeta
 *
 * Clears the content of the meta. This will be called by the GstBufferPool
 * when a pooled buffer is returned.
 *
 * Since: 1.24
 */
typedef void (*GstMetaClearFunction) (GstBuffer *buffer, GstMeta *meta);

/**
 * GstAllocationMetaParamsAggregator:
 * @aggregated_params: This structure will be updated with the
 *                     combined parameters from both @params0 and @params1.
 * @params0: a #GstStructure containing the new parameters to be aggregated.
 * @params1: a #GstStructure containing the new parameters to be aggregated.
 *
 * The aggregator function will combine the parameters from @params0 and @param1
 * and write the result back into @aggregated_params.
 *
 * Returns: %TRUE if the parameters were successfully aggregated, %FALSE otherwise.
 *
 * Since: 1.26
 */
typedef gboolean (*GstAllocationMetaParamsAggregator) (GstStructure ** aggregated_params,
                                                       const GstStructure * params0                         GstClockTime min_latency,
                                                GstClockTime max_latency);
GST_BASE_API
gboolean        gst_base_parse_convert_default (GstBaseParse * parse,
                                                GstFormat      src_format,
                                                gint64         src_value,
                                                GstFormat      dest_format,
                                                gint64       * dest_value);
GST_BASE_API
gboolean        gst_base_parse_add_index_entry (GstBaseParse * parse,
                                                guint64        offset,
                                                GstClockTime   ts,
                                                gboolean       key,
                                                gboolean       force);
GST_BASE_API
void            gst_base_parse_set_ts_at_offset (GstBaseParse *parse,
                                                 gsize offset);
GST_BASE_API
void            gst_base_parse_merge_tags       (GstBaseParse  * parse,
                                                 GstTagList    * tags,
                                                 GstTagMergeMode mode);

G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBaseParseFrame, gst_base_parse_frame_free)

G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstBaseParse, gst_object_unref)

G_END_DECLS

#endif /* __GST_BASE_PARSE_H__ */
/* GStreamer
 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
 *
 *r on the sink pad. This function should chain
 *                   up to the parent implementation to let the default handler
 *                   run (Since: 1.2)
 * @src_query:      Optional.
 *                   Query handler on the source pad. Should chain up to the
 *                   parent to let the default handler run (Since: 1.2)
 *
 * Subclasses can override any of the available virtual methods or not, as
 * needed. At minimum @handle_frame needs to be overridden.
 */
struct _GstBaseParseClass {
  GstElementClass parent_class;

  /*< public >*/
  /* virtual methods for subclasses */

  gboolean      (*start)              (GstBaseParse * parse);

  gboolean      (*stop)               (GstBaseParse * parse);

  gboolean      (*set_sink_caps)      (GstBaseParse * parse,
                                       GstCaps      * caps);

  /**
   * GstBaseParseClass::handle_frame:
   * @skipsize: (out):
   *
   * Parses the input data into valid frames as defined by subclass
   * which should be passed to gst_base_parse_finish_frame().
   * The frame's input buffer is guaranteed writable,
   * whereas the input frame ownership is held by caller
   * (so subclass should make a copy if it needs to hang on).
   * Input buffer (data) is provided by baseclass with as much
   * metadata set as possible by baseclass according to upstream
   * information and/or subclass settings,
   * though subclass may still set buffer timestamp and duration
   * if desired.
   */
  GstFlowReturn (*handle__CHECK_INSTANCE_TYPE((obj),GST_TYPE_ARGB_CONTROL_BINDING))
#define GST_IS_ARGB_CONTROL_BINDING_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ARGB_CONTROL_BINDING))
#define GST_ARGB_CONTROL_BINDING_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstARGBControlBindingClass))

typedef struct _GstARGBControlBinding GstARGBControlBinding;
typedef struct _GstARGBControlBindingClass GstARGBControlBindingClass;

/**
 * GstARGBControlBinding:
 * @name: name of the property of this binding
 *
 * The instance structure of #GstARGBControlBinding.
 */
struct _GstARGBControlBinding {
  GstControlBinding parent;
  
  /*< private >*/
  GstControlSource *cs_a;       /* GstControlSources for this property */
  GstControlSource *cs_r;
  GstControlSource *cs_g;
  GstControlSource *cs_b;

  GValue cur_value;
  guint32 last_value;

  gpointer _gst_reserved[GST_PADDING];
};

/**
 * GstARGBControlBindingClass:
 * @parent_class: Parent class
 * @convert: Class method to convert control-values
 *
 * The class structure of #GstARGBControlBinding.
 */

struct _GstARGBControlBindingClass
{
  GstControlBindingClass parent_class;

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

GST_CONTROLLER_API
GType gst_argb_control_binding_get_type (void);

/* Functions */

GST_CONTROLLER_API
GstControlBinding * gst_argb_control_binding_new   (GstObject * object, const gchar * property_name,
                                                            GstControlSource * cs_a,stream.
 */
#define GST_QUERY_IS_SERIALIZED(ev)     !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_SERIALIZED)


/**
 * GstQuery:
 * @mini_object: The parent #GstMiniObject type
 * @type: the #GstQueryType
 *
 * The #GstQuery structure.
 */
struct _GstQuery
{
  GstMiniObject mini_object;

  /*< public > *//* with COW */
  GstQueryType type;
};

/**
 * GstBufferingMode:
 * @GST_BUFFERING_STREAM: a small amount of data is buffered
 * @GST_BUFFERING_DOWNLOAD: the stream is being downloaded
 * @GST_BUFFERING_TIMESHIFT: the stream is being downloaded in a ringbuffer
 * @GST_BUFFERING_LIVE: the stream is a live stream
 *
 * The different types of buffering methods.
 */
typedef enum {
  GST_BUFFERING_STREAM,
  GST_BUFFERING_DOWNLOAD,
  GST_BUFFERING_TIMESHIFT,
  GST_BUFFERING_LIVE
} GstBufferingMode;

#include <gst/gstiterator.h>
#include <gst/gststructure.h>
#include <gst/gstformat.h>
#include <gst/gstpad.h>
#include <gst/gstallocator.h>
#include <gst/gsttoc.h>
#include <gst/gstcontext.h>

GST_API
const gchar*    gst_query_type_get_name        (GstQueryType type);

GST_API
GQuark          gst_query_type_to_quark        (GstQueryType type);

GST_API
GstQueryTypeFlags
                gst_query_type_get_flags       (GstQueryType type);


GST_API
GType           gst_query_get_type             (void);

#ifndef GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS
/* refcounting */
static inline GstQuery *
gst_query_ref (GstQuery * q)
{
  return GST_QUERY_CAST (gst_mini_object_ref (GST_MINI_OBJECT_CAST (q)));
}

staticaps_features_remove (GstCapsFeatures * features, const gchar * feature);

GST_DEPRECATED_FOR(gst_caps_features_remove_id_str)
void              gst_caps_features_remove_id (GstCapsFeatures * features, GQuark feature);

GST_API
void              gst_caps_features_remove_id_str (GstCapsFeatures * features, const GstIdStr * feature);

G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstCapsFeatures, gst_caps_features_free)

G_END_DECLS

#endif /* __GST_CAPS_FEATURES_H__ */
/* GStreamer
 * Copyright (C) 2005 Andy Wingo <wingo@pobox.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */


#ifndef __GST_NET_H__
#define __GST_NET_H__

#include <gst/net/net-prelude.h>

#inc