| Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| 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.
<example>
<title>Using an element factory</title>
<programlisting language="c">
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); ... </programlisting> </example>
- newtype ElementFactory = ElementFactory (ManagedPtr ElementFactory)
- class GObject o => IsElementFactory o
- toElementFactory :: IsElementFactory o => o -> IO ElementFactory
- noElementFactory :: Maybe ElementFactory
- data ElementFactoryCanSinkAllCapsMethodInfo
- elementFactoryCanSinkAllCaps :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Caps -> m Bool
- data ElementFactoryCanSinkAnyCapsMethodInfo
- elementFactoryCanSinkAnyCaps :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Caps -> m Bool
- data ElementFactoryCanSrcAllCapsMethodInfo
- elementFactoryCanSrcAllCaps :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Caps -> m Bool
- data ElementFactoryCanSrcAnyCapsMethodInfo
- elementFactoryCanSrcAnyCaps :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Caps -> m Bool
- data ElementFactoryCreateMethodInfo
- elementFactoryCreate :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Maybe Text -> m (Maybe Element)
- elementFactoryFind :: (HasCallStack, MonadIO m) => Text -> m (Maybe ElementFactory)
- data ElementFactoryGetElementTypeMethodInfo
- elementFactoryGetElementType :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m GType
- data ElementFactoryGetMetadataMethodInfo
- elementFactoryGetMetadata :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Text -> m (Maybe Text)
- data ElementFactoryGetMetadataKeysMethodInfo
- elementFactoryGetMetadataKeys :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m (Maybe [Text])
- data ElementFactoryGetNumPadTemplatesMethodInfo
- elementFactoryGetNumPadTemplates :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m Word32
- data ElementFactoryGetStaticPadTemplatesMethodInfo
- elementFactoryGetStaticPadTemplates :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m [StaticPadTemplate]
- data ElementFactoryGetUriProtocolsMethodInfo
- elementFactoryGetUriProtocols :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m [Text]
- data ElementFactoryGetUriTypeMethodInfo
- elementFactoryGetUriType :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m URIType
- data ElementFactoryHasInterfaceMethodInfo
- 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]
- data ElementFactoryListIsTypeMethodInfo
- 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 #
Constructors
| ElementFactory (ManagedPtr ElementFactory) |
Instances
| GObject ElementFactory Source # | |
| IsObject ElementFactory Source # | |
| IsPluginFeature ElementFactory Source # | |
| IsObject ElementFactory Source # | |
| IsElementFactory ElementFactory Source # | |
| ((~) * info (ResolveElementFactoryMethod t ElementFactory), MethodInfo * info ElementFactory p) => IsLabel t (ElementFactory -> p) Source # | |
| ((~) * info (ResolveElementFactoryMethod t ElementFactory), MethodInfo * info ElementFactory p) => IsLabelProxy t (ElementFactory -> p) Source # | |
| HasAttributeList * ElementFactory Source # | |
| type AttributeList ElementFactory Source # | |
| type SignalList ElementFactory Source # | |
class GObject o => IsElementFactory o Source #
Instances
toElementFactory :: IsElementFactory o => o -> IO ElementFactory Source #
Methods
canSinkAllCaps
data ElementFactoryCanSinkAllCapsMethodInfo Source #
Instances
| ((~) * signature (Caps -> m Bool), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryCanSinkAllCapsMethodInfo a signature Source # | |
elementFactoryCanSinkAllCaps Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Caps |
|
| -> m Bool | Returns: |
Checks if the factory can sink all possible capabilities.
canSinkAnyCaps
data ElementFactoryCanSinkAnyCapsMethodInfo Source #
Instances
| ((~) * signature (Caps -> m Bool), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryCanSinkAnyCapsMethodInfo a signature Source # | |
elementFactoryCanSinkAnyCaps Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Caps |
|
| -> m Bool | Returns: |
Checks if the factory can sink any possible capability.
canSrcAllCaps
data ElementFactoryCanSrcAllCapsMethodInfo Source #
Instances
| ((~) * signature (Caps -> m Bool), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryCanSrcAllCapsMethodInfo a signature Source # | |
elementFactoryCanSrcAllCaps Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Caps |
|
| -> m Bool | Returns: |
Checks if the factory can src all possible capabilities.
canSrcAnyCaps
data ElementFactoryCanSrcAnyCapsMethodInfo Source #
Instances
| ((~) * signature (Caps -> m Bool), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryCanSrcAnyCapsMethodInfo a signature Source # | |
elementFactoryCanSrcAnyCaps Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> Caps |
|
| -> m Bool | Returns: |
Checks if the factory can src any possible capability.
create
data ElementFactoryCreateMethodInfo Source #
Instances
| ((~) * signature (Maybe Text -> m (Maybe Element)), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryCreateMethodInfo a signature Source # | |
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
data ElementFactoryGetElementTypeMethodInfo Source #
Instances
| ((~) * signature (m GType), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryGetElementTypeMethodInfo a signature Source # | |
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
data ElementFactoryGetMetadataMethodInfo Source #
Instances
| ((~) * signature (Text -> m (Maybe Text)), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryGetMetadataMethodInfo a signature Source # | |
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
data ElementFactoryGetMetadataKeysMethodInfo Source #
Instances
| ((~) * signature (m (Maybe [Text])), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryGetMetadataKeysMethodInfo a signature Source # | |
elementFactoryGetMetadataKeys Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> m (Maybe [Text]) | Returns:
a |
Get the available keys for the metadata on factory.
getNumPadTemplates
data ElementFactoryGetNumPadTemplatesMethodInfo Source #
Instances
| ((~) * signature (m Word32), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryGetNumPadTemplatesMethodInfo a signature Source # | |
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
data ElementFactoryGetStaticPadTemplatesMethodInfo Source #
Instances
| ((~) * signature (m [StaticPadTemplate]), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryGetStaticPadTemplatesMethodInfo a signature Source # | |
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
data ElementFactoryGetUriProtocolsMethodInfo Source #
Instances
| ((~) * signature (m [Text]), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryGetUriProtocolsMethodInfo a signature Source # | |
elementFactoryGetUriProtocols Source #
Arguments
| :: (HasCallStack, MonadIO m, IsElementFactory a) | |
| => a |
|
| -> m [Text] | Returns: the supported protocols
or |
getUriType
data ElementFactoryGetUriTypeMethodInfo Source #
Instances
| ((~) * signature (m URIType), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryGetUriTypeMethodInfo a signature Source # | |
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
data ElementFactoryHasInterfaceMethodInfo Source #
Instances
| ((~) * signature (Text -> m Bool), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryHasInterfaceMethodInfo a signature Source # | |
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
data ElementFactoryListIsTypeMethodInfo Source #
Instances
| ((~) * signature (Word64 -> m Bool), MonadIO m, IsElementFactory a) => MethodInfo * ElementFactoryListIsTypeMethodInfo a signature Source # | |
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.