Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
GStreamer is extensible, so Element
instances can be loaded at runtime.
A plugin system can provide one or more of the basic
<application>GStreamer</application> PluginFeature
subclasses.
A plugin should export a symbol <symbol>gst_plugin_desc</symbol> that is a
struct of type PluginDesc
.
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
PluginInitFunc
function that was provided in the
<symbol>gst_plugin_desc</symbol>.
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
pluginLoad
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 pluginLoad
can be needed to bring the plugin
into memory.
Synopsis
- newtype Plugin = Plugin (ManagedPtr Plugin)
- class (GObject o, IsDescendantOf Plugin o) => IsPlugin o
- toPlugin :: (MonadIO m, IsPlugin o) => o -> m Plugin
- noPlugin :: Maybe Plugin
- pluginAddDependency :: (HasCallStack, MonadIO m, IsPlugin a) => a -> Maybe [Text] -> Maybe [Text] -> Maybe [Text] -> [PluginDependencyFlags] -> m ()
- pluginAddDependencySimple :: (HasCallStack, MonadIO m, IsPlugin a) => a -> Maybe Text -> Maybe Text -> Maybe Text -> [PluginDependencyFlags] -> m ()
- pluginGetCacheData :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m (Maybe Structure)
- pluginGetDescription :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m Text
- pluginGetFilename :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m [Char]
- pluginGetLicense :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m Text
- pluginGetName :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m Text
- pluginGetOrigin :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m Text
- pluginGetPackage :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m Text
- pluginGetReleaseDateString :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m (Maybe Text)
- pluginGetSource :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m Text
- pluginGetVersion :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m Text
- pluginIsLoaded :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m Bool
- pluginListFree :: (HasCallStack, MonadIO m, IsPlugin a) => [a] -> m ()
- pluginLoad :: (HasCallStack, MonadIO m, IsPlugin a) => a -> m (Maybe Plugin)
- pluginLoadByName :: (HasCallStack, MonadIO m) => Text -> m (Maybe Plugin)
- pluginLoadFile :: (HasCallStack, MonadIO m) => [Char] -> m Plugin
- pluginRegisterStatic :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Text -> Text -> PluginInitFunc -> Text -> Text -> Text -> Text -> Text -> m Bool
- pluginRegisterStaticFull :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Text -> Text -> PluginInitFullFunc -> Text -> Text -> Text -> Text -> Text -> m Bool
- pluginSetCacheData :: (HasCallStack, MonadIO m, IsPlugin a) => a -> Structure -> m ()
Exported types
Memory-managed wrapper type.
Instances
GObject Plugin Source # | |
Defined in GI.Gst.Objects.Plugin gobjectType :: IO GType # | |
HasParentTypes Plugin Source # | |
Defined in GI.Gst.Objects.Plugin | |
type ParentTypes Plugin Source # | |
Defined in GI.Gst.Objects.Plugin |
class (GObject o, IsDescendantOf Plugin o) => IsPlugin o Source #
Instances
(GObject o, IsDescendantOf Plugin o) => IsPlugin o Source # | |
Defined in GI.Gst.Objects.Plugin |
Methods
addDependency
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> Maybe [Text] |
|
-> Maybe [Text] |
|
-> Maybe [Text] |
|
-> [PluginDependencyFlags] |
|
-> m () |
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.
addDependencySimple
pluginAddDependencySimple Source #
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> [PluginDependencyFlags] |
|
-> m () |
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 pluginAddDependency
which
takes simple strings as arguments instead of string arrays, with multiple
arguments separated by predefined delimiters (see above).
getCacheData
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m (Maybe Structure) |
Gets the plugin specific data cache. If it is Nothing
there is no cached data
stored. This is the case when the registry is getting rebuilt.
getDescription
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m Text | Returns: the long name of the plugin |
Get the long descriptive name of the plugin
getFilename
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m [Char] | Returns: the filename of the plugin |
get the filename of the plugin
getLicense
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m Text | Returns: the license of the plugin |
get the license of the plugin
getName
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m Text | Returns: the name of the plugin |
Get the short name of the plugin
getOrigin
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m Text | Returns: the origin of the plugin |
get the URL where the plugin comes from
getPackage
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m Text | Returns: the package of the plugin |
get the package the plugin belongs to.
getReleaseDateString
pluginGetReleaseDateString Source #
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m (Maybe Text) | Returns: the date string of the plugin, or |
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.
getSource
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m Text | Returns: the source of the plugin |
get the source module the plugin belongs to.
getVersion
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m Text | Returns: the version of the plugin |
get the version of the plugin
isLoaded
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m Bool |
queries if the plugin is loaded into memory
listFree
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> [a] |
|
-> m () |
Unrefs each member of list
, then frees the list.
load
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> m (Maybe Plugin) | Returns: a reference to a loaded plugin, or
|
Loads plugin
. Note that the *return value* is the loaded plugin; plugin
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;
loadByName
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Maybe Plugin) | Returns: a reference to a loaded plugin, or
|
Load the named plugin. Refs the plugin.
loadFile
:: (HasCallStack, MonadIO m) | |
=> [Char] |
|
-> m Plugin | Returns: a reference to the existing loaded GstPlugin, a
reference to the newly-loaded GstPlugin, or |
Loads the given plugin and refs it. Caller needs to unref after use.
registerStatic
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> Text |
|
-> Text |
|
-> PluginInitFunc |
|
-> Text |
|
-> Text |
|
-> Text |
|
-> Text |
|
-> Text |
|
-> m Bool | Returns: |
Registers a static plugin, ie. a plugin which is private to an application or library and contained within the application or library (as opposed to being shipped as a separate module file).
You must make sure that GStreamer has been initialised (with init
or
via gst_init_get_option_group()
) before calling this function.
registerStaticFull
pluginRegisterStaticFull Source #
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> Text |
|
-> Text |
|
-> PluginInitFullFunc |
|
-> Text |
|
-> Text |
|
-> Text |
|
-> Text |
|
-> Text |
|
-> m Bool | Returns: |
Registers a static plugin, ie. a plugin which is private to an application
or library and contained within the application or library (as opposed to
being shipped as a separate module file) with a PluginInitFullFunc
which allows user data to be passed to the callback function (useful
for bindings).
You must make sure that GStreamer has been initialised (with init
or
via gst_init_get_option_group()
) before calling this function.
setCacheData
:: (HasCallStack, MonadIO m, IsPlugin a) | |
=> a |
|
-> Structure |
|
-> m () |
Adds plugin specific data to cache. Passes the ownership of the structure to
the plugin
.
The cache is flushed every time the registry is rebuilt.