Struct gstreamer::Plugin [−][src]
pub struct Plugin(_);
Expand description
GStreamer is extensible, so Element
instances can be loaded at runtime.
A plugin system can provide one or more of the basic GStreamer
PluginFeature
subclasses.
A plugin should export a symbol gst_plugin_desc
that is a
struct of type GstPluginDesc
.
the plugin loader will check the version of the core library the plugin was
linked against and will create a new Plugin
. It will then call the
GstPluginInitFunc
function that was provided in the
gst_plugin_desc
.
Once you have a handle to a Plugin
(e.g. from the Registry
), you
can add any object that subclasses PluginFeature
.
Usually plugins are always automatically loaded so you don’t need to call
load()
explicitly to bring it into memory. There are options to
statically link plugins to an app or even use GStreamer without a plugin
repository in which case load()
can be needed to bring the plugin
into memory.
Implements
Implementations
Make GStreamer aware of external dependencies which affect the feature set of this plugin (ie. the elements or typefinders associated with it).
GStreamer will re-inspect plugins with external dependencies whenever any of the external dependencies change. This is useful for plugins which wrap other plugin systems, e.g. a plugin which wraps a plugin-based visualisation library and makes visualisations available as GStreamer elements, or a codec loader which exposes elements and/or caps dependent on what external codec libraries are currently installed.
env_vars
None
-terminated array of environment variables affecting the
feature set of the plugin (e.g. an environment variable containing
paths where to look for additional modules/plugins of a library),
or None
. Environment variable names may be followed by a path component
which will be added to the content of the environment variable, e.g.
“HOME/.mystuff/plugins”.
paths
None
-terminated array of directories/paths where dependent files
may be, or None
.
names
None
-terminated array of file names (or file name suffixes,
depending on flags
) to be used in combination with the paths from
paths
and/or the paths extracted from the environment variables in
env_vars
, or None
.
flags
optional flags, or GST_PLUGIN_DEPENDENCY_FLAG_NONE
pub fn add_dependency_simple(
&self,
env_vars: Option<&str>,
paths: Option<&str>,
names: Option<&str>,
flags: PluginDependencyFlags
)
[src]
pub fn add_dependency_simple(
&self,
env_vars: Option<&str>,
paths: Option<&str>,
names: Option<&str>,
flags: PluginDependencyFlags
)
[src]Make GStreamer aware of external dependencies which affect the feature set of this plugin (ie. the elements or typefinders associated with it).
GStreamer will re-inspect plugins with external dependencies whenever any of the external dependencies change. This is useful for plugins which wrap other plugin systems, e.g. a plugin which wraps a plugin-based visualisation library and makes visualisations available as GStreamer elements, or a codec loader which exposes elements and/or caps dependent on what external codec libraries are currently installed.
Convenience wrapper function for add_dependency()
which
takes simple strings as arguments instead of string arrays, with multiple
arguments separated by predefined delimiters (see above).
env_vars
one or more environment variables (separated by ‘:’, ‘;’ or ‘,’),
or None
. Environment variable names may be followed by a path component
which will be added to the content of the environment variable, e.g.
“HOME/.mystuff/plugins:MYSTUFF_PLUGINS_PATH”
paths
one ore more directory paths (separated by ‘:’ or ‘;’ or ‘,’),
or None
. Example: “/usr/lib/mystuff/plugins”
names
one or more file names or file name suffixes (separated by commas),
or None
flags
optional flags, or GST_PLUGIN_DEPENDENCY_FLAG_NONE
Get the release date (and possibly time) in form of a string, if available.
For normal GStreamer plugin releases this will usually just be a date in the form of “YYYY-MM-DD”, while pre-releases and builds from git may contain a time component after the date as well, in which case the string will be formatted like “YYYY-MM-DDTHH:MMZ” (e.g. “2012-04-30T09:30Z”).
There may be plugins that do not have a valid release date set on them.
Returns
the date string of the plugin, or None
if not
available.
Loads self
. Note that the return value is the loaded plugin; self
is
untouched. The normal use pattern of this function goes like this:
GstPlugin *loaded_plugin;
loaded_plugin = gst_plugin_load (plugin);
// presumably, we're no longer interested in the potentially-unloaded plugin
gst_object_unref (plugin);
plugin = loaded_plugin;
Returns
a reference to a loaded plugin, or
None
on error.
Adds plugin specific data to cache. Passes the ownership of the structure to
the self
.
The cache is flushed every time the registry is rebuilt.
cache_data
a structure containing the data to cache
Trait Implementations
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
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]