gi-gst-1.0.22: GStreamer bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gst.Objects.ElementFactory

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

Exported types

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

Instances details
(GObject o, IsDescendantOf ElementFactory o) => IsElementFactory o Source # 
Instance details

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

Overloaded methods

canSinkAllCaps

elementFactoryCanSinkAllCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> a

factory: factory to query

-> Caps

caps: the caps to check

-> m Bool

Returns: True if the caps are fully compatible.

Checks if the factory can sink all possible capabilities.

canSinkAnyCaps

elementFactoryCanSinkAnyCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> a

factory: factory to query

-> Caps

caps: the caps to check

-> m Bool

Returns: True if the caps have a common subset.

Checks if the factory can sink any possible capability.

canSrcAllCaps

elementFactoryCanSrcAllCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> a

factory: factory to query

-> Caps

caps: the caps to check

-> m Bool

Returns: True if the caps are fully compatible.

Checks if the factory can src all possible capabilities.

canSrcAnyCaps

elementFactoryCanSrcAnyCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> a

factory: factory to query

-> Caps

caps: the caps to check

-> m Bool

Returns: True if the caps have a common subset.

Checks if the factory can src any possible capability.

create

elementFactoryCreate Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> a

factory: factory to instantiate

-> Maybe Text

name: name of new element, or Nothing to automatically create a unique name

-> m (Maybe Element)

Returns: new Element or Nothing if the element couldn't be created

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

elementFactoryFind Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: name of factory to find

-> m (Maybe ElementFactory)

Returns: ElementFactory if found, Nothing otherwise

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

factory: factory to get managed GType from

-> m GType

Returns: the GType for elements managed by this factory or 0 if the factory is not loaded.

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

factory: a ElementFactory

-> Text

key: a key

-> m (Maybe Text)

Returns: the metadata with key on factory or Nothing when there was no metadata with the given key.

Get the metadata on factory with key.

getMetadataKeys

elementFactoryGetMetadataKeys Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> a

factory: a ElementFactory

-> m (Maybe [Text])

Returns: a Nothing-terminated array of key strings, or Nothing when there is no metadata. Free with strfreev when no longer needed.

Get the available keys for the metadata on factory.

getNumPadTemplates

elementFactoryGetNumPadTemplates Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> a

factory: a ElementFactory

-> 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

factory: a ElementFactory

-> 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

factory: a ElementFactory

-> m [Text]

Returns: the supported protocols or Nothing

Gets a Nothing-terminated array of protocols this element supports or Nothing if no protocols are supported. You may not change the contents of the returned array, as it is still owned by the element factory. Use g_strdupv() to make a copy of the protocol string array if you need to.

getUriType

elementFactoryGetUriType Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> a

factory: a ElementFactory

-> 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

factory: a ElementFactory

-> Text

interfacename: an interface name

-> m Bool

Returns: True when factory implement the interface.

Check if factory implements the interface with name interfacename.

listFilter

elementFactoryListFilter Source #

Arguments

:: (HasCallStack, MonadIO m, IsElementFactory a) 
=> [a]

list: a List of ElementFactory to filter

-> Caps

caps: a Caps

-> PadDirection

direction: a PadDirection to filter on

-> Bool

subsetonly: whether to filter on caps subsets or not.

-> m [ElementFactory]

Returns: a List of ElementFactory elements that match the given requisites. Use gst_plugin_feature_list_free after usage.

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

type: a GstElementFactoryListType

-> Rank

minrank: Minimum rank

-> m [ElementFactory]

Returns: a List of ElementFactory elements. Use pluginFeatureListFree after usage.

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

factory: a ElementFactory

-> Word64

type: a GstElementFactoryListType

-> m Bool

Returns: True if factory is of type.

Check if factory is of the given types.

make

elementFactoryMake Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

factoryname: a named factory to instantiate

-> Maybe Text

name: name of new element, or Nothing to automatically create a unique name

-> m (Maybe Element)

Returns: new Element or Nothing if unable to create 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.