From 7a44301116944d95af91dca94eae3802dd776121 Mon Sep 17 00:00:00 2001 From: Edgard Lima Date: Thu, 31 Jan 2008 21:55:44 +0000 Subject: [PATCH] Add documentation. Original commit message from CVS: Add documentation. --- ChangeLog | 10 + ext/metadata/metadata_mapping.htm | 664 ++++++++++++++++++++++++++++++ ext/metadata/metadataexif.c | 1 + ext/metadata/metadataiptc.c | 1 + ext/metadata/metadatatags.c | 142 ++++--- ext/metadata/metadatatags.h | 34 +- ext/metadata/metadataxmp.c | 2 + 7 files changed, 775 insertions(+), 79 deletions(-) create mode 100644 ext/metadata/metadata_mapping.htm diff --git a/ChangeLog b/ChangeLog index f2ed778019..e73dedb345 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-31 Edgard Lima + + * ext/metadata/metadata_mapping.htm: + * ext/metadata/metadataexif.c: + * ext/metadata/metadataiptc.c: + * ext/metadata/metadatatags.c: + * ext/metadata/metadatatags.h: + * ext/metadata/metadataxmp.c: + Add documentation. + 2008-01-31 Wim Taymans * ext/metadata/metadataparsejpeg.c: (metadataparse_jpeg_reading): diff --git a/ext/metadata/metadata_mapping.htm b/ext/metadata/metadata_mapping.htm new file mode 100644 index 0000000000..af9b6c7d04 --- /dev/null +++ b/ext/metadata/metadata_mapping.htm @@ -0,0 +1,664 @@ + + + + + + + + + + + + + + +


+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

gsttaglist.h

+
+

metadatatags.h

+
+

value

+
+

type

+
+

description

+
+

EXIF

+
+

IPTC

+
+

XMP

+
+

-

+
+

GST_TAG_EXIF

+
+

exif”

+
+

GST_TYPE_BUFFER

+
+

exif + chunk that could be used directly by the application

+
+

exif_data_new_from_data()

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_IPTC

+
+

iptc”

+
+

GST_TYPE_BUFFER

+
+

iptc + chunk that could be used directly by the application

+
+

-

+
+

iptc_data_new_from_data()

+
+

-

+
+

-

+
+

GST_TAG_XMP

+
+

xmp”

+
+

GST_TYPE_BUFFER

+
+

xmp + chunk that could be used directly by the application

+
+

-

+
+

-

+
+

xmp_new()

+
+

-

+
+

GST_TAG_CAPTURE_BRIGHTNESS

+
+

"capture-brightness"

+
+

GST_TYPE_FRACTION

+
+

"Brightness + (APEX from -99.99 to 99.99)"

+
+

EXIF_TAG_BRIGHTNESS_VALUE

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CAPTURE_CONTRAST

+
+

"capture-contrast"

+
+

G_TYPE_INT

+
+

from + -100 to 100:
[-100, -34] – soft ;
[-33, 33] – normal + ;
[34, 100] – hard
+

+
+

EXIF_TAG_CONTRAST
0- + normal;
1- soft;
2- hard

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CAPTURE_DIGITAL_ZOOM

+
+

"capture-digital-zoom"

+
+

GST_TYPE_FRACTION

+
+

"Digital + zoom ratio"
(zero, means digital zoom not used)

+
+

EXIF_TAG_DIGITAL_ZOOM_RATIO

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CAPTURE_EXPOSURE_PROGRAM

+
+

"capture-exposure-program"

+
+

G_TYPE_UINT

+
+

0 + - not defined ; 1- Manual; 2- Normal program ; 3- Aperture + priority ; 4- Shutter priority ; 5- Creative program (biased + toward death of field); 6- Action program (biased toward fast + shutter speed); 7- Portrait mode (for closeup photos with the + background out of focus) ; 8- Landscape mode (for landscape photos + with the background in focus) +

+

*** + exif is until here *** +

+

9- + Night ; 10- Back-light ; 11- Spotlight ; 12- Snow ; 13- Beach +

+
+

EXIF_TAG_EXPOSURE_PROGRAM

+

(only + from 0 to 8)

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CAPTURE_EXPOSURE_TIME

+
+

"capture-exposure-time"

+
+

GST_TYPE_FRACTION

+
+

"Exposure + time in seconds"

+
+

EXIF_TAG_EXPOSURE_TIME

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CAPTURE_FNUMBER

+
+

"captute-fnumber"

+
+

GST_TYPE_FRACTION

+
+

"F + number (focal ratio)"

+
+

EXIF_TAG_FNUMBER

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CAPTURE_GAIN

+
+

"capture-gain"

+
+

G_TYPE_UINT

+
+

0- + None ; 1- Low gain up ; 2- High gain up ; 3- Low gain down ; 4- + High gain down

+
+

EXIF_TAG_GAIN_CONTROL

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CAPTURE_SATURATION

+
+

"capture-saturation"

+
+

G_TYPE_INT

+
+

from + -100 to 100:
[-100, -34] – low ;
[-33, 33] – normal + ;
[34, 100] - high

+
+

EXIF_TAG_SATURATION
0- + normal;
1- low;
2- high

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CAPTURE_WHITE_BALANCE

+
+

"capture-white-balance"

+
+

G_TYPE_UINT

+
+

0- + Auto; 1- Off +

+

*** + exif is until here *** +

+

2- + Sunlight ; 3- Cloudy ; 4- Shade ; 5- Tungsten ; 6- Fluorescent ; + 7- Incandescent; 8- Flash ; 9- Horizon (sun on the horizon)

+
+

EXIF_TAG_WHITE_BALANCE

+

(only + 0 and 1)

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_CREATOR_TOOL

+
+

"creator-tool"

+
+

G_TYPE_STRING

+
+

"The + name of the first known tool used to create the resource. Or + firmware or driver version of device"

+
+

EXIF_TAG_SOFTWARE

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_DEVICE_MAKE

+
+

"device-make"

+
+

G_TYPE_STRING

+
+

"The + manufacturer of the recording equipment"

+
+

EXIF_TAG_MAKE

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_DEVICE_MODEL

+
+

"device-model"

+
+

G_TYPE_STRING

+
+

"The + model name or model number of the equipment"

+
+

EXIF_TAG_MODEL

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_IMAGE_XRESOLUTION

+
+

"image-xresolution"

+
+

GST_TYPE_FRACTION

+
+

"Horizontal + resolution in pixels per inch".
Here it is always in + inches.
In EXIF it depends on EXIF_TAG_RESOLUTION_UNIT

+
+

EXIF_TAG_X_RESOLUTION

+
+

-

+
+

-

+
+

-

+
+

GST_TAG_IMAGE_YRESOLUTION

+
+

"image-yresolution"

+
+

GST_TYPE_FRACTION

+
+

"Vertical + resolution in pixels per inch".
Here it is always in + inches.
In EXIF it depends on EXIF_TAG_RESOLUTION_UNIT

+
+

EXIF_TAG_Y_RESOLUTION

+
+

-

+
+

-

+
+

GST_TAG_COMPOSER

+
+

-

+
+

"composer"

+
+

G_TYPE_STRING

+
+

"Name + of the creator of the object, e.g. writer, photographer or graphic + artist."

+
+

-

+
+

IPTC_TAG_BYLINE

+
+

-

+
+

GST_TAG_COPYRIGHT

+
+

-

+
+

"copyright"

+
+

G_TYPE_STRING

+
+

"Any + necessary copyright notice."

+
+

-

+
+

IPTC_TAG_COPYRIGHT_NOTICE

+
+

dc:rights”

+
+

GST_TAG_DESCRIPTION

+
+

-

+
+

"description"

+
+

G_TYPE_STRING

+
+

"A + textual description of the data"

+
+

-

+
+

IPTC_TAG_CAPTION

+
+

dc:description”

+
+

GST_TAG_TITLE

+
+

-

+
+

"title"

+
+

G_TYPE_STRING

+
+

"A + shorthand reference for the object."

+
+

-

+
+

IPTC_TAG_OBJECT_NAME

+
+

dc:title”

+
+


+

+ + \ No newline at end of file diff --git a/ext/metadata/metadataexif.c b/ext/metadata/metadataexif.c index c9bb80b8a3..cd275d11f3 100644 --- a/ext/metadata/metadataexif.c +++ b/ext/metadata/metadataexif.c @@ -138,6 +138,7 @@ typedef struct _tag_MapIntStr */ /* *INDENT-OFF* */ +/* When changing this table, update 'metadata_mapping.htm' file too. */ static MapIntStr mappedTags[] = { {EXIF_TAG_MAKE, /*ASCII,*/ EXIF_IFD_0, GST_TAG_DEVICE_MAKE, /*STRING*/}, diff --git a/ext/metadata/metadataiptc.c b/ext/metadata/metadataiptc.c index 0ba8018aa8..167ce1d65a 100644 --- a/ext/metadata/metadataiptc.c +++ b/ext/metadata/metadataiptc.c @@ -137,6 +137,7 @@ typedef struct _tag_MapIntStr */ /* *INDENT-OFF* */ +/* When changing this table, update 'metadata_mapping.htm' file too. */ static MapIntStr mappedTags[] = { {IPTC_RECORD_APP_2, IPTC_TAG_OBJECT_NAME, /*ASCII*/ GST_TAG_TITLE /*STRING*/}, diff --git a/ext/metadata/metadatatags.c b/ext/metadata/metadatatags.c index b780703316..63acf2f314 100644 --- a/ext/metadata/metadatatags.c +++ b/ext/metadata/metadatatags.c @@ -50,6 +50,8 @@ * in GStreamer base. So, the EXIF, IPTC and XMP tags can be mapped to tags * not registered in this file (tags already in GST base) * + * When changing this file, update 'metadata_mapping.htm' file too. + * * Last reviewed on 2008-01-24 (0.10.15) */ @@ -109,39 +111,33 @@ metadata_tags_register (void) static void metadata_tags_exif_register (void) { - /* devices tags */ - - gst_tag_register (GST_TAG_DEVICE_MAKE, GST_TAG_FLAG_META, - G_TYPE_STRING, GST_TAG_DEVICE_MAKE, - "The manufacturer of the recording equipment", NULL); - gst_tag_register (GST_TAG_DEVICE_MODEL, GST_TAG_FLAG_META, G_TYPE_STRING, - GST_TAG_DEVICE_MODEL, "The model name or model number of the equipment", - NULL); - - /* generic tags */ - - gst_tag_register (GST_TAG_CREATOR_TOOL, GST_TAG_FLAG_META, G_TYPE_STRING, - GST_TAG_CREATOR_TOOL, - "The name of the first known tool used to create the resource." - " Or firmware or driver version of device", NULL); - - /* image tags */ - - gst_tag_register (GST_TAG_IMAGE_XRESOLUTION, GST_TAG_FLAG_META, - GST_TYPE_FRACTION, GST_TAG_IMAGE_XRESOLUTION, - "Horizontal resolution in pixels per inch", NULL); - gst_tag_register (GST_TAG_IMAGE_YRESOLUTION, GST_TAG_FLAG_META, - GST_TYPE_FRACTION, GST_TAG_IMAGE_YRESOLUTION, - "Vertical resolution in pixels per inch", NULL); /* capture tags */ - gst_tag_register (GST_TAG_CAPTURE_EXPOSURE_TIME, GST_TAG_FLAG_META, - GST_TYPE_FRACTION, GST_TAG_CAPTURE_EXPOSURE_TIME, - "Exposure time in seconds", NULL); - gst_tag_register (GST_TAG_CAPTURE_FNUMBER, GST_TAG_FLAG_META, - GST_TYPE_FRACTION, GST_TAG_CAPTURE_FNUMBER, "F number (focal ratio)", + /* The unit is the APEX value. + Ordinarily it is given in the range of -99.99 to 99.99. + if numerator is 0xFFFFFFFF means unknown + */ + gst_tag_register (GST_TAG_CAPTURE_BRIGHTNESS, GST_TAG_FLAG_META, + GST_TYPE_FRACTION, GST_TAG_CAPTURE_BRIGHTNESS, + "Brightness (APEX from -99.99 to 99.99)", NULL); + + /* + from -100 to 100 + [-100, -34] - soft + [-33, 33] - normal + [34, 100] - hard + *** exif is just 0, 1, 2 (normal, soft and hard) + */ + gst_tag_register (GST_TAG_CAPTURE_CONTRAST, GST_TAG_FLAG_META, G_TYPE_INT, + GST_TAG_CAPTURE_CONTRAST, "", NULL); + + /* if Zero ZOOM not used + */ + gst_tag_register (GST_TAG_CAPTURE_DIGITAL_ZOOM, GST_TAG_FLAG_META, + GST_TYPE_FRACTION, GST_TAG_CAPTURE_DIGITAL_ZOOM, "Digital zoom ratio", NULL); + /* 0 - not defined 1- Manual @@ -162,13 +158,34 @@ metadata_tags_exif_register (void) gst_tag_register (GST_TAG_CAPTURE_EXPOSURE_PROGRAM, GST_TAG_FLAG_META, G_TYPE_UINT, GST_TAG_CAPTURE_EXPOSURE_PROGRAM, "Class of program used for exposure", NULL); - /* The unit is the APEX value. - Ordinarily it is given in the range of -99.99 to 99.99. - if numerator is 0xFFFFFFFF means unknown + + gst_tag_register (GST_TAG_CAPTURE_EXPOSURE_TIME, GST_TAG_FLAG_META, + GST_TYPE_FRACTION, GST_TAG_CAPTURE_EXPOSURE_TIME, + "Exposure time in seconds", NULL); + gst_tag_register (GST_TAG_CAPTURE_FNUMBER, GST_TAG_FLAG_META, + GST_TYPE_FRACTION, GST_TAG_CAPTURE_FNUMBER, "F number (focal ratio)", + NULL); + + /* + 0- None + 1- Low gain up + 2- High gain up + 3- Low gain down + 4- High gain down */ - gst_tag_register (GST_TAG_CAPTURE_BRIGHTNESS, GST_TAG_FLAG_META, - GST_TYPE_FRACTION, GST_TAG_CAPTURE_BRIGHTNESS, - "Brightness (APEX from -99.99 to 99.99)", NULL); + gst_tag_register (GST_TAG_CAPTURE_GAIN, GST_TAG_FLAG_META, G_TYPE_UINT, + GST_TAG_CAPTURE_GAIN, "", NULL); + + /* + from -100 to 100 + [-100, -34] - low + [-33, 33] - normal + [34, 100] - high + *** exif is just 0, 1, 2 (normal, low and high) + */ + gst_tag_register (GST_TAG_CAPTURE_SATURATION, GST_TAG_FLAG_META, G_TYPE_INT, + GST_TAG_CAPTURE_SATURATION, "", NULL); + /* 0- Auto 1- Off @@ -184,38 +201,31 @@ metadata_tags_exif_register (void) */ gst_tag_register (GST_TAG_CAPTURE_WHITE_BALANCE, GST_TAG_FLAG_META, G_TYPE_UINT, GST_TAG_CAPTURE_WHITE_BALANCE, "White balance mode", NULL); - /* if Zero ZOOM not used - */ - gst_tag_register (GST_TAG_CAPTURE_DIGITAL_ZOOM, GST_TAG_FLAG_META, - GST_TYPE_FRACTION, GST_TAG_CAPTURE_DIGITAL_ZOOM, "Digital zoom ratio", + + /* generic tags */ + + gst_tag_register (GST_TAG_CREATOR_TOOL, GST_TAG_FLAG_META, G_TYPE_STRING, + GST_TAG_CREATOR_TOOL, + "The name of the first known tool used to create the resource." + " Or firmware or driver version of device", NULL); + + /* devices tags */ + + gst_tag_register (GST_TAG_DEVICE_MAKE, GST_TAG_FLAG_META, + G_TYPE_STRING, GST_TAG_DEVICE_MAKE, + "The manufacturer of the recording equipment", NULL); + gst_tag_register (GST_TAG_DEVICE_MODEL, GST_TAG_FLAG_META, G_TYPE_STRING, + GST_TAG_DEVICE_MODEL, "The model name or model number of the equipment", NULL); - /* - 0- None - 1- Low gain up - 2- High gain up - 3- Low gain down - 4- High gain down - */ - gst_tag_register (GST_TAG_CAPTURE_GAIN, GST_TAG_FLAG_META, G_TYPE_UINT, - GST_TAG_CAPTURE_GAIN, "", NULL); - /* - from -100 to 100 - [-100, -34] - soft - [-33, 33] - normal - [34, 100] - hard - *** exif is just 0, 1, 2 (normal, soft and hard) - */ - gst_tag_register (GST_TAG_CAPTURE_CONTRAST, GST_TAG_FLAG_META, G_TYPE_INT, - GST_TAG_CAPTURE_CONTRAST, "", NULL); - /* - from -100 to 100 - [-100, -34] - low - [-33, 33] - normal - [34, 100] - high - *** exif is just 0, 1, 2 (normal, low and high) - */ - gst_tag_register (GST_TAG_CAPTURE_SATURATION, GST_TAG_FLAG_META, G_TYPE_INT, - GST_TAG_CAPTURE_SATURATION, "", NULL); + + /* image tags */ + + gst_tag_register (GST_TAG_IMAGE_XRESOLUTION, GST_TAG_FLAG_META, + GST_TYPE_FRACTION, GST_TAG_IMAGE_XRESOLUTION, + "Horizontal resolution in pixels per inch", NULL); + gst_tag_register (GST_TAG_IMAGE_YRESOLUTION, GST_TAG_FLAG_META, + GST_TYPE_FRACTION, GST_TAG_IMAGE_YRESOLUTION, + "Vertical resolution in pixels per inch", NULL); } diff --git a/ext/metadata/metadatatags.h b/ext/metadata/metadatatags.h index c458324f18..8189f61fe3 100644 --- a/ext/metadata/metadatatags.h +++ b/ext/metadata/metadatatags.h @@ -67,29 +67,37 @@ typedef enum { * defines */ -#define GST_TAG_EXIF "exif" +/* *INDENT-OFF* */ -#define GST_TAG_IPTC "iptc" +/* whole chunk tags */ -#define GST_TAG_XMP "xmp" +#define GST_TAG_EXIF "exif" -#define GST_TAG_DEVICE_MAKE "device-make" -#define GST_TAG_DEVICE_MODEL "device-model" +#define GST_TAG_IPTC "iptc" -#define GST_TAG_CREATOR_TOOL "creator-tool" +#define GST_TAG_XMP "xmp" -#define GST_TAG_IMAGE_XRESOLUTION "image-xresolution" -#define GST_TAG_IMAGE_YRESOLUTION "image-yresolution" +/* individual tags */ +#define GST_TAG_CAPTURE_BRIGHTNESS "capture-brightness" +#define GST_TAG_CAPTURE_CONTRAST "capture-contrast" +#define GST_TAG_CAPTURE_DIGITAL_ZOOM "capture-digital-zoom" +#define GST_TAG_CAPTURE_EXPOSURE_PROGRAM "capture-exposure-program" #define GST_TAG_CAPTURE_EXPOSURE_TIME "capture-exposure-time" #define GST_TAG_CAPTURE_FNUMBER "captute-fnumber" -#define GST_TAG_CAPTURE_EXPOSURE_PROGRAM "capture-exposure-program" -#define GST_TAG_CAPTURE_BRIGHTNESS "capture-brightness" -#define GST_TAG_CAPTURE_WHITE_BALANCE "capture-white-balance" -#define GST_TAG_CAPTURE_DIGITAL_ZOOM "capture-digital-zoom" #define GST_TAG_CAPTURE_GAIN "capture-gain" -#define GST_TAG_CAPTURE_CONTRAST "capture-contrast" #define GST_TAG_CAPTURE_SATURATION "capture-saturation" +#define GST_TAG_CAPTURE_WHITE_BALANCE "capture-white-balance" + +#define GST_TAG_CREATOR_TOOL "creator-tool" + +#define GST_TAG_DEVICE_MAKE "device-make" +#define GST_TAG_DEVICE_MODEL "device-model" + +#define GST_TAG_IMAGE_XRESOLUTION "image-xresolution" +#define GST_TAG_IMAGE_YRESOLUTION "image-yresolution" + +/* *INDENT-ON* */ /* * external function prototypes diff --git a/ext/metadata/metadataxmp.c b/ext/metadata/metadataxmp.c index d4a58fb4b0..7291c84d7e 100644 --- a/ext/metadata/metadataxmp.c +++ b/ext/metadata/metadataxmp.c @@ -155,6 +155,7 @@ typedef struct _tag_SchemaMap #define XMP_SCHEMA_NODE 0x80000000UL /* *INDENT-OFF* */ +/* When changing this table, update 'metadata_mapping.htm' file too. */ static const SchemaTagMap schema_map_dublin_tags_map[] = { {"description", GST_TAG_DESCRIPTION }, {"title", GST_TAG_TITLE }, @@ -170,6 +171,7 @@ static const SchemaMap schema_map_dublin = { schema_map_dublin_tags_map }; +/* When changing this table, update 'metadata_mapping.htm' file too. */ static const SchemaMap *schemas_map[] = { &schema_map_dublin, NULL