Class Element

java.lang.Object
All Implemented Interfaces:
Proxy
Direct Known Subclasses:
Aggregator, AudioDecoder, AudioEncoder, BaseParse, BaseSink, BaseSrc, BaseTransform, Bin, Element.ElementImpl, TagSetter.TagSetterImpl, TocSetter.TocSetterImpl, VideoDecoder, VideoEncoder

@Generated("io.github.jwharm.JavaGI") public abstract class Element extends GstObject
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_add_pad() and gst_element_remove_pad().

An existing pad of an element can be retrieved by name with gst_element_get_static_pad(). A new dynamic pad can be created using gst_element_request_pad() with a GstPadTemplate. An iterator of all pads can be retrieved with gst_element_iterate_pads().

Elements can be linked through their pads. If the link is straightforward, use the gst_element_link() convenience function to link two elements, or gst_element_link_many() for more elements in a row. Use gst_element_link_filtered() to link two elements constrained by a specified set of GstCaps. For finer control, use gst_element_link_pads() and gst_element_link_pads_filtered() 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_get_state() and gst_element_set_state(). Setting a state triggers a GstStateChange. To get a string representation of a GstState, use gst_element_state_get_name().

You can get and set a GstClock on an element using gst_element_get_clock() and gst_element_set_clock(). Some elements can provide a clock for the pipeline if the GST_ELEMENT_FLAG_PROVIDE_CLOCK flag is set. With the gst_element_provide_clock() 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_set_clock().

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.