gstreamermm 1.4.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Related Functions | List of all members
Gst::ElementFactory Class Reference

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

Inheritance diagram for Gst::ElementFactory:
[legend]
Collaboration diagram for Gst::ElementFactory:
[legend]

## Public Member Functions
virtual | ~ElementFactory ()
GstElementFactory* | gobj ()
| Provides access to the underlying C GObject. More...
const GstElementFactory* | gobj () const
| Provides access to the underlying C GObject. More...
GstElementFactory* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Glib::RefPtr< Gst::Element > | create_named_element (const Glib::ustring& name)
| Create a new element of the type defined by the given elementfactory. More...
bool | can_sink_all_caps (const Glib::RefPtr< const Gst::Caps >& caps) const
| Checks if the factory can sink all possible capabilities. More...
bool | can_src_all_caps (const Glib::RefPtr< const Gst::Caps >& caps) const
| Checks if the factory can src all possible capabilities. More...
bool | can_sink_any_caps (const Glib::RefPtr< const Gst::Caps >& caps) const
| Checks if the factory can sink any possible capability. More...
bool | can_src_any_caps (const Glib::RefPtr< const Gst::Caps >& caps) const
| Checks if the factory can src any possible capability. More...
GType | get_element_type () const
| Get the Type for elements managed by this factory. More...
std::vector< Glib::ustring > | get_metadata_keys () const
| Get the available keys for the metadata on factory. More...
Glib::ustring | get_metadata (const Glib::ustring& key) const
| Get the metadata on factory with key. More...
guint | get_num_pad_templates () const
| Gets the number of pad_templates in this factory. More...
URIType | get_uri_type () const
| Gets the type of URIs the element supports or Gst::URI_UNKNOWN if none. More...
bool | has_interface (const Glib::ustring& name) const
| Check if factory implements the interface with name interfacename. More...
std::vector < Gst::StaticPadTemplate > | get_static_pad_templates () const
| Gets the List of Gst::StaticPadTemplate for this factory. More...
bool | is_type (ElementFactoryListType type) const
| Check if factory is of the given types. More...
Public Member Functions inherited from Gst::PluginFeature
virtual | ~PluginFeature ()
GstPluginFeature* | gobj ()
| Provides access to the underlying C GObject. More...
const GstPluginFeature* | gobj () const
| Provides access to the underlying C GObject. More...
GstPluginFeature* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
void | set_rank (guint rank)
| Specifies a rank for a plugin feature, so that autoplugging uses the most appropriate feature. More...
guint | get_rank () const
| Gets the rank of a plugin feature. More...
Glib::RefPtr< Gst::PluginFeature > | load ()
| Loads the plugin containing feature if it's not already loaded. More...
Glib::RefPtr< Gst::Plugin > | get_plugin () const
| Get the plugin that provides this feature. More...
bool | check_version (guint min_major, guint min_minor, guint min_micro) const
| Checks whether the given plugin feature is at least the required version. More...
Public Member Functions inherited from Gst::Object
virtual | ~Object ()
GstObject* | gobj ()
| Provides access to the underlying C GObject. More...
const GstObject* | gobj () const
| Provides access to the underlying C GObject. More...
GstObject* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
bool | is_element () const
bool | is_element_factory () const
bool | is_pad () const
bool | is_pad_template () const
bool | is_bin () const
guint32 | get_flags () const
| Returns the entire set of flags for the object. More...
bool | set_name (const Glib::ustring& name)
| Sets the name of object, or gives object a guaranteed unique name (if name is `0`). More...
Glib::ustring | get_name () const
| Returns a copy of the name of object. More...
bool | set_parent (const Glib::RefPtr< Gst::Object >& parent)
| Sets the parent of object to parent. More...
Glib::RefPtr< Gst::Object > | get_parent ()
| Returns the parent of object. More...
Glib::RefPtr< const Gst::Object > | get_parent () const
| Returns the parent of object. More...
void | unparent ()
| Clear the parent of object, removing the associated reference. More...
bool | has_ancestor (const Glib::RefPtr< const Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
Glib::ustring | get_path_string ()
| Generates a string describing the path of object in the object hierarchy. More...
Glib::PropertyProxy < Glib::ustring > | property_name ()
| The name of the object. More...
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_name () const
| The name of the object. More...
Glib::SignalProxy2< void, const Glib::RefPtr< Object > &, GParamSpec* > | signal_deep_notify ()
int | get_refcount () const

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static bool | register_element (const Glib::RefPtr< Gst::Plugin >& plugin, const Glib::ustring& name, guint rank, GType type)
| Create a new elementfactory capable of instantiating objects of the type and add the factory to plugin. More...
static Glib::RefPtr < Gst::ElementFactory > | find (const Glib::ustring& name)
| Search for an element factory of the given name. More...
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. More...
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. More...
static std::vector < Glib::RefPtr < Gst::ElementFactory > > | filter (const std::vector< Glib::RefPtr< Gst::ElementFactory > >& list, const Glib::RefPtr< const Gst::Caps >& caps, PadDirection direction, bool subsetonly)
| Filter out all the elementfactories in list that can handle caps in the given direction. More...
static std::vector < Glib::RefPtr < Gst::ElementFactory > > | get_elements (ElementFactoryListType type, Rank minrank)
| Get a list of factories that match the given type. More...
Static Public Member Functions inherited from Gst::PluginFeature
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
Static Public Member Functions inherited from Gst::Object
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static bool | check_uniqueness (const Glib::ListHandle< const Gst::Object >& list, const Glib::ustring& name)
| Checks to see if there is any object named name in list. More...

## 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. More...
Related Functions inherited from Gst::PluginFeature
Glib::RefPtr< Gst::PluginFeature > | wrap (GstPluginFeature* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::Object
Glib::RefPtr< Gst::Object > | wrap (GstObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members
Public Types inherited from Gst::PluginFeature
typedef sigc::slot< bool, const Glib::RefPtr < Gst::PluginFeature >& > | SlotFilter
| For example, bool on_filter(const Glib::RefPtr<Gst::PluginFeature>& feature);. More...
Protected Member Functions inherited from Gst::Object
virtual void | on_deep_notify (const Glib::RefPtr< Object >& prop_object, GParamSpec* prop)
| This is a default handler for the signal signal_deep_notify(). More...

## Detailed Description

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);
}
...
}

## Constructor & Destructor Documentation

virtual Gst::ElementFactory::~ElementFactory | ( |  | ) |
| virtual

## Member Function Documentation

bool Gst::ElementFactory::can_sink_all_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const

Checks if the factory can sink all possible capabilities.

Parameters

  caps | The caps to check.

Returns
  `true` if the caps are fully compatible.

bool Gst::ElementFactory::can_sink_any_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const

Checks if the factory can sink any possible capability.

Parameters

  caps | The caps to check.

Returns
  `true` if the caps have a common subset.

bool Gst::ElementFactory::can_src_all_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const

Checks if the factory can src all possible capabilities.

Parameters

  caps | The caps to check.

Returns
  `true` if the caps are fully compatible.

bool Gst::ElementFactory::can_src_any_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const

Checks if the factory can src any possible capability.

Parameters

  caps | The caps to check.

Returns
  `true` if the caps have a common subset.

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.

Parameters

  factoryname | A named factory to instantiate.
  name | Name of new element.

Returns
  New Gst::Element or `0` if unable to create element.

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.

Parameters

  factoryname | A named factory to instantiate.
  name | Name of new element.

Returns
  New Gst::Element or an empty RefPtr 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.

Parameters

  name | Name of new element, or `0` to automatically create a unique name.

Returns
  New Gst::Element or `0` if the element couldn't be created.

static std::vector< Glib::RefPtr<Gst::ElementFactory> > Gst::ElementFactory::filter | ( | const std::vector< Glib::RefPtr< Gst::ElementFactory > >& | list,
|  | const Glib::RefPtr< const Gst::Caps >& | caps,
|  | PadDirection | direction,
|  | bool | subsetonly
| ) |  |
| static

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.

Parameters

  list | A List of Gst::ElementFactory to filter.
  caps | A Gst::Caps.
  direction | A Gst::PadDirection to filter on.
  subsetonly | Whether to filter on caps subsets or not.

Returns
  A List of Gst::ElementFactory elements that match the given requisits. Use #gst_plugin_feature_list_free after usage.

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.

Parameters

  name | Name of factory to find.

Returns
  Gst::ElementFactory if found, `0` otherwise.

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

Returns
  The Type for elements managed by this factory or 0 if the factory is not loaded.

static std::vector< Glib::RefPtr<Gst::ElementFactory> > Gst::ElementFactory::get_elements | ( | ElementFactoryListType | type,
|  | Rank | minrank
| ) |  |
| static

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.

Parameters

  type | A Gst::ElementFactoryListType.
  minrank | Minimum rank.

Returns
  A List of Gst::ElementFactory elements. Use Gst::PluginFeature::list_free() after usage.

Glib::ustring Gst::ElementFactory::get_metadata | ( | const Glib::ustring & | key | ) | const

Get the metadata on factory with key.

Parameters

  key | A key.

Returns
  The metadata with key on factory or `0` when there was no metadata with the given key.

std::vector<Glib::ustring> Gst::ElementFactory::get_metadata_keys | ( |  | ) | const

Get the available keys for the metadata on factory.

Returns
  A `0`-terminated array of key strings, or `0` when there is no metadata. Free with Glib::strfreev() when no longer needed.

guint Gst::ElementFactory::get_num_pad_templates | ( |  | ) | const

Gets the number of pad_templates in this factory.

Returns
  The number of pad_templates.

std::vector< Gst::StaticPadTemplate > Gst::ElementFactory::get_static_pad_templates | ( |  | ) | const

Gets the List of Gst::StaticPadTemplate for this factory.

Returns
  The static pad templates.

static GType Gst::ElementFactory::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

URIType Gst::ElementFactory::get_uri_type | ( |  | ) | const

Gets the type of URIs the element supports or Gst::URI_UNKNOWN if none.

Returns
  Type of URIs this element supports.

GstElementFactory* Gst::ElementFactory::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

const GstElementFactory* Gst::ElementFactory::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

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.

bool Gst::ElementFactory::has_interface | ( | const Glib::ustring & | name | ) | const

Check if factory implements the interface with name interfacename.

Parameters

  interfacename | An interface name.

Returns
  #`true` when factory implement the interface.

bool Gst::ElementFactory::is_type | ( | ElementFactoryListType | type | ) | const

Check if factory is of the given types.

Parameters

  type | A Gst::ElementFactoryListType.

Returns
  `true` if factory is of type.

static bool Gst::ElementFactory::register_element | ( | const Glib::RefPtr< Gst::Plugin >& | plugin,
|  | const Glib::ustring & | name,
|  | guint | rank,
|  | GType | type
| ) |  |
| static

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

Parameters

  plugin | Gst::Plugin to register the element with, or `0` for a static element.
  name | Name of elements of this type.
  rank | Rank of element (higher rank means more importance when autoplugging).
  type | GType of element to register.

Returns
  `true`, if the registering succeeded, `false` on error.

## Friends And Related Function Documentation

Glib::RefPtr< Gst::ElementFactory > wrap | ( | GstElementFactory * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

A Glib::wrap() method for this object.

Parameters

  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.

Returns
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gstreamermm/elementfactory.h