docs: convert NULL, TRUE, and FALSE to %NULL, %TRUE, and %FALSE
[platform/upstream/gstreamer.git] / gst / gstcapsfeatures.c
index b730827..e1e8f90 100644 (file)
  * structures with different feature sets to the caps.
  *
  * Empty #GstCapsFeatures are equivalent with the #GstCapsFeatures that only
- * contain #GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY.
+ * contain #GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY. ANY #GstCapsFeatures as
+ * created by gst_caps_features_new_any() are equal to any other #GstCapsFeatures
+ * and can be used to specify that any #GstCapsFeatures would be supported, e.g.
+ * for elements that don't touch buffer memory. #GstCaps with ANY #GstCapsFeatures
+ * are considered non-fixed and during negotiation some #GstCapsFeatures have
+ * to be selected.
  *
  * Examples for caps features would be the requirement of a specific #GstMemory
  * types or the requirement of having a specific #GstMeta on the buffer. Features
@@ -61,6 +66,7 @@ struct _GstCapsFeatures
 };
 
 GType _gst_caps_features_type = 0;
+static gint static_caps_features_parent_refcount = G_MAXINT;
 GstCapsFeatures *_gst_caps_features_any = NULL;
 GstCapsFeatures *_gst_caps_features_memory_system_memory = NULL;
 static GQuark _gst_caps_feature_memory_system_memory = 0;
@@ -79,6 +85,9 @@ gst_caps_features_transform_to_string (const GValue * src_value,
 void
 _priv_gst_caps_features_initialize (void)
 {
+  GST_DEBUG_CATEGORY_INIT (gst_caps_features_debug, "caps-features", 0,
+      "GstCapsFeatures debug");
+
   _gst_caps_features_type = gst_caps_features_get_type ();
   _gst_caps_feature_memory_system_memory =
       g_quark_from_static_string (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
@@ -87,11 +96,13 @@ _priv_gst_caps_features_initialize (void)
       gst_caps_features_transform_to_string);
 
   _gst_caps_features_any = gst_caps_features_new_any ();
+  gst_caps_features_set_parent_refcount (_gst_caps_features_any,
+      &static_caps_features_parent_refcount);
   _gst_caps_features_memory_system_memory =
       gst_caps_features_new_id (_gst_caps_feature_memory_system_memory, 0);
-
-  GST_DEBUG_CATEGORY_INIT (gst_caps_features_debug, "caps-features", 0,
-      "GstCapsFeatures debug");
+  gst_caps_features_set_parent_refcount
+      (_gst_caps_features_memory_system_memory,
+      &static_caps_features_parent_refcount);
 }
 
 gboolean
@@ -192,7 +203,7 @@ gst_caps_features_new_any (void)
  * @...: additional features
  *
  * Creates a new #GstCapsFeatures with the given features.
- * The last argument must be NULL.
+ * The last argument must be %NULL.
  *
  * Free-function: gst_caps_features_free
  *
@@ -367,6 +378,7 @@ gst_caps_features_copy (const GstCapsFeatures * features)
   n = gst_caps_features_get_size (features);
   for (i = 0; i < n; i++)
     gst_caps_features_add_id (copy, gst_caps_features_get_nth_id (features, i));
+  copy->is_any = features->is_any;
 
   return copy;
 }
@@ -405,7 +417,7 @@ gst_caps_features_free (GstCapsFeatures * features)
  * |[
  * GST_LOG ("features is %" GST_PTR_FORMAT, features);
  * ]|
- * This prints the features in human readble form.
+ * This prints the features in human readable form.
  *
  * Free-function: g_free
  *
@@ -459,7 +471,7 @@ priv_gst_caps_features_append_to_gstring (const GstCapsFeatures * features,
  *
  * Free-function: gst_caps_features_free
  *
- * Returns: (transfer full): a new #GstCapsFeatures or NULL when the string could
+ * Returns: (transfer full): a new #GstCapsFeatures or %NULL when the string could
  *     not be parsed. Free with gst_caps_features_free() after use.
  *
  * Since: 1.2