}
/* creation/deletion */
+
+/**
+ * gst_caps_new_empty:
+ *
+ * Creates a new #GstCaps that is empty. That is, the returned
+ * #GstCaps contains no media formats.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_new_empty (void)
{
GstCaps *caps = g_new0(GstCaps, 1);
return caps;
}
+/**
+ * gst_caps_new_empty:
+ *
+ * Creates a new #GstCaps that indicates that it is compatible with
+ * any media format.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_new_any (void)
{
GstCaps *caps = g_new0(GstCaps, 1);
return caps;
}
+/**
+ * gst_caps_new_simple:
+ * @media_type: the media type of the structure
+ * @...: additional arguments
+ *
+ * Creates a new #GstCaps that contains one #GstStructure. The
+ * structure is defined by the arguments, which have the same format
+ * as @gst_structure_new().
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_new_simple (const char *media_type, const char *fieldname,
...)
{
return caps;
}
+/**
+ * gst_caps_new_full:
+ * @struct1: the first structure to add
+ * @...: additional structures to add
+ *
+ * Creates a new #GstCaps and adds all the structures listed as
+ * arguments. The list must be NULL-terminated. The structures
+ * are not copied; the returned #GstCaps owns the structures.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_new_full (GstStructure *struct1, ...)
{
GstCaps *caps;
return caps;
}
+/**
+ * gst_caps_new_full_valist:
+ * @struct1: the first structure to add
+ * @var_args: additional structures to add
+ *
+ * Creates a new #GstCaps and adds all the structures listed as
+ * arguments. The list must be NULL-terminated. The structures
+ * are not copied; the returned #GstCaps owns the structures.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_new_full_valist (GstStructure *structure,
va_list var_args)
{
return caps;
}
+/**
+ * gst_caps_copy:
+ * @caps: the #GstCaps to copy
+ *
+ * Deeply copies a #GstCaps, including all structures and all the
+ * structures' values.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_copy (const GstCaps *caps)
{
GstCaps *newcaps;
return newcaps;
}
+/**
+ * gst_caps_free:
+ * @caps: the #GstCaps to free
+ *
+ * Frees a #GstCaps and all its structures and the structures'
+ * values.
+ */
void gst_caps_free (GstCaps *caps)
{
GstStructure *structure;
g_free(caps);
}
+/**
+ * gst_static_caps_get:
+ * @static_caps: the #GstStaticCaps to convert
+ *
+ * Converts a #GstStaticCaps to a #GstCaps.
+ *
+ * Returns: the new #GstCaps
+ */
const GstCaps *gst_static_caps_get (GstStaticCaps *static_caps)
{
GstCaps *caps = (GstCaps *)static_caps;
}
/* manipulation */
+
+/**
+ * gst_caps_append:
+ * @caps1: the #GstCaps that will be appended to
+ * @caps2: the #GstCaps to append
+ *
+ * Appends the structures contained in @caps2 to @caps1. The structures
+ * in @caps2 are not copied -- they are transferred to @caps1, and then
+ * @caps2 is freed.
+ */
void gst_caps_append (GstCaps *caps1, GstCaps *caps2)
{
GstStructure *structure;
g_free(caps2);
}
+/**
+ * gst_caps_append_structure:
+ * @caps: the #GstCaps that will be appended to
+ * @structure: the #GstStructure to append
+ *
+ * Appends @structure to @caps1. The structure is not copied; @caps1
+ * becomes the owner of @structure.
+ */
void gst_caps_append_structure (GstCaps *caps, GstStructure *structure)
{
g_return_if_fail(caps != NULL);
if (structure){
-#if 0 /* disable this, since too many plugins rely on undefined behavior */
+#if 0
#ifdef USE_POISONING
STRUCTURE_POISON (structure);
#endif
}
}
+/**
+ * gst_caps_split_one:
+ * @caps:
+ *
+ * Returns:
+ */
GstCaps *gst_caps_split_one (GstCaps *caps)
{
/* FIXME */
return NULL;
}
+/**
+ * gst_caps_split_one:
+ * @caps: a #GstCaps
+ *
+ * Returns: the number of structures that @caps contains
+ */
int gst_caps_get_size (const GstCaps *caps)
{
g_return_val_if_fail (caps != NULL, 0);
return caps->structs->len;
}
+/**
+ * gst_caps_get_structure:
+ * @caps: a #GstCaps
+ * @index: the index of the structure
+ *
+ * Finds the structure in @caps that has the index @index, and
+ * returns it.
+ *
+ * WARNING: This function takes a const GstCaps *, but returns a
+ * non-const GstStructure *. This is for programming convenience --
+ * the caller should be aware that structures inside a constant
+ * @GstCaps should not be modified.
+ *
+ * Returns: a pointer to the #GstStructure corresponding to @index
+ */
GstStructure *gst_caps_get_structure (const GstCaps *caps, int index)
{
g_return_val_if_fail (caps != NULL, NULL);
return g_ptr_array_index(caps->structs, index);
}
+/**
+ * gst_caps_copy_1:
+ * @caps: the @GstCaps to copy
+ *
+ * Creates a new @GstCaps and appends a copy of the first structure
+ * contained in @caps.
+ *
+ * Returns: the new @GstCaps
+ */
GstCaps *gst_caps_copy_1 (const GstCaps *caps)
{
GstCaps *newcaps;
return newcaps;
}
+/**
+ * gst_caps_set_simple:
+ * @caps: the @GstCaps to set
+ * @field: first field to set
+ * @...: additional parameters
+ *
+ * Sets fields in a simple #GstCaps. A simple #GstCaps is one that
+ * only has one structure. The arguments must be passed in the same
+ * manner as @gst_structure_set(), and be NULL-terminated.
+ */
void gst_caps_set_simple (GstCaps *caps, char *field, ...)
{
GstStructure *structure;
va_end(var_args);
}
+/**
+ * gst_caps_set_simple_valist:
+ * @caps: the @GstCaps to copy
+ * @field: first field to set
+ * @varargs: additional parameters
+ *
+ * Sets fields in a simple #GstCaps. A simple #GstCaps is one that
+ * only has one structure. The arguments must be passed in the same
+ * manner as @gst_structure_set(), and be NULL-terminated.
+ */
void gst_caps_set_simple_valist (GstCaps *caps, char *field, va_list varargs)
{
GstStructure *structure;
}
/* tests */
+
+/**
+ * gst_caps_is_any:
+ * @caps: the @GstCaps to test
+ *
+ * Returns: TRUE if @caps represents any format.
+ */
gboolean gst_caps_is_any (const GstCaps *caps)
{
g_return_val_if_fail(caps != NULL, FALSE);
return (caps->flags & GST_CAPS_FLAGS_ANY);
}
+/**
+ * gst_caps_is_empty:
+ * @caps: the @GstCaps to test
+ *
+ * Returns: TRUE if @caps represents no formats.
+ */
gboolean gst_caps_is_empty (const GstCaps *caps)
{
g_return_val_if_fail(caps != NULL, FALSE);
return (caps->structs == NULL) || (caps->structs->len == 0);
}
+/**
+ * gst_caps_is_chained:
+ * @caps: the @GstCaps to test
+ *
+ * Returns: TRUE if @caps contains more than one structure
+ */
gboolean gst_caps_is_chained (const GstCaps *caps)
{
g_return_val_if_fail(caps != NULL, FALSE);
return FALSE;
}
+/**
+ * gst_caps_is_fixed:
+ * @caps: the @GstCaps to test
+ *
+ * Fixed @GstCaps describe exactly one format, that is, they have exactly
+ * one structure, and each field in the structure describes a fixed type.
+ * Examples of non-fixed types are GST_TYPE_INT_RANGE and GST_TYPE_LIST.
+ *
+ * Returns: TRUE if @caps is fixed
+ */
gboolean gst_caps_is_fixed (const GstCaps *caps)
{
GstStructure *structure;
return FALSE;
}
+/**
+ * gst_caps_is_equal_fixed:
+ * @caps1: the #GstCaps to test
+ * @caps2: the #GstCaps to test
+ *
+ * Tests if two #GstCaps are equal. This function only works on fixed
+ * #GstCaps.
+ *
+ * Returns: TRUE if the arguments represent the same format
+ */
gboolean gst_caps_is_equal_fixed (const GstCaps *caps1, const GstCaps *caps2)
{
GstStructure *struct1, *struct2;
return FALSE;
}
+/**
+ * gst_caps_is_always_compatible
+ * @caps1: the #GstCaps to test
+ * @caps2: the #GstCaps to test
+ *
+ * Returns: TRUE if @caps1 is a subset of @caps2.
+ */
gboolean
gst_caps_is_always_compatible (const GstCaps *caps1, const GstCaps *caps2)
{
#endif
/* operations */
+
+/**
+ * gst_caps_intersect:
+ * @caps1: a #GstCaps to intersect
+ * @caps2: a #GstCaps to intersect
+ *
+ * Creates a new #GstCaps that contains all the formats that are common
+ * to both @caps1 and @caps2.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_intersect (const GstCaps *caps1, const GstCaps *caps2)
{
int i,j;
#endif
}
+/**
+ * gst_caps_union:
+ * @caps1: a #GstCaps to union
+ * @caps2: a #GstCaps to union
+ *
+ * Creates a new #GstCaps that contains all the formats that are in
+ * either @caps1 and @caps2.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_union (const GstCaps *caps1, const GstCaps *caps2)
{
GstCaps *dest1;
dest2 = gst_caps_copy (caps2);
gst_caps_append (dest1, dest2);
-
/* FIXME: need a simplify function */
return dest1;
return TRUE;
}
+/**
+ * gst_caps_normalize:
+ * @caps: a #GstCaps to normalize
+ *
+ * Creates a new #GstCaps that represents the same set of formats as
+ * @caps, but contains no lists. Each list is expanded into separate
+ * @GstStructures.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_normalize (const GstCaps *caps)
{
NormalizeForeach nf;
return gst_structure_foreach (struct1, simplify_foreach, (void *)struct2);
}
+/**
+ * gst_caps_simplify:
+ * @caps: a #GstCaps to simplify
+ *
+ * Creates a new #GstCaps that represents the same set of formats as
+ * @caps, but simpler. Component structures that are identical are
+ * merged. Component structures that have ranges or lists that can
+ * be merged are also merged.
+ *
+ * Returns: the new #GstCaps
+ */
GstCaps *gst_caps_simplify (const GstCaps *caps)
{
int i;
#endif
/* utility */
+
+/**
+ * gst_caps_replace:
+ * @caps: a pointer to #GstCaps
+ * @newcaps: a #GstCaps to replace *caps
+ *
+ * Replaces *caps with @newcaps. Frees the #GstCaps in the location
+ * pointed to by @caps, if applicable, then modifies @caps to point to
+ * @newcaps.
+ */
void gst_caps_replace (GstCaps **caps, GstCaps *newcaps)
{
#if 0 /* disable this, since too many plugins rely on undefined behavior */
*caps = newcaps;
}
+/**
+ * gst_caps_to_string:
+ * @caps: a #GstCaps
+ *
+ * Converts @caps to a string representation. This string representation
+ * can be converted back to a #GstCaps by #gst_caps_from_string().
+ *
+ * Returns: a string representing @caps
+ */
gchar *gst_caps_to_string (const GstCaps *caps)
{
int i;
return TRUE;
}
+/**
+ * gst_caps_from_string:
+ * @caps: a string to convert to #GstCaps
+ *
+ * Converts @caps from a string representation.
+ *
+ * Returns: a new #GstCaps
+ */
GstCaps *gst_caps_from_string (const gchar *string)
{
GstCaps *caps;