diff options
author | Stefan Kost <ensonic@users.sf.net> | 2010-05-14 11:52:03 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2010-05-14 11:54:56 +0300 |
commit | e8c2c40b216a766b75f2ca09b02da8ae352e79e8 (patch) | |
tree | 16ab442b9b51cf5b929cd89a629f88e3eca091ae | |
parent | beb24d05af4bfca7a1460b41fb796bac193d262b (diff) |
caps: comment and whitespace cleanup
Make comment more specific, reposition it and add more of the kind.
Move one ifdef'ed function around.
-rw-r--r-- | gst/gstcaps.c | 95 |
1 files changed, 51 insertions, 44 deletions
diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 9c0c0e81af..c82c6be575 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -512,6 +512,7 @@ no_string: } /* manipulation */ + static GstStructure * gst_caps_remove_and_get_structure (GstCaps * caps, guint idx) { @@ -782,7 +783,6 @@ gst_caps_merge_structure (GstCaps * caps, GstStructure * structure) } } - /** * gst_caps_get_size: * @caps: a #GstCaps @@ -1171,6 +1171,8 @@ gst_caps_is_equal (const GstCaps * caps1, const GstCaps * caps2) return gst_caps_is_subset (caps1, caps2) && gst_caps_is_subset (caps2, caps1); } +/* intersect operation */ + typedef struct { GstStructure *dest; @@ -1371,48 +1373,6 @@ gst_caps_can_intersect (const GstCaps * caps1, const GstCaps * caps2) return FALSE; } -#if 0 -static GstStructure * -gst_caps_structure_union (const GstStructure * struct1, - const GstStructure * struct2) -{ - int i; - GstStructure *dest; - const GstStructureField *field1; - const GstStructureField *field2; - int ret; - - /* FIXME this doesn't actually work */ - - if (struct1->name != struct2->name) - return NULL; - - dest = gst_structure_id_empty_new (struct1->name); - - for (i = 0; i < struct1->fields->len; i++) { - GValue dest_value = { 0 }; - - field1 = GST_STRUCTURE_FIELD (struct1, i); - field2 = gst_structure_id_get_field (struct2, field1->name); - - if (field2 == NULL) { - continue; - } else { - if (gst_value_union (&dest_value, &field1->value, &field2->value)) { - gst_structure_set_value (dest, g_quark_to_string (field1->name), - &dest_value); - } else { - ret = gst_value_compare (&field1->value, &field2->value); - } - } - } - - return dest; -} -#endif - -/* operations */ - /** * gst_caps_intersect: * @caps1: a #GstCaps to intersect @@ -1497,6 +1457,8 @@ gst_caps_intersect (const GstCaps * caps1, const GstCaps * caps2) return dest; } +/* subtract operation */ + typedef struct { const GstStructure *subtract_from; @@ -1504,7 +1466,6 @@ typedef struct } SubtractionEntry; - static gboolean gst_caps_structure_subtract_field (GQuark field_id, const GValue * value, gpointer user_data) @@ -1635,6 +1596,48 @@ gst_caps_subtract (const GstCaps * minuend, const GstCaps * subtrahend) return dest; } +/* union operation */ + +#if 0 +static GstStructure * +gst_caps_structure_union (const GstStructure * struct1, + const GstStructure * struct2) +{ + int i; + GstStructure *dest; + const GstStructureField *field1; + const GstStructureField *field2; + int ret; + + /* FIXME this doesn't actually work */ + + if (struct1->name != struct2->name) + return NULL; + + dest = gst_structure_id_empty_new (struct1->name); + + for (i = 0; i < struct1->fields->len; i++) { + GValue dest_value = { 0 }; + + field1 = GST_STRUCTURE_FIELD (struct1, i); + field2 = gst_structure_id_get_field (struct2, field1->name); + + if (field2 == NULL) { + continue; + } else { + if (gst_value_union (&dest_value, &field1->value, &field2->value)) { + gst_structure_set_value (dest, g_quark_to_string (field1->name), + &dest_value); + } else { + ret = gst_value_compare (&field1->value, &field2->value); + } + } + } + + return dest; +} +#endif + /** * gst_caps_union: * @caps1: a #GstCaps to union @@ -1672,6 +1675,8 @@ gst_caps_union (const GstCaps * caps1, const GstCaps * caps2) return dest1; } +/* normalize/simplify operations */ + typedef struct _NormalizeForeach { GstCaps *caps; @@ -1924,6 +1929,8 @@ gst_caps_do_simplify (GstCaps * caps) return TRUE; } +/* persistence */ + #ifndef GST_DISABLE_LOADSAVE /** * gst_caps_save_thyself: |