gstreamermm: Gst::ElementInterfaced< T_Interface > Class Template Reference

gstreamermm 0.10.10

- Main Page
- Modules
- Namespaces
- Classes

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

Public Member Functions

# Gst::ElementInterfaced< T_Interface > Class Template Reference
gstreamermm Interfaces

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

Inheritance diagram for Gst::ElementInterfaced< T_Interface >:
[legend]
Collaboration diagram for Gst::ElementInterfaced< T_Interface >:
[legend]

List of all members.

## Public Member Functions
virtual | ~ElementInterfaced ()
GstElement* | gobj ()
| Gets the underlying gobject.
const GstElement* | gobj () const
| Gets the underlying gobject.
GstElement* | gobj_copy ()
| Gets a copy of the underlying gobject. The copy should be freed.

## Detailed Description

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

A 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 >

virtual Gst::ElementInterfaced< T_Interface >::~ElementInterfaced | ( |  | ) | `[virtual]`

## Member Function Documentation

template <class T_Interface >

GstElement* Gst::ElementInterfaced< T_Interface >::gobj | ( |  | ) | `[inline]`

Gets the underlying gobject.

Reimplemented from Gst::Element.

template <class T_Interface >

const GstElement* Gst::ElementInterfaced< T_Interface >::gobj | ( |  | ) | const`[inline]`

Gets the underlying gobject.

Reimplemented from Gst::Element.

template <class T_Interface >

GstElement* Gst::ElementInterfaced< T_Interface >::gobj_copy | ( |  | ) | `[inline]`

Gets a copy of the underlying gobject. The copy should be freed.

Reimplemented from Gst::Element.

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

- gstreamermm/element.h