Creates a new #GstUri object with the given URI parts. The path and query strings will be broken down into their elements. All strings should not be escaped except where indicated.
The scheme for the new URI.
The user-info for the new URI.
The host name for the new URI.
The port number for the new URI or %GST_URI_NO_PORT.
The path for the new URI with '/' separating path elements.
The query string for the new URI with '&' separating query elements. Elements containing '&' characters should encode them as "%26".
The fragment name for the new URI.
Append a path onto the end of the path in the URI. The path is not normalized, call #gst_uri_normalize() to normalize the path.
Relative path to append to the end of the current path.
Append a single path segment onto the end of the URI path.
The path segment string to append to the URI path.
Get the fragment name from the URI or %NULL if it doesn't exist.
If uri
is %NULL then returns %NULL.
Get the host name from the URI or %NULL if it doesn't exist.
If uri
is %NULL then returns %NULL.
Get the media fragment table from the URI, as defined by "Media Fragments URI 1.0". Hash table returned by this API is a list of "key-value" pairs, and the each pair is generated by splitting "URI fragment" per "&" sub-delims, then "key" and "value" are split by "=" sub-delims. The "key" returned by this API may be undefined keyword by standard. A value may be %NULL to indicate that the key should appear in the fragment string in the URI, but does not have a value. Free the returned #GHashTable with #g_hash_table_unref() when it is no longer required. Modifying this hash table does not affect the fragment in the URI.
See more about Media Fragments URI 1.0 (W3C) at https://www.w3.org/TR/media-frags/
Extract the path string from the URI object.
Get a list of path segments from the URI.
Extract the path string from the URI object as a percent encoded URI path.
Get the port number from the URI or %GST_URI_NO_PORT if it doesn't exist.
If uri
is %NULL then returns %GST_URI_NO_PORT.
Get a list of the query keys from the URI.
Get a percent encoded URI query string from the uri
.
Get the query table from the URI. Keys and values in the table are freed with g_free when they are deleted. A value may be %NULL to indicate that the key should appear in the query string in the URI, but does not have a value. Free the returned #GHashTable with #g_hash_table_unref() when it is no longer required. Modifying this hash table will modify the query in the URI.
Get the value associated with the query_key
key. Will return %NULL if the
key has no value or if the key does not exist in the URI query table. Because
%NULL is returned for both missing keys and keys with no value, you should
use gst_uri_query_has_key() to determine if a key is present in the URI
query.
The key to lookup.
Get the scheme name from the URI or %NULL if it doesn't exist.
If uri
is %NULL then returns %NULL.
Get the userinfo (usually in the form "username:password") from the URI
or %NULL if it doesn't exist. If uri
is %NULL then returns %NULL.
Tests the uri
to see if it is normalized. A %NULL uri
is considered to be
normalized.
Check if it is safe to write to this #GstUri.
Check if the refcount of uri
is exactly 1, meaning that no other
reference exists to the #GstUri and that the #GstUri is therefore writable.
Modification of a #GstUri should only be done after verifying that it is writable.
Like gst_uri_new(), but joins the new URI onto a base URI.
The scheme for the new URI.
The user-info for the new URI.
The host name for the new URI.
The port number for the new URI or %GST_URI_NO_PORT.
The path for the new URI with '/' separating path elements.
The query string for the new URI with '&' separating query elements. Elements containing '&' characters should encode them as "%26".
The fragment name for the new URI.
Normalization will remove extra path segments ("." and "..") from the URI. It will also convert the scheme and host name to lower case and any percent-encoded values to uppercase.
The #GstUri object must be writable. Check with gst_uri_is_writable() or use gst_uri_make_writable() first.
Check if there is a query table entry for the query_key
key.
The key to lookup.
Remove an entry from the query table by key.
The key to remove.
Sets the fragment string in the URI. Use a value of %NULL in fragment
to
unset the fragment string.
The fragment string to set.
Set or unset the host for the URI.
The new host string to set or %NULL to unset.
Sets or unsets the path in the URI.
The new path to set with path segments separated by '/', or use %NULL to unset the path.
Replace the path segments list in the URI.
The new path list to set.
Sets or unsets the path in the URI.
The new percent encoded path to set with path segments separated by '/', or use %NULL to unset the path.
Set or unset the port number for the URI.
The new port number to set or %GST_URI_NO_PORT to unset.
Sets or unsets the query table in the URI.
The new percent encoded query string to use to populate the query table, or use %NULL to unset the query table.
Set the query table to use in the URI. The old table is unreferenced and a
reference to the new one is used instead. A value if %NULL for query_table
will remove the query string from the URI.
The new query table to use.
This inserts or replaces a key in the query table. A query_value
of %NULL
indicates that the key has no associated value, but will still be present in
the query string.
The key for the query entry.
The value for the key.
Set or unset the scheme for the URI.
The new scheme to set or %NULL to unset the scheme.
Set or unset the user information for the URI.
The new user-information string to set or %NULL to unset.
Convert the URI to a string.
Returns the URI as held in this object as a #gchar* nul-terminated string. The caller should g_free() the string once they are finished with it. The string is put together as described in RFC 3986.
Decrement the reference count to this #GstUri object.
If the reference count drops to 0 then finalize this object.
See gst_mini_object_unref() for further info.
Constructs a URI for a given valid protocol and location.
Free-function: g_free
Protocol for URI
Location for URI
Parses a URI string into a new #GstUri object. Will return NULL if the URI cannot be parsed. This is identical to gst_uri_from_string() except that the userinfo and fragment components of the URI will not be unescaped while parsing.
Use this when you need to extract a username and password from the userinfo such as https://user:password`example`.com since either may contain a URI-escaped ':' character. gst_uri_from_string() will unescape the entire userinfo component, which will make it impossible to know which ':' delineates the username and password.
The same applies to the fragment component of the URI, such as https://example.com/path#fragment which may contain a URI-escaped '#'.
The URI string to parse.
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
A URI string
Extracts the protocol out of a given valid URI. The returned string must be freed using g_free().
A URI string
Checks if the protocol of a given valid URI matches protocol
.
a URI string
a protocol string (e.g. "http")
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.
A URI string
This is a convenience function to join two URI strings and return the result. The returned string should be g_free()'d after use.
The percent-encoded base URI.
The percent-encoded reference URI to join to the base_uri
.
Creates a new #GstUri object with the given URI parts. The path and query strings will be broken down into their elements. All strings should not be escaped except where indicated.
The scheme for the new URI.
The user-info for the new URI.
The host name for the new URI.
The port number for the new URI or %GST_URI_NO_PORT.
The path for the new URI with '/' separating path elements.
The query string for the new URI with '&' separating query elements. Elements containing '&' characters should encode them as "%26".
The fragment name for the new URI.
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.
Whether to check for a source or a sink
Protocol that should be checked for (e.g. "http" or "smb")
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.
A string
A #GstUri object can be used to parse and split a URI string into its constituent parts. Two #GstUri objects can be joined to make a new #GstUri using the algorithm described in RFC3986.