ElementFactory

Description GstElementFactory is used to create instances of elements. A GstElementfactory can be added to a GstPlugin as it is also a GstPluginFeature. Use the gst_element_factory_find() and gst_element_factory_create() functions to create element instances or use gst_element_factory_make() as a convenient shortcut. The following code example shows you how to create a GstFileSrc element. Last reviewed on 2005-11-23 (0.9.5)

Constructors

this
this(GstElementFactory* gstElementFactory)

Sets our main struct and passes it to the parent class

Members

Functions

canSinkCaps
int canSinkCaps(Caps caps)

Checks if the factory can sink the given capability.

canSrcCaps
int canSrcCaps(Caps caps)

Checks if the factory can source the given capability.

create
Element create(string name)

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.

getAuthor
string getAuthor()

Gets the author for this factory.

getDescription
string getDescription()

Gets the description for this factory.

getElementFactoryStruct
GstElementFactory* getElementFactoryStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getElementType
GType getElementType()

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 gst_plugin_feature_load().

getKlass
string getKlass()

Gets the class for this factory.

getLongname
string getLongname()

Gets the longname for this factory

getNumPadTemplates
uint getNumPadTemplates()

Gets the number of pad_templates in this factory.

getStaticPadTemplates
ListG getStaticPadTemplates()

Gets the GList of GstStaticPadTemplate for this factory.

getStruct
void* getStruct()

the main Gtk struct as a void*

getUriProtocols
string[] getUriProtocols()

Gets a NULL-terminated array of protocols this element supports or NULL 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
int getUriType()

Gets the type of URIs the element supports or GST_URI_UNKNOWN if none.

hasInterface
int hasInterface(string interfacename)

Check if factory implements the interface with name interfacename.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

find
ElementFactory find(string name)

Search for an element factory of the given name. Refs the returned element factory; caller is responsible for unreffing.

make
Element make(string factoryname)

Create a new element of the type defined by the given element factory. The element will receive a guaranteed unique name, consisting of the element factory name and a number.

make
Element make(string factoryname, string name)

Create a new element of the type defined by the given element factory. If name is NULL, 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.

register
int register(Plugin plugin, string name, uint rank, GType type)

Create a new elementfactory capable of instantiating objects of the type and add the factory to plugin.

Variables

gstElementFactory
GstElementFactory* gstElementFactory;

the main Gtk struct

Inherited Members

From PluginFeature

gstPluginFeature
GstPluginFeature* gstPluginFeature;

the main Gtk struct

getPluginFeatureStruct
GstPluginFeature* getPluginFeatureStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
typeNameFilter
int typeNameFilter(GstTypeNameData* data)

Compares type and name of plugin feature. Can be used with gst_filter_run().

setRank
void setRank(uint rank)

Specifies a rank for a plugin feature, so that autoplugging uses the most appropriate feature.

setFeatureName
void setFeatureName(string name)

Sets the name of a plugin feature. The name uniquely identifies a feature within all features of the same type. Renaming a plugin feature is not allowed. A copy is made of the name so you should free the supplied name after calling this function.

getRank
uint getRank()

Gets the rank of a plugin feature.

getName
string getName()

Gets the name of a plugin feature.

load
PluginFeature load()

Loads the plugin containing feature if it's not already loaded. feature is unaffected; use the return value instead.

listFree
void listFree(ListG list)

Unrefs each member of list, then frees the list.

checkVersion
int checkVersion(uint minMajor, uint minMinor, uint minMicro)

Checks whether the given plugin feature is at least the required version

Meta