Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- 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)
- elementFactoryCreateWithProperties :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> Maybe [Text] -> Maybe [GValue] -> 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
- elementFactoryGetSkipDocumentation :: (HasCallStack, MonadIO m, IsElementFactory a) => a -> m Bool
- 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)
- elementFactoryMakeWithProperties :: (HasCallStack, MonadIO m) => Text -> Maybe [Text] -> Maybe [GValue] -> m (Maybe Element)
Exported types
newtype ElementFactory Source #
Memory-managed wrapper type.
ElementFactory (ManagedPtr ElementFactory) |
Instances
Eq ElementFactory Source # | |
Defined in GI.Gst.Objects.ElementFactory (==) :: ElementFactory -> ElementFactory -> Bool # (/=) :: ElementFactory -> ElementFactory -> Bool # | |
GObject ElementFactory Source # | |
Defined in GI.Gst.Objects.ElementFactory | |
ManagedPtrNewtype ElementFactory Source # | |
Defined in GI.Gst.Objects.ElementFactory toManagedPtr :: ElementFactory -> ManagedPtr ElementFactory | |
TypedObject ElementFactory Source # | |
Defined in GI.Gst.Objects.ElementFactory | |
HasParentTypes ElementFactory Source # | |
Defined in GI.Gst.Objects.ElementFactory | |
IsGValue (Maybe ElementFactory) Source # | Convert |
Defined in GI.Gst.Objects.ElementFactory gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ElementFactory -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe 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
.
Methods
Click to display all available methods, including inherited ones
Methods
addControlBinding, bindProperty, bindPropertyFull, canSinkAllCaps, canSinkAnyCaps, canSrcAllCaps, canSrcAnyCaps, checkVersion, create, createWithProperties, defaultError, forceFloating, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, hasInterface, isFloating, listIsType, load, notify, notifyByPspec, ref, refSink, removeControlBinding, runDispose, stealData, stealQdata, suggestNextSync, syncValues, thawNotify, unparent, unref, watchClosure.
Getters
getControlBinding, getControlRate, getData, getElementType, getGValueArray, getMetadata, getMetadataKeys, getName, getNumPadTemplates, getParent, getPathString, getPlugin, getPluginName, getProperty, getQdata, getRank, getSkipDocumentation, getStaticPadTemplates, getUriProtocols, getUriType, getValue.
Setters
setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setName, setParent, setProperty, setRank.
canSinkAllCaps
elementFactoryCanSinkAllCaps Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> Caps |
|
-> m Bool | Returns: |
Checks if the factory can sink all possible capabilities.
canSinkAnyCaps
elementFactoryCanSinkAnyCaps Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> Caps |
|
-> m Bool | Returns: |
Checks if the factory can sink any possible capability.
canSrcAllCaps
elementFactoryCanSrcAllCaps Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> Caps |
|
-> m Bool | Returns: |
Checks if the factory can src all possible capabilities.
canSrcAnyCaps
elementFactoryCanSrcAnyCaps Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> Caps |
|
-> m Bool | Returns: |
Checks if the factory can src any possible capability.
create
:: (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.
createWithProperties
elementFactoryCreateWithProperties Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> Maybe [Text] |
|
-> Maybe [GValue] |
|
-> m (Maybe Element) | Returns: new |
Create a new element of the type defined by the given elementfactory. The supplied list of properties, will be passed at object construction.
Since: 1.20
find
:: (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 #
:: (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 #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> Text |
|
-> m (Maybe Text) | Returns: the metadata with |
Get the metadata on factory
with key
.
getMetadataKeys
elementFactoryGetMetadataKeys Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> m (Maybe [Text]) | Returns:
a |
Get the available keys for the metadata on factory
.
getNumPadTemplates
elementFactoryGetNumPadTemplates Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> m Word32 | Returns: the number of pad_templates |
Gets the number of pad_templates in this factory.
getSkipDocumentation
elementFactoryGetSkipDocumentation Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> m Bool | Returns: |
Queries whether registered element managed by factory
needs to
be excluded from documentation system or not.
Since: 1.20
getStaticPadTemplates
elementFactoryGetStaticPadTemplates Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> m [StaticPadTemplate] | Returns: the static pad templates |
Gets the List
of StaticPadTemplate
for this factory.
getUriProtocols
elementFactoryGetUriProtocols Source #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> m [Text] | Returns: the supported protocols
or |
getUriType
elementFactoryGetUriType Source #
:: (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 #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
Check if factory
implements the interface with name interfacename
.
listFilter
elementFactoryListFilter Source #
:: (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 #
:: (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 #
:: (HasCallStack, MonadIO m, IsElementFactory a) | |
=> a |
|
-> Word64 |
|
-> m Bool | Returns: |
Check if factory
is of the given types.
make
:: (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.
makeWithProperties
elementFactoryMakeWithProperties Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Maybe [Text] |
|
-> Maybe [GValue] |
|
-> m (Maybe Element) | Returns: new |
Create a new element of the type defined by the given elementfactory. The supplied list of properties, will be passed at object construction.
Since: 1.20