Gst.ElementFactory¶
- Subclasses
None
Methods¶
- Inherited
Gst.PluginFeature (10), Gst.Object (27), GObject.Object (37)
- Structs
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited
Properties¶
- Inherited
Signals¶
- Inherited
Fields¶
- Inherited
Class Details¶
- class Gst.ElementFactory(**kwargs)¶
- Bases
- Abstract
No
- Structure
Gst.ElementFactory
is used to create instances of elements. AGst.ElementFactory
can be added to aGst.Plugin
as it is also aGst.PluginFeature
.Use the
Gst.ElementFactory.find
() andGst.ElementFactory.create
() functions to create element instances or useGst.ElementFactory.make
() as a convenient shortcut.The following code example shows you how to create a GstFileSrc element.
- Using an element factory
#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); ...
- classmethod find(name)[source]¶
- Parameters
name (
str
) – name of factory to find- Returns
Gst.ElementFactory
if found,None
otherwise- Return type
Search for an element factory of the given name. Refs the returned element factory; caller is responsible for unreffing.
- classmethod list_filter(list, caps, direction, subsetonly)[source]¶
- Parameters
list ([
Gst.ElementFactory
]) – aGLib.List
ofGst.ElementFactory
to filterdirection (
Gst.PadDirection
) – aGst.PadDirection
to filter onsubsetonly (
bool
) – whether to filter on caps subsets or not.
- Returns
a
GLib.List
ofGst.ElementFactory
elements that match the given requisites. UseGst.PluginFeature.list_free
after usage.- Return type
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.
- classmethod list_get_elements(type, minrank)[source]¶
- Parameters
- Returns
a
GLib.List
ofGst.ElementFactory
elements. UseGst.PluginFeature.list_free
() after usage.- Return type
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.
- classmethod make(factoryname, name)[source]¶
- Parameters
- Returns
new
Gst.Element
orNone
if unable to create element- Return type
Gst.Element
orNone
Create a new element of the type defined by the given element factory. If name is
None
, 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.
- classmethod make_with_properties(factoryname, names, values)[source]¶
- Parameters
factoryname (
str
) – a named factory to instantiatevalues ([
GObject.Value
] orNone
) – array of associated properties values
- Returns
new
Gst.Element
orNone
if the element couldn’t be created- Return type
Gst.Element
orNone
Create a new element of the type defined by the given elementfactory. The supplied list of properties, will be passed at object construction.
New in version 1.20.
- can_sink_all_caps(caps)[source]¶
- Parameters
caps (
Gst.Caps
) – the caps to check- Returns
True
if the caps are fully compatible.- Return type
Checks if the factory can sink all possible capabilities.
- can_sink_any_caps(caps)[source]¶
- Parameters
caps (
Gst.Caps
) – the caps to check- Returns
True
if the caps have a common subset.- Return type
Checks if the factory can sink any possible capability.
- can_src_all_caps(caps)[source]¶
- Parameters
caps (
Gst.Caps
) – the caps to check- Returns
True
if the caps are fully compatible.- Return type
Checks if the factory can src all possible capabilities.
- can_src_any_caps(caps)[source]¶
- Parameters
caps (
Gst.Caps
) – the caps to check- Returns
True
if the caps have a common subset.- Return type
Checks if the factory can src any possible capability.
- create(name)[source]¶
- Parameters
name (
str
orNone
) – name of new element, orNone
to automatically create a unique name- Returns
new
Gst.Element
orNone
if the element couldn’t be created- Return type
Gst.Element
orNone
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.
- create_with_properties(names, values)[source]¶
- Parameters
values ([
GObject.Value
] orNone
) – array of associated properties values
- Returns
new
Gst.Element
orNone
if the element couldn’t be created- Return type
Gst.Element
orNone
Create a new element of the type defined by the given elementfactory. The supplied list of properties, will be passed at object construction.
New in version 1.20.
- get_element_type()[source]¶
- Returns
the
GObject.GType
for elements managed by this factory or 0 if the factory is not loaded.- Return type
Get the
GObject.GType
for elements managed by this factory. The type can only be retrieved if the element factory is loaded, which can be assured withGst.PluginFeature.load
().
- get_metadata(key)[source]¶
- Parameters
key (
str
) – a key- Returns
the metadata with key on self or
None
when there was no metadata with the given key.- Return type
Get the metadata on self with key.
- get_metadata_keys()[source]¶
- Returns
a
None
-terminated array of key strings, orNone
when there is no metadata. Free withGLib.strfreev
() when no longer needed.- Return type
Get the available keys for the metadata on self.
- get_num_pad_templates()[source]¶
- Returns
the number of pad_templates
- Return type
Gets the number of pad_templates in this factory.
- get_skip_documentation()[source]¶
-
Queries whether registered element managed by self needs to be excluded from documentation system or not.
New in version 1.20.
- get_static_pad_templates()[source]¶
- Returns
the static pad templates
- Return type
Gets the
GLib.List
ofGst.StaticPadTemplate
for this factory.
- get_uri_protocols()[source]¶
-
Gets a
None
-terminated array of protocols this element supports orNone
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.
- get_uri_type()[source]¶
- Returns
type of URIs this element supports
- Return type
Gets the type of URIs the element supports or
Gst.URIType.UNKNOWN
if none.