Gst::ElementInterfaced<T_Interface> Class Template Reference

Templated class used for casting Gst::Element to interfaces that its underlying gobject implements. More...

#include <element.h>

Inheritance diagram for Gst::ElementInterfaced< T_Interface >:

Gst::Element Gst::Object

List of all members.

Public Member Functions

GstElement* gobj ()
 Provides access to the underlying C GObject.
const GstElement* gobj () const
 Provides access to the underlying C GObject.
GstElement* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 ~ElementInterfaced ()

Protected Member Functions

 ElementInterfaced (const ElementInterfaced&)
ElementInterfacedoperator= (const ElementInterfaced&)
 ElementInterfaced (GstElement* castitem)

Friends

class Gst::Interface


Detailed Description

template <class T_Interface>
class Gst::ElementInterfaced< T_Interface >

Templated class used for casting Gst::Element to interfaces that its underlying gobject implements.

Gst::ElementInterfaced is a templated class which, in conjunction with Gst::Interface::cast(), is used to cast a Gst::Element obtained by Gst::ElementFactory::create_element() into underlying GStreamer interfaces that the element may implement. A 'filesrc' element, for example, implements the Gst::URIHandler interface (which is not reflected in a Gst::Element obtained from a Gst::ElementFactory). To use the Gst::URIHandler methods with a 'filesrc' element obtained from a Gst::ElementFactory, one would do the following:

 ...
 Glib::RefPtr<Gst::Element> element =
 Gst::ElementFactory::create_element("filesrc", "source");

 Glib::RefPtr< Gst::ElementInterfaced<Gst::URIHandler> > handler =
   Gst::Interface::cast<Gst::URIHandler>(element);

 if (handler)
 {
   std::cout << "element '" << element->get_name() <<
     "' implements URIHandler interface." << std::endl;

   // Use uri handler interface methods:

   handler->set_uri("file:///tmp/media.file");

   std::cout << handler->get_name() << " uri = '" << handler->get_uri() <<
     "'." << std::endl;
 }

Constructor & Destructor Documentation

template <class T_Interface >
Gst::ElementInterfaced<T_Interface>::~ElementInterfaced (  ) 

template <class T_Interface >
Gst::ElementInterfaced<T_Interface>::ElementInterfaced ( const ElementInterfaced<T_Interface>&   )  [protected]

template <class T_Interface >
Gst::ElementInterfaced<T_Interface>::ElementInterfaced ( GstElement *  castitem  )  [protected]


Member Function Documentation

template <class T_Interface >
const GstElement* Gst::ElementInterfaced<T_Interface>::gobj (  )  const

Provides access to the underlying C GObject.

Reimplemented from Gst::Element.

template <class T_Interface >
GstElement* Gst::ElementInterfaced<T_Interface>::gobj (  ) 

Provides access to the underlying C GObject.

Reimplemented from Gst::Element.

template <class T_Interface >
GstElement* Gst::ElementInterfaced<T_Interface>::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::Element.

template <class T_Interface >
ElementInterfaced& Gst::ElementInterfaced<T_Interface>::operator= ( const ElementInterfaced<T_Interface>&   )  [protected]


Friends And Related Function Documentation

template <class T_Interface >
friend class Gst::Interface [friend]


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

Generated on Thu Jan 15 09:33:12 2009 for gstreamermm by  doxygen 1.5.7.1