mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
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.
This commit is contained in:
parent
9597545d23
commit
9339a59583
2 changed files with 6 additions and 31 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue