#include <urihandler.h>
Public Member Functions | |
virtual | ~URIHandler () |
GstURIHandler* | gobj () |
Provides access to the underlying C GObject. | |
const GstURIHandler* | gobj () const |
Provides access to the underlying C GObject. | |
guint | get_uri_type () |
Gets the type of the given URI handler. | |
Glib::StringArrayHandle | get_protocols () |
Gets the list of protocols supported by handler. | |
Glib::ustring | get_uri () |
Gets the currently handled URI. | |
bool | set_uri (const Glib::ustring& uri) |
Tries to set the URI of the given handler. | |
void | new_uri (const Glib::ustring& uri) |
Emits the new-uri signal for a given handler, when that handler has a new URI. | |
Glib::SignalProxy1< void, const Glib::ustring& > | signal_new_uri () |
This signal is emitted when the URI of the uri handler has changed. | |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static bool | protocol_is_valid (const Glib::ustring& protocol) |
Tests if the given string is a valid protocol identifier. | |
static bool | protocol_is_supported (const URIType type, const Glib::ustring& protocol) |
Checks if an element exists that supports the given URI protocol. | |
static bool | uri_is_valid (const Glib::ustring& uri) |
Tests if the given string is a valid URI identifier. | |
static bool | uri_has_protocol (const Glib::ustring& uri, const Glib::ustring& protocol) |
Checks if the protocol of a given valid URI matches protocol. | |
static Glib::ustring | get_protocol (const Glib::ustring& uri) |
Extracts the protocol out of a given valid URI. | |
static Glib::ustring | get_location (const Glib::ustring& uri) |
Extracts the location out of a given valid URI, ie. | |
static Glib::ustring | construct_uri (const Glib::ustring& protocol, const Glib::ustring& location) |
Constructs a URI for a given valid protocol and location. | |
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. | |
Protected Member Functions | |
virtual void | on_new_uri (const Glib::ustring& uri) |
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. |
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)
virtual Gst::URIHandler::~URIHandler | ( | ) | [virtual] |
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.
protocol | Protocol for URI. | |
location | Location for URI. |
0
if the given URI protocol is not valid, or the given location is 0
. 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().
uri | A URI string. |
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().
uri | A URI string. |
Glib::StringArrayHandle Gst::URIHandler::get_protocols | ( | ) |
Gets the list of protocols supported by handler.
This list may not be modified.
Returns 0
if the handler isn't implemented properly, or the handler
0
if the handler isn't implemented properly, or the handler doesn't support any protocols. Glib::ustring Gst::URIHandler::get_uri | ( | ) |
Gets the currently handled URI.
Returns 0
if there are no URI currently handled. The returned
0
if there are no URI currently handled. The returned string must not be modified or freed. guint Gst::URIHandler::get_uri_type | ( | ) |
Gets the type of the given URI handler.
Returns Gst::URI_UNKNOWN if the handler isn't implemented correctly.
const GstURIHandler* Gst::URIHandler::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
GstURIHandler* Gst::URIHandler::gobj | ( | ) | [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.
type | Whether to create a source or a sink. | |
uri | URI to create an element for. | |
elementname | Name of created element, can be 0 . |
0
if none could be created. void Gst::URIHandler::new_uri | ( | const Glib::ustring & | uri | ) |
Emits the new-uri signal for a given handler, when that handler has a new URI.
This function should only be called by URI handlers themselves.
uri | New URI or 0 if it was unset. |
virtual void Gst::URIHandler::on_new_uri | ( | const Glib::ustring & | uri | ) | [protected, virtual] |
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.
type | Whether to check for a source or a sink. | |
protocol | Protocol that should be checked for (e.g. "http" or "smb"). |
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.
protocol | A string. |
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.
uri | URI to set. |
true
if the URI was set successfully, else false
. Glib::SignalProxy1< void,const Glib::ustring& > Gst::URIHandler::signal_new_uri | ( | ) |
This signal is emitted when the URI of the uri handler has changed.
void on_my_new_uri(const Glib::ustring& 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.
uri | An URI string. | |
protocol | A protocol string (e.g. "http"). |
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.
uri | A URI string. |
true
if the string is a valid URI.
Glib::RefPtr<Gst::URIHandler> wrap | ( | GstURIHandler * | 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. |