From dc7ec4448676279b0638306ca0be6bccec0e21dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 30 Oct 2011 10:05:23 +0000 Subject: [PATCH] taglist: make opaque Hide the fact that it's just a GstStructure from the API. We may want to change this in future (e.g. to add refcounting). Also, it caused problems for bindings (though that's mostly the way we typedefed it to GstStructure). --- gst/gsttaglist.c | 21 +++++++++++++++------ gst/gsttaglist.h | 13 ------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/gst/gsttaglist.c b/gst/gsttaglist.c index fe4ef58..5c8c020 100644 --- a/gst/gsttaglist.c +++ b/gst/gsttaglist.c @@ -42,12 +42,20 @@ #include "gstvalue.h" #include "gstbuffer.h" #include "gstquark.h" +#include "gststructure.h" #include #include #define GST_TAG_IS_VALID(tag) (gst_tag_get_info (tag) != NULL) +/* FIXME 0.11: make taglists refcounted maybe? */ +/* a tag list is basically a structure, but we don't make this fact public */ +struct _GstTagList +{ + GstStructure structure; +}; + /* FIXME 0.11: use GParamSpecs or something similar for tag registrations, * possibly even gst_tag_register(). Especially value ranges might be * useful for some tags. */ @@ -845,15 +853,16 @@ gst_is_tag_list (gconstpointer p) typedef struct { - GstStructure *list; + GstTagList *list; GstTagMergeMode mode; } GstTagCopyData; static void -gst_tag_list_add_value_internal (GstStructure * list, GstTagMergeMode mode, +gst_tag_list_add_value_internal (GstTagList * tag_list, GstTagMergeMode mode, const gchar * tag, const GValue * value, GstTagInfo * info) { + GstStructure *list = GST_STRUCTURE (tag_list); const GValue *value2; GQuark tag_quark; @@ -945,10 +954,10 @@ gst_tag_list_insert (GstTagList * into, const GstTagList * from, g_return_if_fail (GST_IS_TAG_LIST (from)); g_return_if_fail (GST_TAG_MODE_IS_VALID (mode)); - data.list = (GstStructure *) into; + data.list = into; data.mode = mode; if (mode == GST_TAG_MERGE_REPLACE_ALL) { - gst_structure_remove_all_fields (data.list); + gst_structure_remove_all_fields (GST_STRUCTURE (data.list)); } gst_structure_foreach ((GstStructure *) from, gst_tag_list_copy_foreach, &data); @@ -1120,7 +1129,7 @@ gst_tag_list_add_valist (GstTagList * list, GstTagMergeMode mode, g_return_if_fail (tag != NULL); if (mode == GST_TAG_MERGE_REPLACE_ALL) { - gst_structure_remove_all_fields (list); + gst_structure_remove_all_fields (GST_STRUCTURE (list)); } while (tag != NULL) { @@ -1164,7 +1173,7 @@ gst_tag_list_add_valist_values (GstTagList * list, GstTagMergeMode mode, g_return_if_fail (tag != NULL); if (mode == GST_TAG_MERGE_REPLACE_ALL) { - gst_structure_remove_all_fields (list); + gst_structure_remove_all_fields (GST_STRUCTURE (list)); } while (tag != NULL) { diff --git a/gst/gsttaglist.h b/gst/gsttaglist.h index 27faa66..aa6b8f5 100644 --- a/gst/gsttaglist.h +++ b/gst/gsttaglist.h @@ -25,7 +25,6 @@ #include #include -#include #include G_BEGIN_DECLS @@ -142,24 +141,12 @@ typedef enum { #define GST_TAG_FLAG_IS_VALID(flag) (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT)) -/* FIXME 0.11: Don't typedef GstTagList to be a GstStructure, they're - * internally the same but not from an API point of view. - * See bug #518934. - */ /** * GstTagList: * * Opaque #GstTagList data structure. */ -#ifdef _FOOL_GTK_DOC_ -typedef struct _GstTagList GstTagList; -#else -#ifdef IN_GOBJECT_INTROSPECTION typedef struct _GstTagList GstTagList; -#else -typedef GstStructure GstTagList; -#endif -#endif #define GST_TAG_LIST(x) ((GstTagList *) (x)) #define GST_IS_TAG_LIST(x) ((x) != NULL && gst_is_tag_list (GST_TAG_LIST (x))) -- 2.7.4