diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-08-30 22:20:55 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-08-31 08:14:11 +0200 |
commit | 53128c5b4f746da79b8eef3b2284ddc3a6d64b78 (patch) | |
tree | 058aad8796fbdf9aa61394619014f9591aaade6a | |
parent | 182e751b5d3e3963883b3edc17a105012984a6c0 (diff) | |
download | gstreamer-plugins-bad-53128c5b4f746da79b8eef3b2284ddc3a6d64b78.tar.gz |
mxf: Unconditionally use GLib 2.16 API
-rw-r--r-- | gst/mxf/mxfdemux.c | 42 | ||||
-rw-r--r-- | gst/mxf/mxfmetadata.c | 72 | ||||
-rw-r--r-- | gst/mxf/mxftypes.c | 16 |
3 files changed, 1 insertions, 129 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index e646be8cc..ce1a1d381 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -483,32 +483,11 @@ gst_mxf_demux_handle_primer_pack (GstMXFDemux * demux, const MXFUL * key, return GST_FLOW_OK; } -#if !GLIB_CHECK_VERSION (2, 16, 0) -static void -set_resolve_state_none (gpointer key, gpointer value, gpointer user_data) -{ - MXFMetadataBase *m = (MXFMetadataBase *) value; - m->resolved = MXF_METADATA_BASE_RESOLVE_STATE_NONE; -} - -static void -build_values_in_hash_table (gpointer key, gpointer value, gpointer user_data) -{ - GList **valuelist = (GList **) (user_data); - - *valuelist = g_list_prepend (*valuelist, value); -} -#endif - static GstFlowReturn gst_mxf_demux_resolve_references (GstMXFDemux * demux) { GstFlowReturn ret = GST_FLOW_OK; -#if GLIB_CHECK_VERSION (2, 16, 0) GHashTableIter iter; -#else - GList *l, *values = NULL; -#endif MXFMetadataBase *m = NULL; GstStructure *structure; GstTagList *taglist; @@ -523,26 +502,15 @@ gst_mxf_demux_resolve_references (GstMXFDemux * demux) g_static_rw_lock_writer_unlock (&demux->metadata_lock); return GST_FLOW_ERROR; } -#if GLIB_CHECK_VERSION (2, 16, 0) + g_hash_table_iter_init (&iter, demux->metadata); while (g_hash_table_iter_next (&iter, NULL, (gpointer) & m)) { m->resolved = MXF_METADATA_BASE_RESOLVE_STATE_NONE; } -#else - g_hash_table_foreach (demux->metadata, set_resolve_state_none, NULL); -#endif -#if GLIB_CHECK_VERSION (2, 16, 0) g_hash_table_iter_init (&iter, demux->metadata); while (g_hash_table_iter_next (&iter, NULL, (gpointer) & m)) { gboolean resolved; -#else - g_hash_table_foreach (demux->metadata, build_values_in_hash_table, &values); - for (l = values; l; l = l->next) { - gboolean resolved; - - m = l->data; -#endif resolved = mxf_metadata_base_resolve (m, demux->metadata); @@ -564,19 +532,11 @@ gst_mxf_demux_resolve_references (GstMXFDemux * demux) gst_element_found_tags (GST_ELEMENT (demux), taglist); gst_structure_free (structure); -#if !GLIB_CHECK_VERSION (2, 16, 0) - g_list_free (values); -#endif - g_static_rw_lock_writer_unlock (&demux->metadata_lock); return ret; error: -#if !GLIB_CHECK_VERSION (2, 16, 0) - g_list_free (values); -#endif - demux->metadata_resolved = FALSE; g_static_rw_lock_writer_unlock (&demux->metadata_lock); diff --git a/gst/mxf/mxfmetadata.c b/gst/mxf/mxfmetadata.c index 7d1af0c1e..b55bf0d00 100644 --- a/gst/mxf/mxfmetadata.c +++ b/gst/mxf/mxfmetadata.c @@ -62,15 +62,6 @@ mxf_metadata_base_resolve_default (MXFMetadataBase * self, return TRUE; } -#if !GLIB_CHECK_VERSION (2, 16, 0) -static void -build_values_in_hash_table (gpointer key, gpointer value, gpointer user_data) -{ - GList **valuelist = (GList **) (user_data); - *valuelist = g_list_prepend (*valuelist, value); -} -#endif - static GstStructure * mxf_metadata_base_to_structure_default (MXFMetadataBase * self) { @@ -100,26 +91,12 @@ mxf_metadata_base_to_structure_default (MXFMetadataBase * self) GValue v = { 0, }; GstStructure *s; GstBuffer *buf; -#if GLIB_CHECK_VERSION (2, 16, 0) GHashTableIter iter; g_hash_table_iter_init (&iter, self->other_tags); -#else - GList *l, *values = NULL; - - g_hash_table_foreach (self->other_tags, build_values_in_hash_table, - &values); -#endif - g_value_init (&va, GST_TYPE_ARRAY); -#if GLIB_CHECK_VERSION (2, 16, 0) while (g_hash_table_iter_next (&iter, NULL, (gpointer) & tag)) { -#else - for (l = values; l; l = l->next) { - tag = l->data; -#endif - g_value_init (&v, GST_TYPE_STRUCTURE); s = gst_structure_id_empty_new (MXF_QUARK (TAG)); @@ -140,10 +117,6 @@ mxf_metadata_base_to_structure_default (MXFMetadataBase * self) gst_structure_id_set_value (ret, MXF_QUARK (OTHER_TAGS), &va); g_value_unset (&va); - -#if !GLIB_CHECK_VERSION (2, 16, 0) - g_list_free (values); -#endif } return ret; @@ -261,22 +234,11 @@ mxf_metadata_base_to_buffer (MXFMetadataBase * self, MXFPrimerPack * primer) /* Add unknown tags */ if (self->other_tags) { MXFLocalTag *tmp; -#if GLIB_CHECK_VERSION (2, 16, 0) GHashTableIter iter; g_hash_table_iter_init (&iter, self->other_tags); -#else - GList *l, *values; - - values = g_hash_table_get_values (self->other_tags); -#endif -#if GLIB_CHECK_VERSION (2, 16, 0) while (g_hash_table_iter_next (&iter, NULL, (gpointer) & t)) { -#else - for (l = values; l; l = l->next) { - t = l->data; -#endif tmp = g_slice_dup (MXFLocalTag, t); if (t->g_slice) { tmp->data = g_slice_alloc (t->size); @@ -287,10 +249,6 @@ mxf_metadata_base_to_buffer (MXFMetadataBase * self, MXFPrimerPack * primer) } tags = g_list_prepend (tags, tmp); } - -#if !GLIB_CHECK_VERSION (2, 16, 0) - g_list_free (values); -#endif } l = g_list_last (tags); @@ -1646,22 +1604,11 @@ mxf_metadata_essence_container_data_resolve (MXFMetadataBase * m, MXFMetadataEssenceContainerData *self = MXF_METADATA_ESSENCE_CONTAINER_DATA (m); MXFMetadataBase *current = NULL; -#if GLIB_CHECK_VERSION (2, 16, 0) GHashTableIter iter; g_hash_table_iter_init (&iter, metadata); -#else - GList *l, *values = NULL; - g_hash_table_foreach (metadata, build_values_in_hash_table, &values); -#endif - -#if GLIB_CHECK_VERSION (2, 16, 0) while (g_hash_table_iter_next (&iter, NULL, (gpointer) & current)) { -#else - for (l = values; l; l = l->next) { - current = l->data; -#endif if (MXF_IS_METADATA_SOURCE_PACKAGE (current)) { MXFMetadataSourcePackage *package = MXF_METADATA_SOURCE_PACKAGE (current); @@ -1675,10 +1622,6 @@ mxf_metadata_essence_container_data_resolve (MXFMetadataBase * m, } } -#if !GLIB_CHECK_VERSION (2, 16, 0) - g_list_free (values); -#endif - if (!self->linked_package) { GST_ERROR ("Couldn't resolve a package"); return FALSE; @@ -3390,22 +3333,11 @@ mxf_metadata_source_clip_resolve (MXFMetadataBase * m, GHashTable * metadata) { MXFMetadataSourceClip *self = MXF_METADATA_SOURCE_CLIP (m); MXFMetadataBase *current = NULL; -#if GLIB_CHECK_VERSION (2, 16, 0) GHashTableIter iter; g_hash_table_iter_init (&iter, metadata); -#else - GList *l, *values = NULL; - - g_hash_table_foreach (metadata, build_values_in_hash_table, &values); -#endif -#if GLIB_CHECK_VERSION (2, 16, 0) while (g_hash_table_iter_next (&iter, NULL, (gpointer) & current)) { -#else - for (l = values; l; l = l->next) { - current = l->data; -#endif if (MXF_IS_METADATA_SOURCE_PACKAGE (current)) { MXFMetadataGenericPackage *p = MXF_METADATA_GENERIC_PACKAGE (current); @@ -3416,10 +3348,6 @@ mxf_metadata_source_clip_resolve (MXFMetadataBase * m, GHashTable * metadata) } } -#if !GLIB_CHECK_VERSION (2, 16, 0) - g_list_free (values); -#endif - return MXF_METADATA_BASE_CLASS (mxf_metadata_source_clip_parent_class)->resolve (m, metadata); diff --git a/gst/mxf/mxftypes.c b/gst/mxf/mxftypes.c index b79e071e9..bacb793f4 100644 --- a/gst/mxf/mxftypes.c +++ b/gst/mxf/mxftypes.c @@ -1458,32 +1458,16 @@ mxf_primer_pack_to_buffer (const MXFPrimerPack * pack) if (pack->mappings) { guint local_tag; MXFUL *ul; -#if GLIB_CHECK_VERSION (2, 16, 0) GHashTableIter iter; g_hash_table_iter_init (&iter, pack->mappings); -#else - GList *l, *keys; - - keys = g_hash_table_get_keys (pack->mappings); -#endif -#if GLIB_CHECK_VERSION (2, 16, 0) while (g_hash_table_iter_next (&iter, (gpointer) & local_tag, (gpointer) & ul)) { -#else - for (l = keys; l; l = l->next) { - local_tag = GPOINTER_TO_UINT (l->data); - ul = g_hash_table_lookup (pack->mappings, GUINT_TO_POINTER (local_tag)); -#endif GST_WRITE_UINT16_BE (data, local_tag); memcpy (data + 2, ul, 16); data += 18; } - -#if !GLIB_CHECK_VERSION (2, 16, 0) - g_list_free (keys); -#endif } return ret; |