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 | Protected Member Functions | Related Functions | List of all members
Gst::URIHandler Class Reference
gstreamermm Interfaces

An interface to ease URI handling in plugins. More...

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

## Public Member Functions
virtual | ~URIHandler ()
GstURIHandler* | gobj ()
| Provides access to the underlying C GObject. More...
const GstURIHandler* | gobj () const
| Provides access to the underlying C GObject. More...
URIType | get_uri_type () const
| Gets the type of the given URI handler. More...
std::vector< Glib::ustring > | get_protocols () const
| Gets the list of protocols supported by handler. More...
Glib::ustring | get_uri () const
| Gets the currently handled URI. More...
bool | set_uri (const Glib::ustring& uri)
| Tries to set the URI of the given handler. More...
virtual Glib::ustring | get_uri_vfunc () const
| Virtual method which should be implemented to return the URI currently handled by the element. More...
virtual bool | set_uri_vfunc (const Glib::ustring& uri, GError** error)
| Virtual method which should be implemented to set a new URI. More...
virtual const gchar* const* | get_protocols_vfunc () const
| Method to return the list of protocols handled by the element. More...
virtual URIType | get_type_vfunc ()

## Static Public Member Functions
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static bool | protocol_is_valid (const Glib::ustring& protocol)
| Tests if the given string is a valid protocol identifier. More...
static bool | protocol_is_supported (const URIType type, const Glib::ustring& protocol)
| Checks if an element exists that supports the given URI protocol. More...
static bool | uri_is_valid (const Glib::ustring& uri)
| Tests if the given string is a valid URI identifier. More...
static bool | uri_has_protocol (const Glib::ustring& uri, const Glib::ustring& protocol)
| Checks if the protocol of a given valid URI matches protocol. More...
static Glib::ustring | get_protocol (const Glib::ustring& uri)
| Extracts the protocol out of a given valid URI. More...
static Glib::ustring | get_location (const Glib::ustring& uri)
| Extracts the location out of a given valid URI, ie. More...
static Glib::ustring | construct_uri (const Glib::ustring& protocol, const Glib::ustring& location)
| Constructs a URI for a given valid protocol and location. More...
static Glib::ustring | filename_to_uri (const Glib::ustring& filename)
| Similar to Glib::filename_to_uri(), but attempts to handle relative file paths as well. More...
static Glib::RefPtr< Gst::Element > | make_element_from_uri (const URIType type, const Glib::ustring& uri, const Glib::ustring& name)
| Creates an element for handling the given URI. More...

## Protected Member Functions
| URIHandler ()
| You should derive from this class to use it. More...

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::URIHandler > | wrap (GstURIHandler* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

An interface to ease URI handling in plugins.

The Gst::URIHandler is an interface that is implemented by Source and Sink Gst::Element to simplify then handling of URI.

An application can use the following functions to quickly get an element that handles the given URI for reading or writing (make_element_from_uri()).

Source and Sink plugins should implement this interface when possible.

Last reviewed on 2005-11-09 (0.9.4)

## Constructor & Destructor Documentation

Gst::URIHandler::URIHandler | ( |  | ) |
| protected

You should derive from this class to use it.

virtual Gst::URIHandler::~URIHandler | ( |  | ) |
| virtual

## Member Function Documentation

static void Gst::URIHandler::add_interface | ( | GType | gtype_implementer | ) |
| static

static Glib::ustring Gst::URIHandler::construct_uri | ( | const Glib::ustring & | protocol,
|  | const Glib::ustring & | location
| ) |  |
| static

Constructs a URI for a given valid protocol and location.

Free-function: g_free

Parameters

  protocol | Protocol for URI.
  location | Location for URI.

Returns
  A new string for this URI. Returns `0` if the given URI protocol is not valid, or the given location is `0`.

static Glib::ustring Gst::URIHandler::filename_to_uri | ( | const Glib::ustring & | filename | ) |
| static

Similar to Glib::filename_to_uri(), but attempts to handle relative file paths as well.

Before converting filename into an URI, it will be prefixed by the current working directory if it is a relative path, and then the path will be canonicalised so that it doesn't contain any './' or '../' segments.

On Windows #filename should be in UTF-8 encoding.

Parameters

  filename | Absolute or relative file name path.

static Glib::ustring Gst::URIHandler::get_location | ( | const Glib::ustring & | uri | ) |
| static

Extracts the location out of a given valid URI, ie.

the protocol and "://" are stripped from the URI, which means that the location returned includes the hostname if one is specified. The returned string must be freed using Glib::free().

Free-function: g_free

Parameters

  uri | A URI string.

Returns
  The location for this URI. Returns `0` if the URI isn't valid. If the URI does not contain a location, an empty string is returned.

static Glib::ustring Gst::URIHandler::get_protocol | ( | const Glib::ustring & | uri | ) |
| static

Extracts the protocol out of a given valid URI.

The returned string must be freed using Glib::free().

Parameters

  uri | A URI string.

Returns
  The protocol for this URI.

std::vector<Glib::ustring> Gst::URIHandler::get_protocols | ( |  | ) | const

Gets the list of protocols supported by handler.

This list may not be modified.

Returns
  The supported protocols. Returns `0` if the handler isn't implemented properly, or the handler doesn't support any protocols.

virtual const gchar* const* Gst::URIHandler::get_protocols_vfunc | ( |  | ) | const
| virtual

Method to return the list of protocols handled by the element.

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

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

virtual URIType Gst::URIHandler::get_type_vfunc | ( |  | ) |
| virtual

Glib::ustring Gst::URIHandler::get_uri | ( |  | ) | const

Gets the currently handled URI.

Returns
  The URI currently handled by the handler. Returns `0` if there are no URI currently handled. The returned string must be freed with Glib::free() when no longer needed.

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

Gets the type of the given URI handler.

Returns
  The Gst::URIType of the URI handler. Returns Gst::URI_UNKNOWN if the handler isn't implemented correctly.

virtual Glib::ustring Gst::URIHandler::get_uri_vfunc | ( |  | ) | const
| virtual

Virtual method which should be implemented to return the URI currently handled by the element.

GstURIHandler* Gst::URIHandler::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

const GstURIHandler* Gst::URIHandler::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

static Glib::RefPtr<Gst::Element> Gst::URIHandler::make_element_from_uri | ( | const URIType | type,
|  | const Glib::ustring & | uri,
|  | const Glib::ustring & | name
| ) |  |
| static

Creates an element for handling the given URI.

Parameters

  type | Whether to create a source or a sink.
  uri | URI to create an element for.
  elementname | Name of created element, can be `0`.

Returns
  A new element or `0` if none could be created.

static bool Gst::URIHandler::protocol_is_supported | ( | const URIType | type,
|  | const Glib::ustring & | protocol
| ) |  |
| static

Checks if an element exists that supports the given URI protocol.

Note that a positive return value does not imply that a subsequent call to Gst::Element::make_from_uri() is guaranteed to work.

Parameters

  type | Whether to check for a source or a sink.
  protocol | Protocol that should be checked for (e.g. "http" or "smb").

Returns
  `true`.

static bool Gst::URIHandler::protocol_is_valid | ( | const Glib::ustring & | protocol | ) |
| static

Tests if the given string is a valid protocol identifier.

Protocols must consist of alphanumeric characters, '+', '-' and '.' and must start with a alphabetic character. See RFC 3986 Section 3.1.

Parameters

  protocol | A string.

Returns
  `true` if the string is a valid protocol identifier, `false` otherwise.

bool Gst::URIHandler::set_uri | ( | const Glib::ustring & | uri | ) |

Tries to set the URI of the given handler.

Parameters

  uri | URI to set.

Returns
  `true` if the URI was set successfully, else `false`.

virtual bool Gst::URIHandler::set_uri_vfunc | ( | const Glib::ustring & | uri,
|  | GError ** | error
| ) |  |
| virtual

Virtual method which should be implemented to set a new URI.

static bool Gst::URIHandler::uri_has_protocol | ( | const Glib::ustring & | uri,
|  | const Glib::ustring & | protocol
| ) |  |
| static

Checks if the protocol of a given valid URI matches protocol.

Parameters

  uri | A URI string.
  protocol | A protocol string (e.g. "http").

Returns
  `true` if the protocol matches.

static bool Gst::URIHandler::uri_is_valid | ( | const Glib::ustring & | uri | ) |
| static

Tests if the given string is a valid URI identifier.

URIs start with a valid scheme followed by ":" and maybe a string identifying the location.

Parameters

  uri | A URI string.

Returns
  `true` if the string is a valid URI.

## Friends And Related Function Documentation

Glib::RefPtr< Gst::URIHandler > wrap | ( | GstURIHandler * | 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/urihandler.h