Struct gstreamer::Element[][src]

pub struct Element(_);
Expand description

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 Element subclasses.

The name of a Element 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 Pad). These pads link to pads on other elements. Buffer flow between these linked pads. A Element has a GList of Pad structures for all their input (or sink) and output (or source) pads. Core and plug-in writers can add and remove pads with ElementExt::add_pad() and ElementExt::remove_pad().

An existing pad of an element can be retrieved by name with ElementExt::static_pad(). A new dynamic pad can be created using ElementExt::request_pad() with a PadTemplate. An iterator of all pads can be retrieved with ElementExtManual::iterate_pads().

Elements can be linked through their pads. If the link is straightforward, use the ElementExt::link() convenience function to link two elements, or gst_element_link_many() for more elements in a row. Use ElementExt::link_filtered() to link two elements constrained by a specified set of Caps. For finer control, use ElementExt::link_pads() and ElementExt::link_pads_filtered() to specify the pads to link on each element by name.

Each element has a state (see State). You can get and set the state of an element with ElementExt::state() and ElementExt::set_state(). Setting a state triggers a StateChange. To get a string representation of a State, use gst_element_state_get_name().

You can get and set a Clock on an element using ElementExt::clock() and ElementExt::set_clock(). Some elements can provide a clock for the pipeline if the ElementFlags::PROVIDE_CLOCK flag is set. With the ElementExt::provide_clock() method one can retrieve the clock provided by such an element. Not all elements require a clock to operate correctly. If the ElementFlags::REQUIRE_CLOCK() flag is set, a clock should be set on the element with ElementExt::set_clock().

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

This is an Abstract Base Class, you cannot instantiate it.

Implements

ElementExt, GstObjectExt, glib::ObjectExt, ElementExtManual

Implementations

Creates an element for handling the given URI.

type_

Whether to create a source or a sink

uri

URI to create an element for

elementname

Name of created element, can be None.

Returns

a new element or None if none could be created

Create a new elementfactory capable of instantiating objects of the type_ and add the factory to plugin.

plugin

Plugin to register the element with, or None for a static element.

name

name of elements of this type

rank

rank of element (higher rank means more importance when autoplugging)

type_

GType of element to register

Returns

true, if the registering succeeded, false on error

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Override the virtual methods of this class for the given subclass and do other class initialization. Read more

Instance specific initialization. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Upcasts an object to a superclass or interface T. Read more

Upcasts an object to a reference of its superclass or interface T. Read more

Tries to downcast to a subclass or interface implementor T. Read more

Tries to downcast to a reference of its subclass or interface implementor T. Read more

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

Casts to T unconditionally. Read more

Casts to &T unconditionally. Read more

Performs the conversion.

Performs the conversion.

Returns true if the object is an instance of (can be cast to) T.

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Same as connect but takes a SignalId instead of a signal name.

Same as connect_local but takes a SignalId instead of a signal name.

Same as connect_unsafe but takes a SignalId instead of a signal name.

Emit signal by signal id.

Emit signal with details by signal id.

Emit signal by it’s name.

Same as emit but takes Value for the arguments.

Same as emit_by_name but takes Value for the arguments.

Same as emit_with_details but takes Value for the arguments.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Returns a SendValue clone of self.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.