From 9339a595839e5b78bc0921844d2d95f04b68d13b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 11 May 2011 19:10:24 +0200 Subject: [PATCH] meta: remove (de)serialize functions Add a GType to the metadata to identify the GstMetaInfo. We can remove the (de)serialize functions for the metadata because we can register GTtype transform functions between various types to implement serialization later. --- gst/gstmeta.c | 12 +++--------- gst/gstmeta.h | 25 +++---------------------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/gst/gstmeta.c b/gst/gstmeta.c index d874eefd84..ae0f77ea1a 100644 --- a/gst/gstmeta.c +++ b/gst/gstmeta.c @@ -54,10 +54,7 @@ _gst_meta_init (void) const GstMetaInfo * gst_meta_register (const gchar * api, const gchar * impl, gsize size, GstMetaInitFunction init_func, GstMetaFreeFunction free_func, - GstMetaCopyFunction copy_func, - GstMetaTransformFunction transform_func, - GstMetaSerializeFunction serialize_func, - GstMetaDeserializeFunction deserialize_func) + GstMetaCopyFunction copy_func, GstMetaTransformFunction transform_func) { GstMetaInfo *info; @@ -67,14 +64,12 @@ gst_meta_register (const gchar * api, const gchar * impl, gsize size, info = g_slice_new (GstMetaInfo); info->api = g_quark_from_string (api); - info->impl = g_quark_from_string (impl); + info->type = g_pointer_type_register_static (impl); info->size = size; info->init_func = init_func; info->free_func = free_func; info->copy_func = copy_func; info->transform_func = transform_func; - info->serialize_func = serialize_func; - info->deserialize_func = deserialize_func; GST_DEBUG ("register \"%s\" implementing \"%s\" of size %" G_GSIZE_FORMAT, api, impl, size); @@ -151,8 +146,7 @@ gst_meta_timing_get_info (void) (GstMetaInitFunction) NULL, (GstMetaFreeFunction) NULL, (GstMetaCopyFunction) meta_timing_copy, - (GstMetaTransformFunction) NULL, - (GstMetaSerializeFunction) NULL, (GstMetaDeserializeFunction) NULL); + (GstMetaTransformFunction) NULL); } return meta_info; } diff --git a/gst/gstmeta.h b/gst/gstmeta.h index a9e1dc123f..fe5a4aafae 100644 --- a/gst/gstmeta.h +++ b/gst/gstmeta.h @@ -83,45 +83,28 @@ typedef void (*GstMetaCopyFunction) (GstBuffer *dest, GstMeta *meta, typedef void (*GstMetaTransformFunction) (GstBuffer *transbuf, GstMeta *meta, GstBuffer *buffer, gpointer data); -/** - * GstMetaSerializeFunction: - * @meta: a #GstMeta - */ -typedef gchar * (*GstMetaSerializeFunction) (GstMeta *meta); - -/** - * GstMetaDeserializeFunction: - * @meta: a #GstMeta - */ -typedef gboolean (*GstMetaDeserializeFunction) (GstMeta *meta, - const gchar *s); - /** * GstMetaInfo: * @api: tag indentifying the metadata structure and api - * @impl: tag indentifying the implementor of the api + * @type: type indentifying the implementor of the api * @size: size of the metadata * @init_func: function for initializing the metadata * @free_func: function for freeing the metadata * @copy_func: function for copying the metadata * @transform_func: function for transforming the metadata - * @serialize_func: function for serializing - * @deserialize_func: function for deserializing * * The #GstMetaInfo provides information about a specific metadata * structure. */ struct _GstMetaInfo { GQuark api; - GQuark impl; + GType type; gsize size; GstMetaInitFunction init_func; GstMetaFreeFunction free_func; GstMetaCopyFunction copy_func; GstMetaTransformFunction transform_func; - GstMetaSerializeFunction serialize_func; - GstMetaDeserializeFunction deserialize_func; }; void _gst_meta_init (void); @@ -131,9 +114,7 @@ const GstMetaInfo * gst_meta_register (const gchar *api, const gchar *im GstMetaInitFunction init_func, GstMetaFreeFunction free_func, GstMetaCopyFunction copy_func, - GstMetaTransformFunction transform_func, - GstMetaSerializeFunction serialize_func, - GstMetaDeserializeFunction deserialize_func); + GstMetaTransformFunction transform_func); const GstMetaInfo * gst_meta_get_info (const gchar * impl); /* default metadata */