Next: GstUtils, Previous: GstTypeFind, Up: Top
Interface to ease URI handling in plugins.
The 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 (gst-element-make-from-uri).
Source and Sink plugins should implement this interface when possible.
Last reviewed on 2005-11-09 (0.9.4)
mchars) (ret bool)Tests if the given string is a valid protocol identifier. Protocols must consist of alphanumeric characters and not start with a number.
- protocol
- A string
- ret
- TRUE if the string is a valid protocol identifier, FALSE otherwise.
mchars) (ret bool)Tests if the given string is a valid URI identifier. URIs start with a valid protocol followed by "://" and maybe a string identifying the location.
- uri
- A URI string
- ret
- TRUE if the string is a valid URI
mchars) (protocol mchars) (ret bool)Checks if the protocol of a given valid URI matches protocol.
- uri
- an URI string
- protocol
- a protocol string (e.g. "http")
- ret
- ‘
#t’ if the protocol matches.Since 0.10.4
mchars) (ret mchars)Extracts the protocol out of a given valid URI. The returned string must be freed using
g-free.
- uri
- A URI string
- ret
- The protocol for this URI.
mchars) (ret mchars)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
g-free.
- uri
- A URI string
- ret
- The location for this URI. Returns NULL if the URI isn't valid. If the URI does not contain a location, an empty string is returned.
mchars) (location mchars) (ret mchars)Constructs a URI for a given valid protocol and location.
- protocol
- Protocol for URI
- location
- Location for URI
- ret
- a new string for this URI. Returns NULL if the given URI protocol is not valid, or the given location is NULL.
<gst-uri-type>) (uri mchars) (elementname mchars) (ret <gst-element>)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 NULL.
- ret
- a new element or NULL if none could be created
<gst-uri-handler*>) (ret unsigned-int)Gets the type of the given URI handler
Returns: the
<gst-uri-type>of the URI handler.
- handler
- A
<gst-uri-handler>.- ret
<gst-uri-unknown>if the handler isn't implemented correctly.
<gst-uri-handler*>) (ret <gchar**>)Gets the list of protocols supported by handler. This list may not be modified.
Returns: the supported protocols.
- handler
- A
<gst-uri-handler>.- ret
- NULL if the handler isn't implemented properly, or the handler doesn't support any protocols.
<gst-uri-handler*>) (ret mchars)Gets the currently handled URI.
Returns: the URI currently handled by the handler.
- handler
- A
<gst-uri-handler>- ret
- NULL if there are no URI currently handled. The returned string must not be modified or freed.