A class that creates Gst::Element objects from a factory. More...
Inherits Gst::PluginFeature.

Public Member Functions | |
| virtual | ~ElementFactory () |
| GstElementFactory* | gobj () |
| Provides access to the underlying C GObject. | |
| const GstElementFactory* | gobj () const |
| Provides access to the underlying C GObject. | |
| GstElementFactory* | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
| Glib::RefPtr< Gst::Element > | create_named_element (const Glib::ustring& name) |
| Create a new element of the type defined by the given elementfactory. | |
| GType | get_element_type () const |
| Get the Type for elements managed by this factory. | |
| Glib::ustring | get_long_name () const |
| Gets the longname for this factory. | |
| Glib::ustring | get_kclass () const |
| Gets the class for this factory. | |
| Glib::ustring | get_description () const |
| Gets the description for this factory. | |
| Glib::ustring | get_author () const |
| Gets the author for this factory. | |
| guint | get_num_pad_templates () const |
| Gets the number of pad_templates in this factory. | |
| int | get_uri_type () const |
| Gets the type of URIs the element supports or Gst::URI_UNKNOWN if none. | |
| Glib::StringArrayHandle | get_uri_protocols () const |
Gets a 0-terminated array of protocols this element supports or 0 if no protocols are supported. | |
| bool | has_interface (const Glib::ustring& name) const |
| Check if factory implements the interface with name interfacename. | |
| bool | can_sink_caps (const Glib::RefPtr< const Gst::Caps >& caps) const |
| Checks if the factory can sink the given capability. | |
| bool | can_src_caps (const Glib::RefPtr< const Gst::Caps >& caps) const |
| Checks if the factory can source the given capability. | |
| Glib::ListHandle< Glib::RefPtr < Gst::PadTemplate > > | get_static_pad_templates () |
| Gets the List of Gst::StaticPadTemplate for this factory. | |
| Glib::ListHandle< Glib::RefPtr < const Gst::PadTemplate > > | get_static_pad_templates () const |
| Gets the List of Gst::StaticPadTemplate for this factory. | |
Static Public Member Functions | |
| static Glib::RefPtr < Gst::ElementFactory > | find (const Glib::ustring& name) |
| Search for an element factory of the given name. | |
| static Glib::RefPtr< Gst::Element > | create_element (const Glib::ustring& factory_name, const Glib::ustring& name) |
| Create a new element of the type defined by the given element factory. | |
| static Glib::RefPtr< Gst::Element > | create_element (const Glib::ustring& factory_name) |
| Create a new element of the type defined by the given element factory, with a guaranteed unique name consisting of the element factory name and a number. | |
Related Functions | |
(Note that these are not member functions.) | |
| Glib::RefPtr< Gst::ElementFactory > | wrap (GstElementFactory* object, bool take_copy=false) |
| A Glib::wrap() method for this object. | |
A class that creates Gst::Element objects from a factory.
Gst::ElementFactory is used to create instances of elements. A Gst::ElementFactory can be added to a Gst::Plugin as it is also a Gst::PluginFeature. Use find() to get a particular element factory. Use create_named_element() and the create_element() functions to create element instances.
The following code example shows you how to create a 'filesrc' element.
#include <gstreamermm.h> #include <iostream> int main (int argc, char *argc[]) { Glib::RefPtr<Gst::Element> src; Glib::RefPtr<Gst::ElementFactory> srcfactory; Gst::init(&argc,&argv); srcfactory = Gst::ElementFactory::find("filesrc"); if(!srcfactory) { std::cout << "Could not find factory 'filesrc'" << std::endl; exit(1); } src = srcfactory->create_named_element("src"); if(!src) { std::cout << "Could not create element 'src'" << std::endl; exit(1); } ... }
| virtual Gst::ElementFactory::~ElementFactory | ( | ) | [virtual] |
| bool Gst::ElementFactory::can_sink_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const |
Checks if the factory can sink the given capability.
| caps | The caps to check. |
| bool Gst::ElementFactory::can_src_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const |
Checks if the factory can source the given capability.
| caps | The caps to check. |
| static Glib::RefPtr<Gst::Element> Gst::ElementFactory::create_element | ( | const Glib::ustring & | factory_name | ) | [static] |
Create a new element of the type defined by the given element factory, with a guaranteed unique name consisting of the element factory name and a number.
| factoryname | A named factory to instantiate. | |
| name | Name of new element. |
| static Glib::RefPtr<Gst::Element> Gst::ElementFactory::create_element | ( | const Glib::ustring & | factory_name, | |
| const Glib::ustring & | name | |||
| ) | [static] |
Create a new element of the type defined by the given element factory.
| factoryname | A named factory to instantiate. | |
| name | Name of new element. |
0 if unable to create element. | Glib::RefPtr<Gst::Element> Gst::ElementFactory::create_named_element | ( | const Glib::ustring & | 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.
| name | Name of new element. |
0 if the element couldn't be created. | static Glib::RefPtr<Gst::ElementFactory> Gst::ElementFactory::find | ( | const Glib::ustring & | name | ) | [static] |
Search for an element factory of the given name.
Refs the returned element factory; caller is responsible for unreffing.
| name | Name of factory to find. |
0 otherwise. | Glib::ustring Gst::ElementFactory::get_author | ( | ) | const |
Gets the author for this factory.
| Glib::ustring Gst::ElementFactory::get_description | ( | ) | const |
Gets the description for this factory.
| GType Gst::ElementFactory::get_element_type | ( | ) | const |
Get the Type for elements managed by this factory.
The type can only be retrieved if the element factory is loaded, which can be assured with Gst::PluginFeature::load().
| Glib::ustring Gst::ElementFactory::get_kclass | ( | ) | const |
Gets the class for this factory.
| Glib::ustring Gst::ElementFactory::get_long_name | ( | ) | const |
Gets the longname for this factory.
| guint Gst::ElementFactory::get_num_pad_templates | ( | ) | const |
Gets the number of pad_templates in this factory.
| Glib::ListHandle< Glib::RefPtr<const Gst::PadTemplate> > Gst::ElementFactory::get_static_pad_templates | ( | ) | const |
Gets the List of Gst::StaticPadTemplate for this factory.
| Glib::ListHandle< Glib::RefPtr<Gst::PadTemplate> > Gst::ElementFactory::get_static_pad_templates | ( | ) |
Gets the List of Gst::StaticPadTemplate for this factory.
| Glib::StringArrayHandle Gst::ElementFactory::get_uri_protocols | ( | ) | const |
Gets a 0-terminated array of protocols this element supports or 0 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 Glib::strdupv() to make a copy of the protocol string array if you need to.
0. | int Gst::ElementFactory::get_uri_type | ( | ) | const |
Gets the type of URIs the element supports or Gst::URI_UNKNOWN if none.
| const GstElementFactory* Gst::ElementFactory::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::PluginFeature.
| GstElementFactory* Gst::ElementFactory::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::PluginFeature.
| GstElementFactory* Gst::ElementFactory::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gst::PluginFeature.
| bool Gst::ElementFactory::has_interface | ( | const Glib::ustring & | name | ) | const |
Check if factory implements the interface with name interfacename.
| interfacename | An interface name. |
true when factory implement the interface.| Glib::RefPtr< Gst::ElementFactory > wrap | ( | GstElementFactory * | object, | |
| bool | take_copy = false | |||
| ) | [related] |
A Glib::wrap() method for this object.
| object | The C instance. | |
| take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
1.6.3