gstreamermm: Gst::URIHandler Class Reference
An interface to ease URI handling in plugins. More...


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
|
protected |
You should derive from this class to use it.
|
virtual |
Member Function Documentation
|
static |
|
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
0if the given URI protocol is not valid, or the given location is0.
|
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 |
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
0if the URI isn't valid. If the URI does not contain a location, an empty string is returned.
|
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
0if the handler isn't implemented properly, or the handler doesn't support any protocols.
|
virtual |
Method to return the list of protocols handled by the element.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
virtual |
| Glib::ustring Gst::URIHandler::get_uri | ( | ) | const |
Gets the currently handled URI.
- Returns
- The URI currently handled by the handler. Returns
0if 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 |
Virtual method which should be implemented to return the URI currently handled by the element.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
|
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
0if none could be created.
|
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 |
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
trueif the string is a valid protocol identifier,falseotherwise.
| bool Gst::URIHandler::set_uri | ( | const Glib::ustring & | uri | ) |
Tries to set the URI of the given handler.
- Parameters
-
uri URI to set.
- Returns
trueif the URI was set successfully, elsefalse.
|
virtual |
Virtual method which should be implemented to set a new URI.
|
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
trueif the protocol matches.
|
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
trueif the string is a valid URI.
Friends And Related Function Documentation
|
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
