| 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 |
GI.Gst.Objects.ElementFactory
Contents
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 elementFactoryFind and elementFactoryCreate
functions to create element instances or use elementFactoryMake as a
convenient shortcut.
The following code example shows you how to create a GstFileSrc element.
Using an element factory
C code
#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);
...Synopsis
- newtype ElementFactory = ElementFactory (ManagedPtr ElementFactory)
- class (GObject o, IsDescendantOf ElementFactory o) => IsElementFactory o
- toElementFactory :: (MonadIO m, IsElementFactory o) => o -> m ElementFactory
- noElementFactory :: Maybe ElementFactory
- elementFactoryCanSinkAllCaps :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Caps -> m Bool
- elementFactoryCanSinkAnyCaps :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Caps -> m Bool
- elementFactoryCanSrcAllCaps :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Caps -> m Bool
- elementFactoryCanSrcAnyCaps :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Caps -> m Bool
- elementFactoryCreate :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Maybe Text -> m (Maybe Element)
- elementFactoryFind :: (HasCallStack, MonadIO m) => Text -> m (Maybe ElementFactory)
- elementFactoryGetElementType :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m GType
- elementFactoryGetMetadata :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Text -> m (Maybe Text)
- elementFactoryGetMetadataKeys :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m (Maybe [Text])
- elementFactoryGetNumPadTemplates :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m Word32
- elementFactoryGetStaticPadTemplates :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m [StaticPadTemplate]
- elementFactoryGetUriProtocols :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m [Text]
- elementFactoryGetUriType :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m URIType
- elementFactoryHasInterface :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Text -> m Bool
- elementFactoryListFilter :: (HasCallStack, MonadIO m, IsElementFactory a) => [a] -> Caps -> PadDirection -> Bool -> m [ElementFactory]
- elementFactoryListGetElements :: (HasCallStack, MonadIO m) => Word64 -> Rank -> m [ElementFactory]
- elementFactoryListIsType :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Word64 -> m Bool
- elementFactoryMake :: (HasCallStack, MonadIO m) => Text -> Maybe Text -> m (Maybe Element)
Exported types
newtype ElementFactory Source #
Memory-managed wrapper type.
Constructors
| ElementFactory (ManagedPtr ElementFactory) |
Instances
| GObject ElementFactory Source # | |
Defined in GI.Gst.Objects.ElementFactory Methods gobjectType :: IO GType # | |
| HasParentTypes ElementFactory Source # | |
Defined in GI.Gst.Objects.ElementFactory | |
| type ParentTypes ElementFactory Source # | |
Defined in GI.Gst.Objects.ElementFactory | |
class (GObject o, IsDescendantOf ElementFactory o) => IsElementFactory o Source #
Type class for types which can be safely cast to ElementFactory, for instance with toElementFactory.
Instances
| (GObject o, IsDescendantOf ElementFactory o) => IsElementFactory o Source # | |
Defined in GI.Gst.Objects.ElementFactory | |
toElementFactory :: (MonadIO m, IsElementFactory o) => o -> m ElementFactory Source #
Cast to ElementFactory, for types for which this is known to be safe. For general casts, use castTo.
noElementFactory :: Maybe ElementFactory Source #
A convenience alias for Nothing :: Maybe ElementFactory.
Methods
canSinkAllCaps
elementFactoryCanSinkAllCaps Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Caps |
|
| -> m Bool | Returns: |
Checks if the factory can sink all possible capabilities.
canSinkAnyCaps
elementFactoryCanSinkAnyCaps Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Caps |
|
| -> m Bool | Returns: |
Checks if the factory can sink any possible capability.
canSrcAllCaps
elementFactoryCanSrcAllCaps Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Caps |
|
| -> m Bool | Returns: |
Checks if the factory can src all possible capabilities.
canSrcAnyCaps
elementFactoryCanSrcAnyCaps Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Caps |
|
| -> m Bool | Returns: |
Checks if the factory can src any possible capability.
create
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Maybe Text |
|
| -> m (Maybe Element) | Returns: new |
Create a new element of the type defined by the given elementfactory. It will be given the name supplied, since all elements require a name as their first argument.
find
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m (Maybe ElementFactory) | Returns: |
Search for an element factory of the given name. Refs the returned element factory; caller is responsible for unreffing.
getElementType
elementFactoryGetElementType Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> m GType | Returns: the |
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 pluginFeatureLoad.
getMetadata
elementFactoryGetMetadata Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Text |
|
| -> m (Maybe Text) | Returns: the metadata with |
Get the metadata on factory with key.
getMetadataKeys
elementFactoryGetMetadataKeys Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> m (Maybe [Text]) | Returns:
a |
Get the available keys for the metadata on factory.
getNumPadTemplates
elementFactoryGetNumPadTemplates Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> m Word32 | Returns: the number of pad_templates |
Gets the number of pad_templates in this factory.
getStaticPadTemplates
elementFactoryGetStaticPadTemplates Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> m [StaticPadTemplate] | Returns: the static pad templates |
Gets the List of StaticPadTemplate for this factory.
getUriProtocols
elementFactoryGetUriProtocols Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> m [Text] | Returns: the supported protocols
or |
getUriType
elementFactoryGetUriType Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> m URIType | Returns: type of URIs this element supports |
Gets the type of URIs the element supports or GST_URI_UNKNOWN if none.
hasInterface
elementFactoryHasInterface Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Text |
|
| -> m Bool | Returns: |
Check if factory implements the interface with name interfacename.
listFilter
elementFactoryListFilter Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => [a] |
|
| -> Caps |
|
| -> PadDirection |
|
| -> Bool |
|
| -> m [ElementFactory] | Returns: a |
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.
listGetElements
elementFactoryListGetElements Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Word64 |
|
| -> Rank |
|
| -> m [ElementFactory] | Returns: a |
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.
listIsType
elementFactoryListIsType Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Word64 |
|
| -> m Bool | Returns: |
Check if factory is of the given types.
make
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> Maybe Text |
|
| -> m (Maybe Element) |
Create a new element of the type defined by the given element factory.
If name is Nothing, 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.