Blame gst/gstelement.h

Packit f546b1
/* GStreamer
Packit f546b1
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
Packit f546b1
 *               2000,2004 Wim Taymans <wim@fluendo.com>
Packit f546b1
 *
Packit f546b1
 * gstelement.h: Header for GstElement
Packit f546b1
 *
Packit f546b1
 * This library is free software; you can redistribute it and/or
Packit f546b1
 * modify it under the terms of the GNU Library General Public
Packit f546b1
 * License as published by the Free Software Foundation; either
Packit f546b1
 * version 2 of the License, or (at your option) any later version.
Packit f546b1
 *
Packit f546b1
 * This library is distributed in the hope that it will be useful,
Packit f546b1
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit f546b1
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit f546b1
 * Library General Public License for more details.
Packit f546b1
 *
Packit f546b1
 * You should have received a copy of the GNU Library General Public
Packit f546b1
 * License along with this library; if not, write to the
Packit f546b1
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit f546b1
 * Boston, MA 02110-1301, USA.
Packit f546b1
 */
Packit f546b1
Packit f546b1
Packit f546b1
#ifndef __GST_ELEMENT_H__
Packit f546b1
#define __GST_ELEMENT_H__
Packit f546b1
Packit f546b1
#include <glib.h>
Packit f546b1
Packit f546b1
G_BEGIN_DECLS
Packit f546b1
Packit f546b1
/* gstelement.h and gstelementfactory.h include eachother */
Packit f546b1
typedef struct _GstElement GstElement;
Packit f546b1
typedef struct _GstElementClass GstElementClass;
Packit f546b1
Packit f546b1
/* gstmessage.h needs State */
Packit f546b1
/**
Packit f546b1
 * GstState:
Packit f546b1
 * @GST_STATE_VOID_PENDING: no pending state.
Packit f546b1
 * @GST_STATE_NULL        : the NULL state or initial state of an element.
Packit f546b1
 * @GST_STATE_READY       : the element is ready to go to PAUSED.
Packit f546b1
 * @GST_STATE_PAUSED      : the element is PAUSED, it is ready to accept and
Packit f546b1
 *                          process data. Sink elements however only accept one
Packit f546b1
 *                          buffer and then block.
Packit f546b1
 * @GST_STATE_PLAYING     : the element is PLAYING, the #GstClock is running and
Packit f546b1
 *                          the data is flowing.
Packit f546b1
 *
Packit f546b1
 * The possible states an element can be in. States can be changed using
Packit f546b1
 * gst_element_set_state() and checked using gst_element_get_state().
Packit f546b1
 */
Packit f546b1
typedef enum {
Packit f546b1
  GST_STATE_VOID_PENDING        = 0,
Packit f546b1
  GST_STATE_NULL                = 1,
Packit f546b1
  GST_STATE_READY               = 2,
Packit f546b1
  GST_STATE_PAUSED              = 3,
Packit f546b1
  GST_STATE_PLAYING             = 4
Packit f546b1
} GstState;
Packit f546b1
Packit f546b1
#define GST_TYPE_ELEMENT                (gst_element_get_type ())
Packit f546b1
#define GST_IS_ELEMENT(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_ELEMENT))
Packit f546b1
#define GST_IS_ELEMENT_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_ELEMENT))
Packit f546b1
#define GST_ELEMENT_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ELEMENT, GstElementClass))
Packit f546b1
#define GST_ELEMENT(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ELEMENT, GstElement))
Packit f546b1
#define GST_ELEMENT_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass))
Packit f546b1
#define GST_ELEMENT_CAST(obj)           ((GstElement*)(obj))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstStateChangeReturn:
Packit f546b1
 * @GST_STATE_CHANGE_FAILURE   : the state change failed
Packit f546b1
 * @GST_STATE_CHANGE_SUCCESS   : the state change succeeded
Packit f546b1
 * @GST_STATE_CHANGE_ASYNC     : the state change will happen asynchronously
Packit f546b1
 * @GST_STATE_CHANGE_NO_PREROLL: the state change succeeded but the element
Packit f546b1
 *                               cannot produce data in %GST_STATE_PAUSED.
Packit f546b1
 *                               This typically happens with live sources.
Packit f546b1
 *
Packit f546b1
 * The possible return values from a state change function such as
Packit f546b1
 * gst_element_set_state(). Only @GST_STATE_CHANGE_FAILURE is a real failure.
Packit f546b1
 */
Packit f546b1
typedef enum {
Packit f546b1
  GST_STATE_CHANGE_FAILURE             = 0,
Packit f546b1
  GST_STATE_CHANGE_SUCCESS             = 1,
Packit f546b1
  GST_STATE_CHANGE_ASYNC               = 2,
Packit f546b1
  GST_STATE_CHANGE_NO_PREROLL          = 3
Packit f546b1
} GstStateChangeReturn;
Packit f546b1
Packit f546b1
#include <gst/gstconfig.h>
Packit f546b1
#include <gst/gstobject.h>
Packit f546b1
#include <gst/gstpad.h>
Packit f546b1
#include <gst/gstbus.h>
Packit f546b1
#include <gst/gstclock.h>
Packit f546b1
#include <gst/gstelementfactory.h>
Packit f546b1
#include <gst/gstplugin.h>
Packit f546b1
#include <gst/gstpluginfeature.h>
Packit f546b1
#include <gst/gstiterator.h>
Packit f546b1
#include <gst/gstmessage.h>
Packit f546b1
#include <gst/gstquery.h>
Packit f546b1
#include <gst/gsttaglist.h>
Packit f546b1
#include <gst/gstcontext.h>
Packit f546b1
Packit f546b1
/* NOTE: this probably should be done with an #ifdef to decide
Packit f546b1
 * whether to safe-cast or to just do the non-checking cast.
Packit f546b1
 */
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_STATE:
Packit f546b1
 * @elem: a #GstElement to return state for.
Packit f546b1
 *
Packit f546b1
 * This macro returns the current #GstState of the element.
Packit f546b1
 */
Packit f546b1
#define GST_STATE(elem)                 (GST_ELEMENT_CAST(elem)->current_state)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_STATE_NEXT:
Packit f546b1
 * @elem: a #GstElement to return the next state for.
Packit f546b1
 *
Packit f546b1
 * This macro returns the next #GstState of the element.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_NEXT(elem)            (GST_ELEMENT_CAST(elem)->next_state)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_STATE_PENDING:
Packit f546b1
 * @elem: a #GstElement to return the pending state for.
Packit f546b1
 *
Packit f546b1
 * This macro returns the currently pending #GstState of the element.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_PENDING(elem)         (GST_ELEMENT_CAST(elem)->pending_state)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_STATE_TARGET:
Packit f546b1
 * @elem: a #GstElement to return the target state for.
Packit f546b1
 *
Packit f546b1
 * This macro returns the target #GstState of the element.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_TARGET(elem)          (GST_ELEMENT_CAST(elem)->target_state)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_STATE_RETURN:
Packit f546b1
 * @elem: a #GstElement to return the last state result for.
Packit f546b1
 *
Packit f546b1
 * This macro returns the last #GstStateChangeReturn value.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_RETURN(elem)          (GST_ELEMENT_CAST(elem)->last_return)
Packit f546b1
Packit f546b1
#define __GST_SIGN(val)                 ((val) < 0 ? -1 : ((val) > 0 ? 1 : 0))
Packit f546b1
/**
Packit f546b1
 * GST_STATE_GET_NEXT:
Packit f546b1
 * @cur: A starting #GstState
Packit f546b1
 * @pending: A target #GstState
Packit f546b1
 *
Packit f546b1
 * Given a current state @cur and a target state @pending, calculate the next (intermediate)
Packit f546b1
 * #GstState.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_GET_NEXT(cur,pending)         ((GstState)((cur) + __GST_SIGN ((gint)(pending) - (gint)(cur))))
Packit f546b1
/**
Packit f546b1
 * GST_STATE_TRANSITION:
Packit f546b1
 * @cur: A current state
Packit f546b1
 * @next: A next state
Packit f546b1
 *
Packit f546b1
 * Given a current state @cur and a next state @next, calculate the associated
Packit f546b1
 * #GstStateChange transition.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_TRANSITION(cur,next)          ((GstStateChange)(((cur)<<3)|(next)))
Packit f546b1
/**
Packit f546b1
 * GST_STATE_TRANSITION_CURRENT:
Packit f546b1
 * @trans: A #GstStateChange
Packit f546b1
 *
Packit f546b1
 * Given a state transition @trans, extract the current #GstState.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_TRANSITION_CURRENT(trans)     ((GstState)((trans)>>3))
Packit f546b1
/**
Packit f546b1
 * GST_STATE_TRANSITION_NEXT:
Packit f546b1
 * @trans: A #GstStateChange
Packit f546b1
 *
Packit f546b1
 * Given a state transition @trans, extract the next #GstState.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_TRANSITION_NEXT(trans)        ((GstState)((trans)&0x7))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstStateChange:
Packit f546b1
 * @GST_STATE_CHANGE_NULL_TO_READY    : state change from NULL to READY.
Packit f546b1
 *   * The element must check if the resources it needs are available. Device
Packit f546b1
 *     sinks and -sources typically try to probe the device to constrain their
Packit f546b1
 *     caps.
Packit f546b1
 *   * The element opens the device (in case feature need to be probed).
Packit f546b1
 * @GST_STATE_CHANGE_READY_TO_PAUSED  : state change from READY to PAUSED.
Packit f546b1
 *   * The element pads are activated in order to receive data in PAUSED.
Packit f546b1
 *     Streaming threads are started.
Packit f546b1
 *   * Some elements might need to return %GST_STATE_CHANGE_ASYNC and complete
Packit f546b1
 *     the state change when they have enough information. It is a requirement
Packit f546b1
 *     for sinks to return %GST_STATE_CHANGE_ASYNC and complete the state change
Packit f546b1
 *     when they receive the first buffer or %GST_EVENT_EOS (preroll).
Packit f546b1
 *     Sinks also block the dataflow when in PAUSED.
Packit f546b1
 *   * A pipeline resets the running_time to 0.
Packit f546b1
 *   * Live sources return %GST_STATE_CHANGE_NO_PREROLL and don't generate data.
Packit f546b1
 * @GST_STATE_CHANGE_PAUSED_TO_PLAYING: state change from PAUSED to PLAYING.
Packit f546b1
 *   * Most elements ignore this state change.
Packit f546b1
 *   * The pipeline selects a #GstClock and distributes this to all the children
Packit f546b1
 *     before setting them to PLAYING. This means that it is only allowed to
Packit f546b1
 *     synchronize on the #GstClock in the PLAYING state.
Packit f546b1
 *   * The pipeline uses the #GstClock and the running_time to calculate the
Packit f546b1
 *     base_time. The base_time is distributed to all children when performing
Packit f546b1
 *     the state change.
Packit f546b1
 *   * Sink elements stop blocking on the preroll buffer or event and start
Packit f546b1
 *     rendering the data.
Packit f546b1
 *   * Sinks can post %GST_MESSAGE_EOS in the PLAYING state. It is not allowed
Packit f546b1
 *     to post %GST_MESSAGE_EOS when not in the PLAYING state.
Packit f546b1
 *   * While streaming in PAUSED or PLAYING elements can create and remove
Packit f546b1
 *     sometimes pads.
Packit f546b1
 *   * Live sources start generating data and return %GST_STATE_CHANGE_SUCCESS.
Packit f546b1
 * @GST_STATE_CHANGE_PLAYING_TO_PAUSED: state change from PLAYING to PAUSED.
Packit f546b1
 *   * Most elements ignore this state change.
Packit f546b1
 *   * The pipeline calculates the running_time based on the last selected
Packit f546b1
 *     #GstClock and the base_time. It stores this information to continue
Packit f546b1
 *     playback when going back to the PLAYING state.
Packit f546b1
 *   * Sinks unblock any #GstClock wait calls.
Packit f546b1
 *   * When a sink does not have a pending buffer to play, it returns
Packit f546b1
 *     #GST_STATE_CHANGE_ASYNC from this state change and completes the state
Packit f546b1
 *     change when it receives a new buffer or an %GST_EVENT_EOS.
Packit f546b1
 *   * Any queued %GST_MESSAGE_EOS items are removed since they will be reposted
Packit f546b1
 *     when going back to the PLAYING state. The EOS messages are queued in
Packit f546b1
 *     #GstBin containers.
Packit f546b1
 *   * Live sources stop generating data and return %GST_STATE_CHANGE_NO_PREROLL.
Packit f546b1
 * @GST_STATE_CHANGE_PAUSED_TO_READY  : state change from PAUSED to READY.
Packit f546b1
 *   * Sinks unblock any waits in the preroll.
Packit f546b1
 *   * Elements unblock any waits on devices
Packit f546b1
 *   * Chain or get_range functions return %GST_FLOW_FLUSHING.
Packit f546b1
 *   * The element pads are deactivated so that streaming becomes impossible and
Packit f546b1
 *     all streaming threads are stopped.
Packit f546b1
 *   * The sink forgets all negotiated formats
Packit f546b1
 *   * Elements remove all sometimes pads
Packit f546b1
 * @GST_STATE_CHANGE_READY_TO_NULL    : state change from READY to NULL.
Packit f546b1
 *   * Elements close devices
Packit f546b1
 *   * Elements reset any internal state.
Packit f546b1
 * @GST_STATE_CHANGE_NULL_TO_NULL       : state change from NULL to NULL. (Since 1.14)
Packit f546b1
 * @GST_STATE_CHANGE_READY_TO_READY     : state change from READY to READY,
Packit f546b1
 * This might happen when going to PAUSED asynchronously failed, in that case
Packit f546b1
 * elements should make sure they are in a proper, coherent READY state. (Since 1.14)
Packit f546b1
 * @GST_STATE_CHANGE_PAUSED_TO_PAUSED   : state change from PAUSED to PAUSED.
Packit f546b1
 * This might happen when elements were in PLAYING state and 'lost state',
Packit f546b1
 * they should make sure to go back to real 'PAUSED' state (prerolling for example). (Since 1.14)
Packit f546b1
 * @GST_STATE_CHANGE_PLAYING_TO_PLAYING : state change from PLAYING to PLAYING. (Since 1.14)
Packit f546b1
 *
Packit f546b1
 * These are the different state changes an element goes through.
Packit f546b1
 * %GST_STATE_NULL ⇒ %GST_STATE_PLAYING is called an upwards state change
Packit f546b1
 * and %GST_STATE_PLAYING ⇒ %GST_STATE_NULL a downwards state change.
Packit f546b1
 */
Packit f546b1
typedef enum /*< flags=0 >*/
Packit f546b1
{
Packit f546b1
  GST_STATE_CHANGE_NULL_TO_READY        = (GST_STATE_NULL<<3) | GST_STATE_READY,
Packit f546b1
  GST_STATE_CHANGE_READY_TO_PAUSED      = (GST_STATE_READY<<3) | GST_STATE_PAUSED,
Packit f546b1
  GST_STATE_CHANGE_PAUSED_TO_PLAYING    = (GST_STATE_PAUSED<<3) | GST_STATE_PLAYING,
Packit f546b1
  GST_STATE_CHANGE_PLAYING_TO_PAUSED    = (GST_STATE_PLAYING<<3) | GST_STATE_PAUSED,
Packit f546b1
  GST_STATE_CHANGE_PAUSED_TO_READY      = (GST_STATE_PAUSED<<3) | GST_STATE_READY,
Packit f546b1
  GST_STATE_CHANGE_READY_TO_NULL        = (GST_STATE_READY<<3) | GST_STATE_NULL,
Packit f546b1
  GST_STATE_CHANGE_NULL_TO_NULL         = (GST_STATE_NULL<<3) | GST_STATE_NULL,
Packit f546b1
  GST_STATE_CHANGE_READY_TO_READY       = (GST_STATE_READY<<3) | GST_STATE_READY,
Packit f546b1
  GST_STATE_CHANGE_PAUSED_TO_PAUSED     = (GST_STATE_PAUSED<<3) | GST_STATE_PAUSED,
Packit f546b1
  GST_STATE_CHANGE_PLAYING_TO_PLAYING   = (GST_STATE_PLAYING<<3) | GST_STATE_PLAYING
Packit f546b1
} GstStateChange;
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstElementFlags:
Packit f546b1
 * @GST_ELEMENT_FLAG_LOCKED_STATE: ignore state changes from parent
Packit f546b1
 * @GST_ELEMENT_FLAG_SINK: the element is a sink
Packit f546b1
 * @GST_ELEMENT_FLAG_SOURCE: the element is a source.
Packit f546b1
 * @GST_ELEMENT_FLAG_PROVIDE_CLOCK: the element can provide a clock
Packit f546b1
 * @GST_ELEMENT_FLAG_REQUIRE_CLOCK: the element requires a clock
Packit f546b1
 * @GST_ELEMENT_FLAG_INDEXABLE: the element can use an index
Packit f546b1
 * @GST_ELEMENT_FLAG_LAST: offset to define more flags
Packit f546b1
 *
Packit f546b1
 * The standard flags that an element may have.
Packit f546b1
 */
Packit f546b1
typedef enum
Packit f546b1
{
Packit f546b1
  GST_ELEMENT_FLAG_LOCKED_STATE   = (GST_OBJECT_FLAG_LAST << 0),
Packit f546b1
  GST_ELEMENT_FLAG_SINK           = (GST_OBJECT_FLAG_LAST << 1),
Packit f546b1
  GST_ELEMENT_FLAG_SOURCE         = (GST_OBJECT_FLAG_LAST << 2),
Packit f546b1
  GST_ELEMENT_FLAG_PROVIDE_CLOCK  = (GST_OBJECT_FLAG_LAST << 3),
Packit f546b1
  GST_ELEMENT_FLAG_REQUIRE_CLOCK  = (GST_OBJECT_FLAG_LAST << 4),
Packit f546b1
  GST_ELEMENT_FLAG_INDEXABLE      = (GST_OBJECT_FLAG_LAST << 5),
Packit f546b1
  /* padding */
Packit f546b1
  GST_ELEMENT_FLAG_LAST           = (GST_OBJECT_FLAG_LAST << 10)
Packit f546b1
} GstElementFlags;
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_IS_LOCKED_STATE:
Packit f546b1
 * @elem: A #GstElement to query
Packit f546b1
 *
Packit f546b1
 * Check if the element is in the locked state and therefore will ignore state
Packit f546b1
 * changes from its parent object.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_IS_LOCKED_STATE(elem)        (GST_OBJECT_FLAG_IS_SET(elem,GST_ELEMENT_FLAG_LOCKED_STATE))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_NAME:
Packit f546b1
 * @elem: A #GstElement to query
Packit f546b1
 *
Packit f546b1
 * Gets the name of this element. This is not thread-safe by default
Packit f546b1
 * (i.e. you will have to make sure the object lock is taken yourself).
Packit f546b1
 * If in doubt use gst_element_get_name() instead.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_NAME(elem)                  (GST_OBJECT_NAME(elem))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_PARENT:
Packit f546b1
 * @elem: A #GstElement to query
Packit f546b1
 *
Packit f546b1
 * Get the parent object of this element. This is not thread-safe by default
Packit f546b1
 * (i.e. you will have to make sure the object lock is taken yourself).
Packit f546b1
 * If in doubt use gst_object_get_parent() instead.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_PARENT(elem)                (GST_ELEMENT_CAST(GST_OBJECT_PARENT(elem)))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_BUS:
Packit f546b1
 * @elem: A #GstElement to query
Packit f546b1
 *
Packit f546b1
 * Get the message bus of this element. This is not thread-safe by default
Packit f546b1
 * (i.e. you will have to make sure the object lock is taken yourself).
Packit f546b1
 * If in doubt use gst_element_get_bus() instead.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_BUS(elem)                   (GST_ELEMENT_CAST(elem)->bus)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_CLOCK:
Packit f546b1
 * @elem: A #GstElement to query
Packit f546b1
 *
Packit f546b1
 * Get the clock of this element.This is not thread-safe by default
Packit f546b1
 * (i.e. you will have to make sure it is safe yourself).
Packit f546b1
 * If in doubt use gst_element_get_clock() instead.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_CLOCK(elem)                 (GST_ELEMENT_CAST(elem)->clock)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_PADS:
Packit f546b1
 * @elem: A #GstElement to query
Packit f546b1
 *
Packit f546b1
 * Get the pads of this elements.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_PADS(elem)                  (GST_ELEMENT_CAST(elem)->pads)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_START_TIME:
Packit f546b1
 * @elem: a #GstElement to return the start time for.
Packit f546b1
 *
Packit f546b1
 * This macro returns the start_time of the @elem. The start_time is the
Packit f546b1
 * running_time of the pipeline when the element went to PAUSED.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_START_TIME(elem)            (GST_ELEMENT_CAST(elem)->start_time)
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstStructure *gst_make_element_message_details (const char *name, ...);
Packit f546b1
Packit f546b1
#define GST_ELEMENT_MESSAGE_MAKE_DETAILS(args) gst_make_element_message_details args
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_FLOW_ERROR:
Packit f546b1
 * @el:           the element that generates the error
Packit f546b1
 * @flow_return:  the GstFlowReturn leading to that ERROR message
Packit f546b1
 *
Packit f546b1
 * Utility function that elements can use in case they encountered a fatal
Packit f546b1
 * data processing error due to wrong flow processing.
Packit f546b1
 *
Packit f546b1
 * Since: 1.10
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_FLOW_ERROR(el,flow_return)  \
Packit f546b1
G_STMT_START {                                                          \
Packit f546b1
  GST_ELEMENT_ERROR_WITH_DETAILS (el, STREAM, FAILED, \
Packit f546b1
      ("Internal data stream error."), \
Packit f546b1
      ("streaming stopped, reason %s (%d)", gst_flow_get_name (flow_return), flow_return), \
Packit f546b1
      ("flow-return", G_TYPE_INT, flow_return, NULL));\
Packit f546b1
} G_STMT_END
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_ERROR_WITH_DETAILS:
Packit f546b1
 * @el:     the element that generates the error
Packit f546b1
 * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #gstreamer-GstGError)
Packit f546b1
 * @code:   error code defined for that domain (see #gstreamer-GstGError)
Packit f546b1
 * @text:   the message to display (format string and args enclosed in
Packit f546b1
            parentheses)
Packit f546b1
 * @debug:  debugging information for the message (format string and args
Packit f546b1
            enclosed in parentheses)
Packit f546b1
 * @args:   optional name, type, value triplets, which will be stored
Packit f546b1
 *          in the associated GstStructure. NULL terminator required.
Packit f546b1
 *          Must be enclosed within parentheses.
Packit f546b1
 *
Packit f546b1
 * Utility function that elements can use in case they encountered a fatal
Packit f546b1
 * data processing error. The pipeline will post an error message and the
Packit f546b1
 * application will be requested to stop further media processing.
Packit f546b1
 *
Packit f546b1
 * Since: 1.10
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_ERROR_WITH_DETAILS(el,domain,code,text,debug,args)  \
Packit f546b1
G_STMT_START {                                                          \
Packit f546b1
  gchar *__txt = _gst_element_error_printf text;                        \
Packit f546b1
  gchar *__dbg = _gst_element_error_printf debug;                       \
Packit f546b1
  if (__txt)                                                            \
Packit f546b1
    GST_WARNING_OBJECT (el, "error: %s", __txt);                        \
Packit f546b1
  if (__dbg)                                                            \
Packit f546b1
    GST_WARNING_OBJECT (el, "error: %s", __dbg);                        \
Packit f546b1
  gst_element_message_full_with_details (GST_ELEMENT(el),               \
Packit f546b1
    GST_MESSAGE_ERROR, GST_ ## domain ## _ERROR,                        \
Packit f546b1
      GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,        \
Packit f546b1
      GST_FUNCTION, __LINE__, GST_ELEMENT_MESSAGE_MAKE_DETAILS(args));  \
Packit f546b1
} G_STMT_END
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_ERROR:
Packit f546b1
 * @el:     the element that generates the error
Packit f546b1
 * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #gstreamer-GstGError)
Packit f546b1
 * @code:   error code defined for that domain (see #gstreamer-GstGError)
Packit f546b1
 * @text:   the message to display (format string and args enclosed in
Packit f546b1
            parentheses)
Packit f546b1
 * @debug:  debugging information for the message (format string and args
Packit f546b1
            enclosed in parentheses)
Packit f546b1
 *
Packit f546b1
 * Utility function that elements can use in case they encountered a fatal
Packit f546b1
 * data processing error. The pipeline will post an error message and the
Packit f546b1
 * application will be requested to stop further media processing.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_ERROR(el,domain,code,text,debug)                    \
Packit f546b1
G_STMT_START {                                                          \
Packit f546b1
  gchar *__txt = _gst_element_error_printf text;                        \
Packit f546b1
  gchar *__dbg = _gst_element_error_printf debug;                       \
Packit f546b1
  if (__txt)                                                            \
Packit f546b1
    GST_WARNING_OBJECT (el, "error: %s", __txt);                        \
Packit f546b1
  if (__dbg)                                                            \
Packit f546b1
    GST_WARNING_OBJECT (el, "error: %s", __dbg);                        \
Packit f546b1
  gst_element_message_full (GST_ELEMENT(el),                            \
Packit f546b1
    GST_MESSAGE_ERROR, GST_ ## domain ## _ERROR,                        \
Packit f546b1
      GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,        \
Packit f546b1
      GST_FUNCTION, __LINE__);                                          \
Packit f546b1
} G_STMT_END
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_WARNING_WITH_DETAILS:
Packit f546b1
 * @el:     the element that generates the warning
Packit f546b1
 * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #gstreamer-GstGError)
Packit f546b1
 * @code:   error code defined for that domain (see #gstreamer-GstGError)
Packit f546b1
 * @text:   the message to display (format string and args enclosed in
Packit f546b1
            parentheses)
Packit f546b1
 * @debug:  debugging information for the message (format string and args
Packit f546b1
            enclosed in parentheses)
Packit f546b1
 * @args:   optional name, type, value triplets, which will be stored
Packit f546b1
 *          in the associated GstStructure. NULL terminator required.
Packit f546b1
 *          Must be enclosed within parentheses.
Packit f546b1
 *
Packit f546b1
 * Utility function that elements can use in case they encountered a non-fatal
Packit f546b1
 * data processing problem. The pipeline will post a warning message and the
Packit f546b1
 * application will be informed.
Packit f546b1
 *
Packit f546b1
 * Since: 1.10
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_WARNING_WITH_DETAILS(el, domain, code, text, debug, args)\
Packit f546b1
G_STMT_START {                                                          \
Packit f546b1
  gchar *__txt = _gst_element_error_printf text;                        \
Packit f546b1
  gchar *__dbg = _gst_element_error_printf debug;                       \
Packit f546b1
  if (__txt)                                                            \
Packit f546b1
    GST_WARNING_OBJECT (el, "warning: %s", __txt);                      \
Packit f546b1
  if (__dbg)                                                            \
Packit f546b1
    GST_WARNING_OBJECT (el, "warning: %s", __dbg);                      \
Packit f546b1
  gst_element_message_full_with_details (GST_ELEMENT(el),               \
Packit f546b1
    GST_MESSAGE_WARNING, GST_ ## domain ## _ERROR,                      \
Packit f546b1
    GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,          \
Packit f546b1
    GST_FUNCTION, __LINE__, GST_ELEMENT_MESSAGE_MAKE_DETAILS(args));    \
Packit f546b1
} G_STMT_END
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_WARNING:
Packit f546b1
 * @el:     the element that generates the warning
Packit f546b1
 * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #gstreamer-GstGError)
Packit f546b1
 * @code:   error code defined for that domain (see #gstreamer-GstGError)
Packit f546b1
 * @text:   the message to display (format string and args enclosed in
Packit f546b1
            parentheses)
Packit f546b1
 * @debug:  debugging information for the message (format string and args
Packit f546b1
            enclosed in parentheses)
Packit f546b1
 *
Packit f546b1
 * Utility function that elements can use in case they encountered a non-fatal
Packit f546b1
 * data processing problem. The pipeline will post a warning message and the
Packit f546b1
 * application will be informed.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_WARNING(el, domain, code, text, debug)              \
Packit f546b1
G_STMT_START {                                                          \
Packit f546b1
  gchar *__txt = _gst_element_error_printf text;                        \
Packit f546b1
  gchar *__dbg = _gst_element_error_printf debug;                       \
Packit f546b1
  if (__txt)                                                            \
Packit f546b1
    GST_WARNING_OBJECT (el, "warning: %s", __txt);                      \
Packit f546b1
  if (__dbg)                                                            \
Packit f546b1
    GST_WARNING_OBJECT (el, "warning: %s", __dbg);                      \
Packit f546b1
  gst_element_message_full (GST_ELEMENT(el),                            \
Packit f546b1
    GST_MESSAGE_WARNING, GST_ ## domain ## _ERROR,                      \
Packit f546b1
    GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,          \
Packit f546b1
    GST_FUNCTION, __LINE__);                                            \
Packit f546b1
} G_STMT_END
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_INFO_WITH_DETAILS:
Packit f546b1
 * @el:     the element that generates the information
Packit f546b1
 * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #gstreamer-GstGError)
Packit f546b1
 * @code:   error code defined for that domain (see #gstreamer-GstGError)
Packit f546b1
 * @text:   the message to display (format string and args enclosed in
Packit f546b1
            parentheses)
Packit f546b1
 * @debug:  debugging information for the message (format string and args
Packit f546b1
            enclosed in parentheses)
Packit f546b1
 * @args:   optional name, type, value triplets, which will be stored
Packit f546b1
 *          in the associated GstStructure. NULL terminator required.
Packit f546b1
 *          Must be enclosed within parentheses.
Packit f546b1
 *
Packit f546b1
 * Utility function that elements can use in case they want to inform
Packit f546b1
 * the application of something noteworthy that is not an error.
Packit f546b1
 * The pipeline will post a info message and the
Packit f546b1
 * application will be informed.
Packit f546b1
 * Optional name, type, value triplets may be supplied, and will be stored
Packit f546b1
 * in the associated GstStructure. NULL terminator required.
Packit f546b1
 *
Packit f546b1
 * Since: 1.10
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_INFO_WITH_DETAILS(el, domain, code, text, debug, args)   \
Packit f546b1
G_STMT_START {                                                          \
Packit f546b1
  gchar *__txt = _gst_element_error_printf text;                        \
Packit f546b1
  gchar *__dbg = _gst_element_error_printf debug;                       \
Packit f546b1
  if (__txt)                                                            \
Packit f546b1
    GST_INFO_OBJECT (el, "info: %s", __txt);                            \
Packit f546b1
  if (__dbg)                                                            \
Packit f546b1
    GST_INFO_OBJECT (el, "info: %s", __dbg);                            \
Packit f546b1
  gst_element_message_full_with_details (GST_ELEMENT(el),               \
Packit f546b1
    GST_MESSAGE_INFO, GST_ ## domain ## _ERROR,                         \
Packit f546b1
    GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,          \
Packit f546b1
    GST_FUNCTION, __LINE__, GST_ELEMENT_MESSAGE_MAKE_DETAILS(args));    \
Packit f546b1
} G_STMT_END
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_ELEMENT_INFO:
Packit f546b1
 * @el:     the element that generates the information
Packit f546b1
 * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #gstreamer-GstGError)
Packit f546b1
 * @code:   error code defined for that domain (see #gstreamer-GstGError)
Packit f546b1
 * @text:   the message to display (format string and args enclosed in
Packit f546b1
            parentheses)
Packit f546b1
 * @debug:  debugging information for the message (format string and args
Packit f546b1
            enclosed in parentheses)
Packit f546b1
 *
Packit f546b1
 * Utility function that elements can use in case they want to inform
Packit f546b1
 * the application of something noteworthy that is not an error.
Packit f546b1
 * The pipeline will post a info message and the
Packit f546b1
 * application will be informed.
Packit f546b1
 */
Packit f546b1
#define GST_ELEMENT_INFO(el, domain, code, text, debug)                 \
Packit f546b1
G_STMT_START {                                                          \
Packit f546b1
  gchar *__txt = _gst_element_error_printf text;                        \
Packit f546b1
  gchar *__dbg = _gst_element_error_printf debug;                       \
Packit f546b1
  if (__txt)                                                            \
Packit f546b1
    GST_INFO_OBJECT (el, "info: %s", __txt);                            \
Packit f546b1
  if (__dbg)                                                            \
Packit f546b1
    GST_INFO_OBJECT (el, "info: %s", __dbg);                            \
Packit f546b1
  gst_element_message_full (GST_ELEMENT(el),                            \
Packit f546b1
    GST_MESSAGE_INFO, GST_ ## domain ## _ERROR,                         \
Packit f546b1
    GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,          \
Packit f546b1
    GST_FUNCTION, __LINE__);                                            \
Packit f546b1
} G_STMT_END
Packit f546b1
Packit f546b1
/* the state change mutexes and conds */
Packit f546b1
/**
Packit f546b1
 * GST_STATE_GET_LOCK:
Packit f546b1
 * @elem:   a #GstElement
Packit f546b1
 *
Packit f546b1
 * Get a reference to the state lock of @elem.
Packit f546b1
 * This lock is used by the core.  It is taken while getting or setting
Packit f546b1
 * the state, during state changes, and while finalizing.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_GET_LOCK(elem)               (&(GST_ELEMENT_CAST(elem)->state_lock))
Packit f546b1
/**
Packit f546b1
 * GST_STATE_GET_COND:
Packit f546b1
 * @elem: a #GstElement
Packit f546b1
 *
Packit f546b1
 * Get the conditional used to signal the completion of a state change.
Packit f546b1
 */
Packit f546b1
#define GST_STATE_GET_COND(elem)               (&GST_ELEMENT_CAST(elem)->state_cond)
Packit f546b1
Packit f546b1
#define GST_STATE_LOCK(elem)                   g_rec_mutex_lock(GST_STATE_GET_LOCK(elem))
Packit f546b1
#define GST_STATE_TRYLOCK(elem)                g_rec_mutex_trylock(GST_STATE_GET_LOCK(elem))
Packit f546b1
#define GST_STATE_UNLOCK(elem)                 g_rec_mutex_unlock(GST_STATE_GET_LOCK(elem))
Packit f546b1
#define GST_STATE_WAIT(elem)                   g_cond_wait (GST_STATE_GET_COND (elem), \
Packit f546b1
                                                        GST_OBJECT_GET_LOCK (elem))
Packit f546b1
#define GST_STATE_WAIT_UNTIL(elem, end_time)   g_cond_wait_until (GST_STATE_GET_COND (elem), \
Packit f546b1
                                                        GST_OBJECT_GET_LOCK (elem), end_time)
Packit f546b1
#define GST_STATE_SIGNAL(elem)                 g_cond_signal (GST_STATE_GET_COND (elem));
Packit f546b1
#define GST_STATE_BROADCAST(elem)              g_cond_broadcast (GST_STATE_GET_COND (elem));
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstElement:
Packit f546b1
 * @state_lock: Used to serialize execution of gst_element_set_state()
Packit f546b1
 * @state_cond: Used to signal completion of a state change
Packit f546b1
 * @state_cookie: Used to detect concurrent execution of
Packit f546b1
 * gst_element_set_state() and gst_element_get_state()
Packit f546b1
 * @target_state: the target state of an element as set by the application
Packit f546b1
 * @current_state: the current state of an element
Packit f546b1
 * @next_state: the next state of an element, can be #GST_STATE_VOID_PENDING if
Packit f546b1
 * the element is in the correct state.
Packit f546b1
 * @pending_state: the final state the element should go to, can be
Packit f546b1
 * #GST_STATE_VOID_PENDING if the element is in the correct state
Packit f546b1
 * @last_return: the last return value of an element state change
Packit f546b1
 * @bus: the bus of the element. This bus is provided to the element by the
Packit f546b1
 * parent element or the application. A #GstPipeline has a bus of its own.
Packit f546b1
 * @clock: the clock of the element. This clock is usually provided to the
Packit f546b1
 * element by the toplevel #GstPipeline.
Packit f546b1
 * @base_time: the time of the clock right before the element is set to
Packit f546b1
 * PLAYING. Subtracting @base_time from the current clock time in the PLAYING
Packit f546b1
 * state will yield the running_time against the clock.
Packit f546b1
 * @start_time: the running_time of the last PAUSED state
Packit f546b1
 * @numpads: number of pads of the element, includes both source and sink pads.
Packit f546b1
 * @pads: (element-type Gst.Pad): list of pads
Packit f546b1
 * @numsrcpads: number of source pads of the element.
Packit f546b1
 * @srcpads: (element-type Gst.Pad): list of source pads
Packit f546b1
 * @numsinkpads: number of sink pads of the element.
Packit f546b1
 * @sinkpads: (element-type Gst.Pad): list of sink pads
Packit f546b1
 * @pads_cookie: updated whenever the a pad is added or removed
Packit f546b1
 * @contexts: (element-type Gst.Context): list of contexts
Packit f546b1
 *
Packit f546b1
 * GStreamer element abstract base class.
Packit f546b1
 */
Packit f546b1
struct _GstElement
Packit f546b1
{
Packit f546b1
  GstObject             object;
Packit f546b1
Packit f546b1
  /*< public >*/ /* with LOCK */
Packit f546b1
  GRecMutex             state_lock;
Packit f546b1
Packit f546b1
  /* element state */
Packit f546b1
  GCond                 state_cond;
Packit f546b1
  guint32               state_cookie;
Packit f546b1
  GstState              target_state;
Packit f546b1
  GstState              current_state;
Packit f546b1
  GstState              next_state;
Packit f546b1
  GstState              pending_state;
Packit f546b1
  GstStateChangeReturn  last_return;
Packit f546b1
Packit f546b1
  GstBus               *bus;
Packit f546b1
Packit f546b1
  /* allocated clock */
Packit f546b1
  GstClock             *clock;
Packit f546b1
  GstClockTimeDiff      base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */
Packit f546b1
  GstClockTime          start_time;
Packit f546b1
Packit f546b1
  /* element pads, these lists can only be iterated while holding
Packit f546b1
   * the LOCK or checking the cookie after each LOCK. */
Packit f546b1
  guint16               numpads;
Packit f546b1
  GList                *pads;
Packit f546b1
  guint16               numsrcpads;
Packit f546b1
  GList                *srcpads;
Packit f546b1
  guint16               numsinkpads;
Packit f546b1
  GList                *sinkpads;
Packit f546b1
  guint32               pads_cookie;
Packit f546b1
Packit f546b1
  /* with object LOCK */
Packit f546b1
  GList                *contexts;
Packit f546b1
Packit f546b1
  /*< private >*/
Packit f546b1
  gpointer _gst_reserved[GST_PADDING-1];
Packit f546b1
};
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstElementClass:
Packit f546b1
 * @parent_class: the parent class structure
Packit f546b1
 * @metadata: metadata for elements of this class
Packit f546b1
 * @elementfactory: the #GstElementFactory that creates these elements
Packit f546b1
 * @padtemplates: a #GList of #GstPadTemplate
Packit f546b1
 * @numpadtemplates: the number of padtemplates
Packit f546b1
 * @pad_templ_cookie: changed whenever the padtemplates change
Packit f546b1
 * @request_new_pad: called when a new pad is requested
Packit f546b1
 * @release_pad: called when a request pad is to be released
Packit f546b1
 * @get_state: get the state of the element
Packit f546b1
 * @set_state: set a new state on the element
Packit f546b1
 * @change_state: called by @set_state to perform an incremental state change
Packit f546b1
 * @set_bus: set a #GstBus on the element
Packit f546b1
 * @provide_clock: gets the #GstClock provided by the element
Packit f546b1
 * @set_clock: set the #GstClock on the element
Packit f546b1
 * @send_event: send a #GstEvent to the element
Packit f546b1
 * @query: perform a #GstQuery on the element
Packit f546b1
 * @state_changed: called immediately after a new state was set.
Packit f546b1
 * @post_message: called when a message is posted on the element. Chain up to
Packit f546b1
 *                the parent class' handler to have it posted on the bus.
Packit f546b1
 * @set_context: set a #GstContext on the element
Packit f546b1
 *
Packit f546b1
 * GStreamer element class. Override the vmethods to implement the element
Packit f546b1
 * functionality.
Packit f546b1
 */
Packit f546b1
struct _GstElementClass
Packit f546b1
{
Packit f546b1
  GstObjectClass         parent_class;
Packit f546b1
Packit f546b1
  /*< public >*/
Packit f546b1
  /* the element metadata */
Packit f546b1
  gpointer		 metadata;
Packit f546b1
Packit f546b1
  /* factory that the element was created from */
Packit f546b1
  GstElementFactory     *elementfactory;
Packit f546b1
Packit f546b1
  /* templates for our pads */
Packit f546b1
  GList                 *padtemplates;
Packit f546b1
  gint                   numpadtemplates;
Packit f546b1
  guint32                pad_templ_cookie;
Packit f546b1
Packit f546b1
  /*< private >*/
Packit f546b1
  /* signal callbacks */
Packit f546b1
  void (*pad_added)     (GstElement *element, GstPad *pad);
Packit f546b1
  void (*pad_removed)   (GstElement *element, GstPad *pad);
Packit f546b1
  void (*no_more_pads)  (GstElement *element);
Packit f546b1
Packit f546b1
  /*< public >*/
Packit f546b1
  /* virtual methods for subclasses */
Packit f546b1
Packit f546b1
  /* request/release pads */
Packit f546b1
  /* FIXME 2.0 harmonize naming with gst_element_request_pad */
Packit f546b1
  GstPad*               (*request_new_pad)      (GstElement *element, GstPadTemplate *templ,
Packit f546b1
                                                 const gchar* name, const GstCaps *caps);
Packit f546b1
Packit f546b1
  void                  (*release_pad)          (GstElement *element, GstPad *pad);
Packit f546b1
Packit f546b1
  /* state changes */
Packit f546b1
  GstStateChangeReturn (*get_state)             (GstElement * element, GstState * state,
Packit f546b1
                                                 GstState * pending, GstClockTime timeout);
Packit f546b1
  GstStateChangeReturn (*set_state)             (GstElement *element, GstState state);
Packit f546b1
  GstStateChangeReturn (*change_state)          (GstElement *element, GstStateChange transition);
Packit f546b1
  void                 (*state_changed)         (GstElement *element, GstState oldstate,
Packit f546b1
                                                 GstState newstate, GstState pending);
Packit f546b1
Packit f546b1
  /* bus */
Packit f546b1
  void                  (*set_bus)              (GstElement * element, GstBus * bus);
Packit f546b1
Packit f546b1
  /* set/get clocks */
Packit f546b1
  GstClock*             (*provide_clock)        (GstElement *element);
Packit f546b1
  gboolean              (*set_clock)            (GstElement *element, GstClock *clock);
Packit f546b1
Packit f546b1
  /* query functions */
Packit f546b1
  gboolean              (*send_event)           (GstElement *element, GstEvent *event);
Packit f546b1
Packit f546b1
  gboolean              (*query)                (GstElement *element, GstQuery *query);
Packit f546b1
Packit f546b1
  gboolean              (*post_message)         (GstElement *element, GstMessage *message);
Packit f546b1
Packit f546b1
  void                  (*set_context)          (GstElement *element, GstContext *context);
Packit f546b1
Packit f546b1
  /*< private >*/
Packit f546b1
  gpointer _gst_reserved[GST_PADDING_LARGE-2];
Packit f546b1
};
Packit f546b1
Packit f546b1
/* element class pad templates */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_class_add_pad_template      (GstElementClass *klass, GstPadTemplate *templ);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_class_add_static_pad_template (GstElementClass *klass, GstStaticPadTemplate *static_templ);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_class_add_static_pad_template_with_gtype (GstElementClass *klass,
Packit f546b1
                                                                              GstStaticPadTemplate *static_templ,
Packit f546b1
                                                                              GType pad_type);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstPadTemplate*         gst_element_class_get_pad_template      (GstElementClass *element_class, const gchar *name);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GList*                  gst_element_class_get_pad_template_list (GstElementClass *element_class);
Packit f546b1
Packit f546b1
/* element class meta data */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_class_set_metadata          (GstElementClass *klass,
Packit f546b1
                                                                 const gchar     *longname,
Packit f546b1
                                                                 const gchar     *classification,
Packit f546b1
                                                                 const gchar     *description,
Packit f546b1
                                                                 const gchar     *author);
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_class_set_static_metadata   (GstElementClass *klass,
Packit f546b1
                                                                 const gchar     *longname,
Packit f546b1
                                                                 const gchar     *classification,
Packit f546b1
                                                                 const gchar     *description,
Packit f546b1
                                                                 const gchar     *author);
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_class_add_metadata          (GstElementClass * klass,
Packit f546b1
                                                                 const gchar * key, const gchar * value);
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_class_add_static_metadata   (GstElementClass * klass,
Packit f546b1
                                                                 const gchar * key, const gchar * value);
Packit f546b1
GST_API
Packit f546b1
const gchar *           gst_element_class_get_metadata          (GstElementClass * klass,
Packit f546b1
                                                                 const gchar * key);
Packit f546b1
Packit f546b1
Packit f546b1
/* element instance */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GType                   gst_element_get_type            (void);
Packit f546b1
Packit f546b1
/* basic name and parentage stuff from GstObject */
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * gst_element_get_name:
Packit f546b1
 * @elem: a #GstElement to get the name of @elem.
Packit f546b1
 *
Packit f546b1
 * Returns a copy of the name of @elem.
Packit f546b1
 * Caller should g_free() the return value after usage.
Packit f546b1
 * For a nameless element, this returns %NULL, which you can safely g_free()
Packit f546b1
 * as well.
Packit f546b1
 *
Packit f546b1
 * Returns: (transfer full) (nullable): the name of @elem. g_free()
Packit f546b1
 * after usage. MT safe.
Packit f546b1
 *
Packit f546b1
 */
Packit f546b1
#define                 gst_element_get_name(elem)      gst_object_get_name(GST_OBJECT_CAST(elem))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * gst_element_set_name:
Packit f546b1
 * @elem: a #GstElement to set the name of.
Packit f546b1
 * @name: the new name
Packit f546b1
 *
Packit f546b1
 * Sets the name of the element, getting rid of the old name if there was one.
Packit f546b1
 */
Packit f546b1
#define                 gst_element_set_name(elem,name) gst_object_set_name(GST_OBJECT_CAST(elem),name)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * gst_element_get_parent:
Packit f546b1
 * @elem: a #GstElement to get the parent of.
Packit f546b1
 *
Packit f546b1
 * Get the parent of an element.
Packit f546b1
 *
Packit f546b1
 * Returns: (transfer full): the parent of an element.
Packit f546b1
 */
Packit f546b1
#define                 gst_element_get_parent(elem)    gst_object_get_parent(GST_OBJECT_CAST(elem))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * gst_element_set_parent:
Packit f546b1
 * @elem: a #GstElement to set the parent of.
Packit f546b1
 * @parent: the new parent #GstObject of the element.
Packit f546b1
 *
Packit f546b1
 * Sets the parent of an element.
Packit f546b1
 */
Packit f546b1
#define                 gst_element_set_parent(elem,parent)     gst_object_set_parent(GST_OBJECT_CAST(elem),parent)
Packit f546b1
Packit f546b1
/* clocking */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstClock*               gst_element_provide_clock       (GstElement *element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstClock*               gst_element_get_clock           (GstElement *element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_set_clock           (GstElement *element, GstClock *clock);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_set_base_time       (GstElement *element, GstClockTime time);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstClockTime            gst_element_get_base_time       (GstElement *element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_set_start_time      (GstElement *element, GstClockTime time);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstClockTime            gst_element_get_start_time      (GstElement *element);
Packit f546b1
Packit f546b1
/* bus */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_set_bus             (GstElement * element, GstBus * bus);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstBus *                gst_element_get_bus             (GstElement * element);
Packit f546b1
Packit f546b1
/* context */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_set_context         (GstElement * element, GstContext * context);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GList *                 gst_element_get_contexts        (GstElement * element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstContext *            gst_element_get_context         (GstElement * element, const gchar * context_type);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstContext *            gst_element_get_context_unlocked (GstElement * element, const gchar * context_type);
Packit f546b1
Packit f546b1
/* pad management */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_add_pad             (GstElement *element, GstPad *pad);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_remove_pad          (GstElement *element, GstPad *pad);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_no_more_pads        (GstElement *element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstPad*                 gst_element_get_static_pad      (GstElement *element, const gchar *name);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstPad*                 gst_element_get_request_pad     (GstElement *element, const gchar *name);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstPad*                 gst_element_request_pad         (GstElement *element, GstPadTemplate *templ,
Packit f546b1
							 const gchar * name, const GstCaps *caps);
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_release_request_pad (GstElement *element, GstPad *pad);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstIterator *           gst_element_iterate_pads        (GstElement * element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstIterator *           gst_element_iterate_src_pads    (GstElement * element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstIterator *           gst_element_iterate_sink_pads   (GstElement * element);
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstElementForeachPadFunc:
Packit f546b1
 * @element: the #GstElement
Packit f546b1
 * @pad: a #GstPad
Packit f546b1
 * @user_data: user data passed to the foreach function
Packit f546b1
 *
Packit f546b1
 * Function called for each pad when using gst_element_foreach_sink_pad(),
Packit f546b1
 * gst_element_foreach_src_pad(), or gst_element_foreach_pad().
Packit f546b1
 *
Packit f546b1
 * Returns: %FALSE to stop iterating pads, %TRUE to continue
Packit f546b1
 *
Packit f546b1
 * Since: 1.14
Packit f546b1
 */
Packit f546b1
typedef gboolean (*GstElementForeachPadFunc) (GstElement * element,
Packit f546b1
                                              GstPad     * pad,
Packit f546b1
                                              gpointer     user_data);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_foreach_sink_pad    (GstElement * element,
Packit f546b1
                                                         GstElementForeachPadFunc func,
Packit f546b1
                                                         gpointer     user_data);
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_foreach_src_pad     (GstElement * element,
Packit f546b1
                                                         GstElementForeachPadFunc func,
Packit f546b1
                                                         gpointer     user_data);
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_foreach_pad         (GstElement * element,
Packit f546b1
                                                         GstElementForeachPadFunc func,
Packit f546b1
                                                         gpointer     user_data);
Packit f546b1
/* event/query/format stuff */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_send_event          (GstElement *element, GstEvent *event);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_seek                (GstElement *element, gdouble rate,
Packit f546b1
                                                         GstFormat format, GstSeekFlags flags,
Packit f546b1
                                                         GstSeekType start_type, gint64 start,
Packit f546b1
                                                         GstSeekType stop_type, gint64 stop);
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_query               (GstElement *element, GstQuery *query);
Packit f546b1
Packit f546b1
/* messages */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_post_message        (GstElement * element, GstMessage * message);
Packit f546b1
Packit f546b1
/* error handling */
Packit f546b1
/* gcc versions < 3.3 warn about NULL being passed as format to printf */
Packit f546b1
#if (!defined(__GNUC__) || (__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 3))
Packit f546b1
GST_API
Packit f546b1
gchar *                 _gst_element_error_printf       (const gchar *format, ...);
Packit f546b1
#else
Packit f546b1
GST_API
Packit f546b1
gchar *                 _gst_element_error_printf       (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
Packit f546b1
#endif
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_message_full        (GstElement * element, GstMessageType type,
Packit f546b1
                                                         GQuark domain, gint code, gchar * text,
Packit f546b1
                                                         gchar * debug, const gchar * file,
Packit f546b1
                                                         const gchar * function, gint line);
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_message_full_with_details (GstElement * element, GstMessageType type,
Packit f546b1
                                                         GQuark domain, gint code, gchar * text,
Packit f546b1
                                                         gchar * debug, const gchar * file,
Packit f546b1
                                                         const gchar * function, gint line,
Packit f546b1
                                                         GstStructure * structure);
Packit f546b1
Packit f546b1
/* state management */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_is_locked_state     (GstElement *element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_set_locked_state    (GstElement *element, gboolean locked_state);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gboolean                gst_element_sync_state_with_parent (GstElement *element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstStateChangeReturn    gst_element_get_state           (GstElement * element,
Packit f546b1
                                                         GstState * state,
Packit f546b1
                                                         GstState * pending,
Packit f546b1
                                                         GstClockTime timeout);
Packit f546b1
GST_API
Packit f546b1
GstStateChangeReturn    gst_element_set_state           (GstElement *element, GstState state);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_abort_state         (GstElement * element);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstStateChangeReturn    gst_element_change_state        (GstElement * element,
Packit f546b1
                                                         GstStateChange transition);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstStateChangeReturn    gst_element_continue_state      (GstElement * element,
Packit f546b1
                                                         GstStateChangeReturn ret);
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_lost_state          (GstElement * element);
Packit f546b1
Packit f546b1
Packit f546b1
typedef void          (*GstElementCallAsyncFunc)        (GstElement * element,
Packit f546b1
                                                         gpointer     user_data);
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_call_async          (GstElement * element,
Packit f546b1
                                                         GstElementCallAsyncFunc func, gpointer user_data,
Packit f546b1
                                                         GDestroyNotify destroy_notify);
Packit f546b1
Packit f546b1
/* factory management */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstElementFactory*      gst_element_get_factory         (GstElement *element);
Packit f546b1
Packit f546b1
/* utility functions */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
gulong                  gst_element_add_property_notify_watch (GstElement  * element,
Packit f546b1
                                                               const gchar * property_name,
Packit f546b1
                                                               gboolean      include_value);
Packit f546b1
GST_API
Packit f546b1
gulong                  gst_element_add_property_deep_notify_watch (GstElement  * element,
Packit f546b1
                                                                    const gchar * property_name,
Packit f546b1
                                                                    gboolean      include_value);
Packit f546b1
GST_API
Packit f546b1
void                    gst_element_remove_property_notify_watch (GstElement * element,
Packit f546b1
                                                                  gulong       watch_id);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstPadTemplate*         gst_element_get_pad_template           (GstElement *element, const gchar *name);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GList*                  gst_element_get_pad_template_list      (GstElement *element);
Packit f546b1
GST_API
Packit f546b1
const gchar *           gst_element_get_metadata               (GstElement * element, const gchar * key);
Packit f546b1
Packit f546b1
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
Packit f546b1
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstElement, gst_object_unref)
Packit f546b1
#endif
Packit f546b1
Packit f546b1
G_END_DECLS
Packit f546b1
Packit f546b1
#endif /* __GST_ELEMENT_H__ */