gstreamermm 0.10.10.1
|
A class that creates Gst::Element objects from a factory. More...
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. | |
bool | can_sink_all_caps (const Glib::RefPtr< const Gst::Caps >& caps) const |
Checks if the factory can sink all possible capabilities. | |
bool | can_src_all_caps (const Glib::RefPtr< const Gst::Caps >& caps) const |
Checks if the factory can src all possible capabilities. | |
bool | can_sink_any_caps (const Glib::RefPtr< const Gst::Caps >& caps) const |
Checks if the factory can sink any possible capability. | |
bool | can_src_any_caps (const Glib::RefPtr< const Gst::Caps >& caps) const |
Checks if the factory can src any possible capability. | |
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. | |
Glib::ustring | get_documentation_uri () const |
Gets documentation uri for this factory if set. | |
Glib::ustring | get_icon_name () const |
Gets icon name for this factory if set. | |
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. | |
bool | is_type (ElementFactoryListType type) const |
Check if factory if of the given types. | |
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. | |
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. | |
static std::vector < Glib::RefPtr < Gst::ElementFactory > > | get_elements (ElementFactoryListType type, Rank minrank) |
Get a list of factories that match the given type. | |
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_all_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const |
Checks if the factory can sink all possible capabilities.
caps | The caps to check. |
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.
caps | The caps to check. |
true
if the caps have a common subset. bool Gst::ElementFactory::can_sink_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const |
Checks if the factory can sink the given capability.
Deprecated: use can_sink_all_caps() instead.
caps | The caps to check. |
true
if it can sink the capabilities. bool Gst::ElementFactory::can_src_all_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const |
Checks if the factory can src all possible capabilities.
caps | The caps to check. |
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.
caps | The caps to check. |
true
if the caps have a common subset. bool Gst::ElementFactory::can_src_caps | ( | const Glib::RefPtr< const Gst::Caps >& | caps | ) | const |
Checks if the factory can source the given capability.
Deprecated: use can_src_all_caps() instead.
caps | The caps to check. |
true
if it can src the capabilities. 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. 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. |
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 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.
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. |
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.
Glib::ustring Gst::ElementFactory::get_documentation_uri | ( | ) | const |
Gets documentation uri for this factory if set.
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().
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.
type | A Gst::ElementFactoryListType. |
minrank | Minimum rank. |
Glib::ustring Gst::ElementFactory::get_icon_name | ( | ) | const |
Gets icon name for this factory if set.
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.
GstElementFactory* Gst::ElementFactory::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::PluginFeature.
const GstElementFactory* Gst::ElementFactory::gobj | ( | ) | const [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. bool Gst::ElementFactory::is_type | ( | ElementFactoryListType | type | ) | const |
Check if factory if of the given types.
type | A Gst::ElementFactoryListType. |
true
if factory is of type. 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. |