From 5c5a2000259c0c8ca9faf128d2c0776c519ba7a9 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 10 Aug 2010 19:50:42 -0300 Subject: [PATCH] tag: exif: Refactor functions declaration Use some macros to declare serialization/deserialization functions prototypes. --- gst-libs/gst/tag/gstexiftag.c | 52 ++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/gst-libs/gst/tag/gstexiftag.c b/gst-libs/gst/tag/gstexiftag.c index d4a8bd2..6331c5b 100644 --- a/gst-libs/gst/tag/gstexiftag.c +++ b/gst-libs/gst/tag/gstexiftag.c @@ -88,6 +88,19 @@ typedef gint (*GstExifDeserializationFunc) (GstExifReader * exif_reader, GstByteReader * reader, const GstExifTagMatch * exiftag, GstExifTagData * tagdata); +#define EXIF_SERIALIZATION_FUNC(name) \ +static void serialize_ ## name (GstExifWriter * writer, \ + const GstTagList * taglist, const GstExifTagMatch * exiftag) + +#define EXIF_DESERIALIZATION_FUNC(name) \ +static gint deserialize_ ## name (GstExifReader * exif_reader, \ + GstByteReader * reader, const GstExifTagMatch * exiftag, \ + GstExifTagData * tagdata) + +#define EXIF_SERIALIZATION_DESERIALIZATION_FUNC(name) \ + EXIF_SERIALIZATION_FUNC (name); \ + EXIF_DESERIALIZATION_FUNC (name) + struct _GstExifTagMatch { const gchar *gst_tag; @@ -130,36 +143,11 @@ struct _GstExifReader gint byte_order; }; -static void serialize_orientation (GstExifWriter * writer, - const GstTagList * taglist, const GstExifTagMatch * exiftag); -static gint deserialize_orientation (GstExifReader * exif_reader, - GstByteReader * reader, const GstExifTagMatch * exiftag, - GstExifTagData * tagdata); - -static void serialize_geo_coordinate (GstExifWriter * writer, - const GstTagList * taglist, const GstExifTagMatch * exiftag); -static gint deserialize_geo_coordinate (GstExifReader * exif_reader, - GstByteReader * reader, const GstExifTagMatch * exiftag, - GstExifTagData * tagdata); - -static void serialize_geo_direction (GstExifWriter * writer, - const GstTagList * taglist, const GstExifTagMatch * exiftag); -static gint deserialize_geo_direction (GstExifReader * exif_reader, - GstByteReader * reader, const GstExifTagMatch * exiftag, - GstExifTagData * tagdata); - -static void serialize_geo_elevation (GstExifWriter * writer, - const GstTagList * taglist, const GstExifTagMatch * exiftag); -static gint deserialize_geo_elevation (GstExifReader * exif_reader, - GstByteReader * reader, const GstExifTagMatch * exiftag, - GstExifTagData * tagdata); - -static void serialize_speed (GstExifWriter * writer, - const GstTagList * taglist, const GstExifTagMatch * exiftag); -static gint deserialize_speed (GstExifReader * exif_reader, - GstByteReader * reader, const GstExifTagMatch * exiftag, - GstExifTagData * tagdata); - +EXIF_SERIALIZATION_DESERIALIZATION_FUNC (orientation); +EXIF_SERIALIZATION_DESERIALIZATION_FUNC (geo_coordinate); +EXIF_SERIALIZATION_DESERIALIZATION_FUNC (geo_direction); +EXIF_SERIALIZATION_DESERIALIZATION_FUNC (geo_elevation); +EXIF_SERIALIZATION_DESERIALIZATION_FUNC (speed); /* FIXME copyright tag has a weird "artist\0editor\0" format that is * not yet handled */ @@ -1672,3 +1660,7 @@ reader_fail: GST_WARNING ("Failed to read fields from buffer (too short?)"); return ret; } + +#undef EXIF_SERIALIZATION_FUNC +#undef EXIF_DESERIALIZATION_FUNC +#undef EXIF_SERIALIZATION_DESERIALIZATION_FUNC -- 2.7.4