GstElement

GstElement is the abstract base class needed to construct an element that can be used in a GStreamer pipeline. Please refer to the plugin writers guide for more information on creating #GstElement subclasses.

The name of a #GstElement can be get with gst_element_get_name() and set with gst_element_set_name(). For speed, GST_ELEMENT_NAME() can be used in the core when using the appropriate locking. Do not use this in plug-ins or applications in order to retain ABI compatibility.

Elements can have pads (of the type #GstPad). These pads link to pads on other elements. #GstBuffer flow between these linked pads. A #GstElement has a #GList of #GstPad structures for all their input (or sink) and output (or source) pads. Core and plug-in writers can add and remove pads with gst.element.Element.addPad and gst.element.Element.removePad.

An existing pad of an element can be retrieved by name with gst.element.Element.getStaticPad. A new dynamic pad can be created using gst.element.Element.requestPad with a #GstPadTemplate. An iterator of all pads can be retrieved with gst.element.Element.iteratePads.

Elements can be linked through their pads. If the link is straightforward, use the gst.element.Element.link convenience function to link two elements, or gst.element.Element.linkMany for more elements in a row. Use gst.element.Element.linkFiltered to link two elements constrained by a specified set of #GstCaps. For finer control, use gst.element.Element.linkPads and gst.element.Element.linkPadsFiltered to specify the pads to link on each element by name.

Each element has a state (see #GstState). You can get and set the state of an element with gst.element.Element.getState and gst.element.Element.setState. Setting a state triggers a #GstStateChange. To get a string representation of a #GstState, use gst.element.Element.stateGetName.

You can get and set a #GstClock on an element using gst.element.Element.getClock and gst.element.Element.setClock. Some elements can provide a clock for the pipeline if the #GST_ELEMENT_FLAG_PROVIDE_CLOCK flag is set. With the gst.element.Element.provideClock method one can retrieve the clock provided by such an element. Not all elements require a clock to operate correctly. If the #GST_ELEMENT_FLAG_REQUIRE_CLOCK() flag is set, a clock should be set on the element with gst.element.Element.setClock.

Note that clock selection and distribution is normally handled by the toplevel #GstPipeline so the clock functions are only to be used in very specific situations.

Members

Variables

GstReserved
void*[3] GstReserved;
baseTime
GstClockTimeDiff baseTime;

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.

bus
GstBus* 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
GstClock* clock;

the clock of the element. This clock is usually provided to the element by the toplevel #GstPipeline.

contexts
GList* contexts;

list of contexts

currentState
GstState currentState;

the current state of an element

lastReturn
GstStateChangeReturn lastReturn;

the last return value of an element state change

nextState
GstState nextState;

the next state of an element, can be #GST_STATE_VOID_PENDING if the element is in the correct state.

numpads
ushort numpads;

number of pads of the element, includes both source and sink pads.

numsinkpads
ushort numsinkpads;

number of sink pads of the element.

numsrcpads
ushort numsrcpads;

number of source pads of the element.

object
GstObject object;
pads
GList* pads;

list of pads

padsCookie
uint padsCookie;

updated whenever the a pad is added or removed

pendingState
GstState pendingState;

the final state the element should go to, can be #GST_STATE_VOID_PENDING if the element is in the correct state

sinkpads
GList* sinkpads;

list of sink pads

srcpads
GList* srcpads;

list of source pads

startTime
GstClockTime startTime;

the running_time of the last PAUSED state

stateCond
GCond stateCond;

Used to signal completion of a state change

stateCookie
uint stateCookie;

Used to detect concurrent execution of gst.element.Element.setState and gst.element.Element.getState

stateLock
GRecMutex stateLock;

Used to serialize execution of gst.element.Element.setState

targetState
GstState targetState;

the target state of an element as set by the application