diff options
Diffstat (limited to 'ext/metadata/metadataparse.h')
-rw-r--r-- | ext/metadata/metadataparse.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/ext/metadata/metadataparse.h b/ext/metadata/metadataparse.h index fde0a8b8..4534f12a 100644 --- a/ext/metadata/metadataparse.h +++ b/ext/metadata/metadataparse.h @@ -47,35 +47,41 @@ #include <gst/base/gstadapter.h> #include "metadataparsejpeg.h" +#include "metadataparsepng.h" G_BEGIN_DECLS -typedef enum _tag_ParseOption { +typedef enum _tag_ParseOption +{ PARSE_OPT_EXIF = (1 << 0), PARSE_OPT_IPTC = (1 << 1), - PARSE_OPT_XMP = (1 << 2), - PARSE_OPT_ALL = (1 << 3) -1 + PARSE_OPT_XMP = (1 << 2), + PARSE_OPT_ALL = (1 << 3) - 1 } ParseOption; -typedef enum _tag_ParseState { +typedef enum _tag_ParseState +{ STATE_NULL, STATE_READING, STATE_DONE } ParseState; -typedef enum _tag_ImageType { +typedef enum _tag_ImageType +{ IMG_NONE, IMG_JPEG, IMG_PNG } ImageType; - -typedef struct _tag_ParseData { +typedef struct _tag_ParseData +{ ParseState state; - ImageType img_type; + ImageType img_type; ParseOption option; - union { + union + { JpegData jpeg; + PngData png; } format_data; GstAdapter *adpt_exif; GstAdapter *adpt_iptc; @@ -87,8 +93,7 @@ typedef struct _tag_ParseData { #define set_parse_option(p, m) do { (p).option = (p).option | (m); } while(FALSE) #define unset_parse_option(p, m) do { (p).option = (p).option & ~(m); } while(FALSE) -extern void -metadataparse_init(ParseData *parse_data); +extern void metadataparse_init (ParseData * parse_data); /* * offset: number of bytes to jump (just a hint to jump a chunk) @@ -98,12 +103,11 @@ metadataparse_init(ParseData *parse_data); * 1 -> need more data */ extern int -metadataparse_parse(ParseData *parse_data, const guint8 *buf, guint32 bufsize, guint32 * next_offset, guint32 * next_size); +metadataparse_parse (ParseData * parse_data, const guint8 * buf, + guint32 bufsize, guint32 * next_offset, guint32 * next_size); -extern void -metadataparse_dispose(ParseData *parse_data); +extern void metadataparse_dispose (ParseData * parse_data); G_END_DECLS - #endif /* __METADATAPARSE_H__ */ |