gstpad: Probes that return HANDLED can reset the data info field
[platform/upstream/gstreamer.git] / gst / gsturi.c
index d1da2a1..a5b7190 100644 (file)
@@ -397,7 +397,7 @@ gst_uri_is_valid (const gchar * uri)
  * Extracts the protocol out of a given valid URI. The returned string must be
  * freed using g_free().
  *
- * Returns: The protocol for this URI.
+ * Returns: (nullable): The protocol for this URI.
  */
 gchar *
 gst_uri_get_protocol (const gchar * uri)
@@ -449,9 +449,9 @@ gst_uri_has_protocol (const gchar * uri, const gchar * protocol)
  *
  * Free-function: g_free
  *
- * Returns: (transfer full): 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.
+ * Returns: (transfer full) (nullable): 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.
  */
 gchar *
 gst_uri_get_location (const gchar * uri)
@@ -487,10 +487,6 @@ gst_uri_get_location (const gchar * uri)
   return unescaped;
 }
 
-#ifdef GST_DISABLE_DEPRECATED
-gchar *gst_uri_construct (const gchar * protocol, const gchar * location);
-#endif
-
 /**
  * gst_uri_construct:
  * @protocol: Protocol for URI
@@ -502,6 +498,8 @@ gchar *gst_uri_construct (const gchar * protocol, const gchar * location);
  *
  * Returns: (transfer full): a new string for this URI. Returns %NULL if the
  *     given URI protocol is not valid, or the given location is %NULL.
+ *
+ * Deprecated: Use GstURI instead.
  */
 #ifndef GST_REMOVE_DEPRECATED
 gchar *
@@ -620,7 +618,8 @@ gst_uri_protocol_is_supported (const GstURIType type, const gchar * protocol)
  *
  * Creates an element for handling the given URI.
  *
- * Returns: (transfer floating): a new element or %NULL if none could be created
+ * Returns: (transfer floating) (nullable): a new element or %NULL if none
+ * could be created
  */
 GstElement *
 gst_element_make_from_uri (const GstURIType type, const gchar * uri,
@@ -893,7 +892,7 @@ file_path_contains_relatives (const gchar * path)
 
 /**
  * gst_filename_to_uri:
- * @filename: absolute or relative file name path
+ * @filename: (type filename): absolute or relative file name path
  * @error: pointer to error, or %NULL
  *
  * Similar to g_filename_to_uri(), but attempts to handle relative file paths
@@ -958,7 +957,7 @@ beach:
  * @short_description: URI parsing and manipulation.
  *
  * A #GstUri object can be used to parse and split a URI string into its
- * constituant parts. Two #GstUri objects can be joined to make a new #GstUri
+ * constituent parts. Two #GstUri objects can be joined to make a new #GstUri
  * using the algorithm described in RFC3986.
  */
 
@@ -1015,6 +1014,10 @@ _gst_uri_free (GstUri * uri)
     g_hash_table_unref (uri->query);
   g_free (uri->fragment);
 
+#ifdef USE_POISONING
+  memset (uri, 0xff, sizeof (*uri));
+#endif
+
   g_slice_free1 (sizeof (*uri), uri);
 }
 
@@ -1501,7 +1504,7 @@ gst_uri_new_with_base (GstUri * base, const gchar * scheme,
  * Parses a URI string into a new #GstUri object. Will return NULL if the URI
  * cannot be parsed.
  *
- * Returns: (transfer full)(nullable): A new #GstUri object, or NULL.
+ * Returns: (transfer full) (nullable): A new #GstUri object, or NULL.
  *
  * Since: 1.6
  */
@@ -1763,16 +1766,16 @@ gst_uri_equal (const GstUri * first, const GstUri * second)
 
 /**
  * gst_uri_join:
- * @base_uri: (transfer none)(nullable): The base URI to join another to.
- * @ref_uri: (transfer none)(nullable): The reference URI to join onto the
- *                                        base URI.
+ * @base_uri: (transfer none) (nullable): The base URI to join another to.
+ * @ref_uri: (transfer none) (nullable): The reference URI to join onto the
+ *                                       base URI.
  *
  * Join a reference URI onto a base URI using the method from RFC 3986.
  * If either URI is %NULL then the other URI will be returned with the ref count
  * increased.
  *
- * Returns: (transfer full): A #GstUri which represents the base with the
- *                           reference URI joined on.
+ * Returns: (transfer full) (nullable): A #GstUri which represents the base
+ *                                      with the reference URI joined on.
  *
  * Since: 1.6
  */
@@ -2080,7 +2083,7 @@ gst_uri_normalize (GstUri * uri)
  * Get the scheme name from the URI or %NULL if it doesn't exist.
  * If @uri is %NULL then returns %NULL.
  *
- * Returns: The scheme from the #GstUri object or %NULL.
+ * Returns: (nullable): The scheme from the #GstUri object or %NULL.
  */
 const gchar *
 gst_uri_get_scheme (const GstUri * uri)
@@ -2120,7 +2123,7 @@ gst_uri_set_scheme (GstUri * uri, const gchar * scheme)
  * 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.
  *
- * Returns: The userinfo from the #GstUri object or %NULL.
+ * Returns: (nullable): The userinfo from the #GstUri object or %NULL.
  *
  * Since: 1.6
  */
@@ -2162,7 +2165,7 @@ gst_uri_set_userinfo (GstUri * uri, const gchar * userinfo)
  * Get the host name from the URI or %NULL if it doesn't exist.
  * If @uri is %NULL then returns %NULL.
  *
- * Returns: The host name from the #GstUri object or %NULL.
+ * Returns: (nullable): The host name from the #GstUri object or %NULL.
  *
  * Since: 1.6
  */
@@ -2244,8 +2247,8 @@ gst_uri_set_port (GstUri * uri, guint port)
  *
  * Extract the path string from the URI object.
  *
- * Returns: (transfer full): The path from the URI. Once finished with the
- *                           string should be g_free()'d.
+ * Returns: (transfer full) (nullable): The path from the URI. Once finished
+ *                                      with the string should be g_free()'d.
  *
  * Since: 1.6
  */
@@ -2278,7 +2281,7 @@ gst_uri_get_path (const GstUri * uri)
 
 /**
  * gst_uri_set_path:
- * @uri: (transfer none)(nullable): The #GstUri to modify.
+ * @uri: (transfer none) (nullable): The #GstUri to modify.
  * @path: The new path to set with path segments separated by '/', or use %NULL
  *        to unset the path.
  *
@@ -2307,8 +2310,8 @@ gst_uri_set_path (GstUri * uri, const gchar * path)
  *
  * Extract the path string from the URI object as a percent encoded URI path.
  *
- * Returns: (transfer full): The path from the URI. Once finished with the
- *                           string should be g_free()'d.
+ * Returns: (transfer full) (nullable): The path from the URI. Once finished
+ *                                      with the string should be g_free()'d.
  *
  * Since: 1.6
  */
@@ -2372,7 +2375,7 @@ gst_uri_set_path_string (GstUri * uri, const gchar * path)
  *
  * Get a list of path segments from the URI.
  *
- * Returns: (transfer full)(element-type gchar*): A #GList of path segment
+ * Returns: (transfer full) (element-type gchar*): A #GList of path segment
  *          strings or %NULL if no path segments are available. Free the list
  *          when no longer needed with g_list_free_full(list, g_free).
  *
@@ -2494,8 +2497,8 @@ gst_uri_append_path_segment (GstUri * uri, const gchar * path_segment)
  *
  * Get a percent encoded URI query string from the @uri.
  *
- * Returns: (transfer full): A percent encoded query string. Use g_free() when
- *          no longer needed.
+ * Returns: (transfer full) (nullable): A percent encoded query string. Use
+ *                                      g_free() when no longer needed.
  *
  * Since: 1.6
  */
@@ -2570,8 +2573,8 @@ gst_uri_set_query_string (GstUri * uri, const gchar * query)
  * no longer required. Modifying this hash table will modify the query in the
  * URI.
  *
- * Returns: (transfer full)(element-type gchar* gchar*): The query hash table
- *          from the URI.
+ * Returns: (transfer full) (element-type gchar* gchar*) (nullable): The query
+ *          hash table from the URI.
  *
  * Since: 1.6
  */
@@ -2597,7 +2600,7 @@ gst_uri_get_query_table (const GstUri * uri)
  * reference to the new one is used instead. A value if %NULL for @query_table
  * will remove the query string from the URI.
  *
- * Returns: %TRUE if the new table was sucessfully used for the query table.
+ * Returns: %TRUE if the new table was successfully used for the query table.
  *
  * Since: 1.6
  */
@@ -2631,7 +2634,7 @@ gst_uri_set_query_table (GstUri * uri, GHashTable * query_table)
  * indicates that the key has no associated value, but will still be present in
  * the query string.
  *
- * Returns: %TRUE if the query table was sucessfully updated.
+ * Returns: %TRUE if the query table was successfully updated.
  *
  * Since: 1.6
  */
@@ -2718,7 +2721,7 @@ gst_uri_query_has_key (const GstUri * uri, const gchar * query_key)
  * use gst_uri_query_has_key() to determine if a key is present in the URI
  * query.
  *
- * Returns: The value for the given key, or %NULL if not found.
+ * Returns: (nullable): The value for the given key, or %NULL if not found.
  *
  * Since: 1.6
  */
@@ -2740,7 +2743,7 @@ gst_uri_get_query_value (const GstUri * uri, const gchar * query_key)
  *
  * Get a list of the query keys from the URI.
  *
- * Returns: (transfer container)(element-type gchar*): A list of keys from
+ * Returns: (transfer container) (element-type gchar*): A list of keys from
  *          the URI query. Free the list with g_list_free().
  *
  * Since: 1.6
@@ -2764,7 +2767,7 @@ gst_uri_get_query_keys (const GstUri * uri)
  * Get the fragment name from the URI or %NULL if it doesn't exist.
  * If @uri is %NULL then returns %NULL.
  *
- * Returns: The host name from the #GstUri object or %NULL.
+ * Returns: (nullable): The host name from the #GstUri object or %NULL.
  *
  * Since: 1.6
  */
@@ -2806,7 +2809,7 @@ gst_uri_set_fragment (GstUri * uri, const gchar * fragment)
  * 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 splitted by "=" sub-delims. The "key" returned by this API may
+ * 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
@@ -2815,8 +2818,8 @@ gst_uri_set_fragment (GstUri * uri, const gchar * fragment)
  *
  * See more about Media Fragments URI 1.0 (W3C) at https://www.w3.org/TR/media-frags/
  *
- * Returns: (transfer full)(element-type gchar* gchar*): The fragment hash table
- *          from the URI.
+ * Returns: (transfer full) (element-type gchar* gchar*) (nullable): The
+ *          fragment hash table from the URI.
  *
  * Since: 1.12
  */