Top |
Functions
GQuark | gst_uri_error_quark () |
#define | GST_URI_TYPE_IS_VALID() |
gboolean | gst_uri_protocol_is_valid () |
gboolean | gst_uri_protocol_is_supported () |
gboolean | gst_uri_is_valid () |
gboolean | gst_uri_has_protocol () |
gchar * | gst_uri_get_protocol () |
gchar * | gst_uri_get_location () |
gchar * | gst_uri_construct () |
gchar * | gst_filename_to_uri () |
GstElement * | gst_element_make_from_uri () |
GstURIType | gst_uri_handler_get_uri_type () |
const gchar * const * | gst_uri_handler_get_protocols () |
gchar * | gst_uri_handler_get_uri () |
gboolean | gst_uri_handler_set_uri () |
Types and Values
GstURIHandler | |
struct | GstURIHandlerInterface |
enum | GstURIType |
enum | GstURIError |
#define | GST_URI_NO_PORT |
Description
The GstURIHandler is an interface that is implemented by Source and Sink GstElement to unify 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.
Functions
GST_URI_TYPE_IS_VALID()
#define GST_URI_TYPE_IS_VALID(type) ((type) == GST_URI_SRC || (type) == GST_URI_SINK)
Tests if the type direction is valid.
gst_uri_protocol_is_valid ()
gboolean
gst_uri_protocol_is_valid (const gchar *protocol
);
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.
gst_uri_protocol_is_supported ()
gboolean gst_uri_protocol_is_supported (const GstURIType type
,const gchar *protocol
);
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.
gst_uri_is_valid ()
gboolean
gst_uri_is_valid (const gchar *uri
);
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.
gst_uri_has_protocol ()
gboolean gst_uri_has_protocol (const gchar *uri
,const gchar *protocol
);
Checks if the protocol of a given valid URI matches protocol
.
gst_uri_get_protocol ()
gchar *
gst_uri_get_protocol (const gchar *uri
);
Extracts the protocol out of a given valid URI. The returned string must be
freed using g_free()
.
gst_uri_get_location ()
gchar *
gst_uri_get_location (const gchar *uri
);
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()
.
Free-function: g_free
Returns
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.
[transfer full][nullable]
gst_uri_construct ()
gchar * gst_uri_construct (const gchar *protocol
,const gchar *location
);
gst_uri_construct
is deprecated and should not be used in newly-written code.
Use GstURI instead.
Constructs a URI for a given valid protocol and location.
Free-function: g_free
gst_filename_to_uri ()
gchar * gst_filename_to_uri (const gchar *filename
,GError **error
);
Similar to g_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. |
[type filename] |
error |
pointer to error, or |
Returns
newly-allocated URI string, or NULL on error. The caller must
free the URI string with g_free()
when no longer needed.
gst_element_make_from_uri ()
GstElement * gst_element_make_from_uri (const GstURIType type
,const gchar *uri
,const gchar *elementname
,GError **error
);
Creates an element for handling the given URI.
gst_uri_handler_get_uri_type ()
GstURIType
gst_uri_handler_get_uri_type (GstURIHandler *handler
);
Gets the type of the given URI handler
Returns
the GstURIType of the URI handler.
Returns GST_URI_UNKNOWN if the handler
isn't implemented correctly.
gst_uri_handler_get_protocols ()
const gchar * const *
gst_uri_handler_get_protocols (GstURIHandler *handler
);
Gets the list of protocols supported by handler
. This list may not be
modified.
Returns
the
supported protocols. Returns NULL
if the handler
isn't
implemented properly, or the handler
doesn't support any
protocols.
[transfer none][element-type utf8][nullable]
gst_uri_handler_get_uri ()
gchar *
gst_uri_handler_get_uri (GstURIHandler *handler
);
Gets the currently handled URI.
Types and Values
struct GstURIHandlerInterface
struct GstURIHandlerInterface { GTypeInterface parent; /* vtable */ /* querying capabilities */ GstURIType (* get_type) (GType type); const gchar * const * (* get_protocols) (GType type); /* using the interface */ gchar * (* get_uri) (GstURIHandler * handler); gboolean (* set_uri) (GstURIHandler * handler, const gchar * uri, GError ** error); };
Any GstElement using this interface should implement these methods.
Members
GTypeInterface |
The parent interface type |
|
Method to tell whether the element handles source or sink URI. |
||
Method to return the list of protocols handled by the element. |
||
Method to return the URI currently handled by the element. |
||
Method to set a new URI. |
enum GstURIError
Different URI-related errors that can occur.