Struct gstreamer::ElementFactory [−][src]
pub struct ElementFactory(_);
Expand description
ElementFactory
is used to create instances of elements. A
GstElementFactory can be added to a Plugin
as it is also a
PluginFeature
.
Use the find()
and create()
functions to create element instances or use make()
as a
convenient shortcut.
The following code example shows you how to create a GstFileSrc element.
Using an element factory
#include <gst/gst.h>
GstElement *src;
GstElementFactory *srcfactory;
gst_init (&argc, &argv);
srcfactory = gst_element_factory_find ("filesrc");
g_return_if_fail (srcfactory != NULL);
src = gst_element_factory_create (srcfactory, "src");
g_return_if_fail (src != NULL);
...
Implements
PluginFeatureExt
, GstObjectExt
, glib::ObjectExt
, PluginFeatureExtManual
Implementations
Get the GType
for elements managed by this factory. The type can
only be retrieved if the element factory is loaded, which can be
assured with PluginFeatureExtManual::load()
.
Returns
the GType
for elements managed by this factory or 0 if
the factory is not loaded.
Gets a None
-terminated array of protocols this element supports or None
if
no protocols are supported. You may not change the contents of the returned
array, as it is still owned by the element factory. Use g_strdupv()
to
make a copy of the protocol string array if you need to.
Returns
the supported protocols
or None
Gets the type of URIs the element supports or URIType::Unknown
if none.
Returns
type of URIs this element supports
Check if self
implements the interface with name interfacename
.
interfacename
an interface name
Returns
true
when self
implement the interface.
Search for an element factory of the given name. Refs the returned element factory; caller is responsible for unreffing.
name
name of factory to find
Returns
ElementFactory
if found,
None
otherwise
pub fn list_filter(
list: &[ElementFactory],
caps: &Caps,
direction: PadDirection,
subsetonly: bool
) -> Vec<ElementFactory>
[src]
pub fn list_filter(
list: &[ElementFactory],
caps: &Caps,
direction: PadDirection,
subsetonly: bool
) -> Vec<ElementFactory>
[src]Filter out all the elementfactories in list
that can handle caps
in
the given direction.
If subsetonly
is true
, then only the elements whose pads templates
are a complete superset of caps
will be returned. Else any element
whose pad templates caps can intersect with caps
will be returned.
list
a GList
of
ElementFactory
to filter
caps
a Caps
direction
a PadDirection
to filter on
subsetonly
whether to filter on caps subsets or not.
Returns
a GList
of
ElementFactory
elements that match the given requisites.
Use gst_plugin_feature_list_free
after usage.
Get a list of factories that match the given type_
. Only elements
with a rank greater or equal to minrank
will be returned.
The list of factories is returned by decreasing rank.
type_
a GstElementFactoryListType
minrank
Minimum rank
Returns
a GList
of
ElementFactory
elements. Use gst_plugin_feature_list_free()
after
usage.
Create a new element of the type defined by the given element factory.
If name is None
, then the element will receive a guaranteed unique name,
consisting of the element factory name and a number.
If name is given, it will be given the name supplied.
factoryname
a named factory to instantiate
name
name of new element, or None
to automatically create
a unique name
Returns
Trait Implementations
type Parent = PluginFeature
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
Returns the type identifier of Self
.
Auto Trait Implementations
impl RefUnwindSafe for ElementFactory
impl Unpin for ElementFactory
impl UnwindSafe for ElementFactory
Blanket Implementations
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
Returns true
if the object is an instance of (can be cast to) T
.
pub fn set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
[src]pub fn set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
[src]pub fn set_property<'a, N, V>(
&self,
property_name: N,
value: V
) -> Result<(), BoolError> where
V: ToValue,
N: Into<&'a str>,
[src]pub fn set_property_from_value<'a, N>(
&self,
property_name: N,
value: &Value
) -> Result<(), BoolError> where
N: Into<&'a str>,
[src]pub fn property<'a, N>(&self, property_name: N) -> Result<Value, BoolError> where
N: Into<&'a str>,
[src]Safety Read more
Safety Read more
Safety Read more
Safety Read more
pub fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
[src]pub fn connect_notify_local<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec),
[src]pub unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
[src]pub fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>,
[src]pub fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>,
[src]pub fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
[src]Same as connect
but takes a SignalId
instead of a signal name.
pub fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
[src]Same as connect_local
but takes a SignalId
instead of a signal name.
pub unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
[src]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.
pub fn bind_property<'a, O, N, M>(
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
N: Into<&'a str>,
M: Into<&'a str>,
[src]Same as emit
but takes Value
for the arguments.
Same as emit_by_name
but takes Value
for the arguments.
Returns a SendValue
clone of self
.
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,
[src]