[farsight2/master] Add new fs_codec_list_are_equal() function
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:22:19 PST 2008
---
docs/libs/farsight2-libs-sections.txt | 5 +++--
gst-libs/gst/farsight/fs-codec.c | 29 +++++++++++++++++++++++++++++
gst-libs/gst/farsight/fs-codec.h | 2 ++
3 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt
index 9afa044..3d1526c 100644
--- a/docs/libs/farsight2-libs-sections.txt
+++ b/docs/libs/farsight2-libs-sections.txt
@@ -112,11 +112,12 @@ FS_CODEC_ID_DISABLE
fs_codec_new
fs_codec_destroy
fs_codec_copy
+fs_codec_are_equal
+fs_codec_list_from_keyfile
fs_codec_list_destroy
fs_codec_list_copy
-fs_codec_list_from_keyfile
+fs_codec_list_are_equal
fs_codec_to_string
-fs_codec_are_equal
fs_codec_to_gst_caps
<SUBSECTION Standard>
FS_TYPE_CODEC
diff --git a/gst-libs/gst/farsight/fs-codec.c b/gst-libs/gst/farsight/fs-codec.c
index 9d5886e..a285a13 100644
--- a/gst-libs/gst/farsight/fs-codec.c
+++ b/gst-libs/gst/farsight/fs-codec.c
@@ -605,3 +605,32 @@ fs_codec_to_gst_caps (const FsCodec *codec)
return caps;
}
+
+
+/**
+ * fs_codec_list_are_equal:
+ * @list1: a #GList of #FsCodec
+ * @list2: a #GList of #FsCodec
+ *
+ * Verifies if two glist of fscodecs are identical
+ *
+ * Returns: %TRUE if they are identical, %FALSE otherwise
+ */
+
+gboolean
+fs_codec_list_are_equal (GList *list1, GList *list2)
+{
+
+ for (;
+ list1 && list2;
+ list1 = g_list_next (list1), list2 = g_list_next (list2))
+ {
+ if (!fs_codec_are_equal (list1->data, list2->data))
+ return FALSE;
+ }
+
+ if (list1 == NULL && list2 == NULL)
+ return TRUE;
+ else
+ return FALSE;
+}
diff --git a/gst-libs/gst/farsight/fs-codec.h b/gst-libs/gst/farsight/fs-codec.h
index e922e77..88ab580 100644
--- a/gst-libs/gst/farsight/fs-codec.h
+++ b/gst-libs/gst/farsight/fs-codec.h
@@ -131,6 +131,8 @@ gboolean fs_codec_are_equal (const FsCodec *codec1, const FsCodec *codec2);
GstCaps *fs_codec_to_gst_caps (const FsCodec *codec);
+gboolean fs_codec_list_are_equal (GList *list1, GList *list2);
+
const gchar *fs_media_type_to_string (FsMediaType media_type);
G_END_DECLS
--
1.5.6.5
More information about the farsight-commits
mailing list