Map more Exif tags.

Original commit message from CVS:
Map more Exif tags.
This commit is contained in:
Edgard Lima 2008-02-02 20:22:19 +00:00
parent a9ae327f9f
commit 5aa73f078a
8 changed files with 599 additions and 279 deletions

View file

@ -1,3 +1,13 @@
2008-02-02 Edgard Lima <edgard.lima@indt.org.br>
* ext/metadata/TODO:
* ext/metadata/gstmetadatamux.c:
* ext/metadata/metadata_mapping.htm:
* ext/metadata/metadataexif.c:
* ext/metadata/metadatatags.c:
* ext/metadata/metadatatags.h:
Map more Exif tags.
2008-02-01 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/selector/gstinputselector.c: (gst_selector_pad_event):

2
common

@ -1 +1 @@
Subproject commit 571dce3335f9be76978009b3842c050dbb900e6f
Subproject commit 3c5473161ce19a3530bad279b842d542895b1500

View file

@ -11,8 +11,7 @@ TODO:
2- Get properties like 'width' and 'height' from caps
3- Review the code (in order to move to gst-plugins-good)
4- Document how the plugin works (atchitecture and interaction beteween modules)
5- Create a HTML with the mapping (and conversion) beteween GST tags and EXIF, IPTC and XMP tags
6- Improve the test application (to save also in png and to make it possible to set the metadata elements properties)
5- Improve the test application (to save also in png and to make it possible to set the metadata elements properties)
OPEN ISSUES:
@ -39,4 +38,11 @@ http://bugzilla.gnome.org/show_bug.cgi?id=503616
KNOWN BUGS
bugs in libexif:
https://sourceforge.net/tracker/?func=detail&atid=112272&aid=1884609&group_id=12272
1- EXIF_TAG_ISO_SPEED_RATINGS should be in EXIF_IFD_EXIF
2- EXIF_TAG_ISO_SPEED_RATINGS is not inserted anyway

View file

@ -508,9 +508,11 @@ gst_metadata_mux_sink_event (GstPad * pad, GstEvent * event)
{
GstTagList *taglist = NULL;
GstTagSetter *setter = GST_TAG_SETTER (filter);
const GstTagMergeMode mode = gst_tag_setter_get_tag_merge_mode (setter);
gst_event_parse_tag (event, &taglist);
gst_tag_setter_merge_tags (setter, taglist, GST_TAG_MERGE_REPLACE);
gst_tag_setter_merge_tags (setter, taglist, mode);
}
break;

File diff suppressed because it is too large Load diff

View file

@ -140,34 +140,44 @@ 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*/},
{EXIF_TAG_MODEL, /*ASCII,*/ EXIF_IFD_0,
GST_TAG_DEVICE_MODEL, /*STRING*/},
{EXIF_TAG_SOFTWARE, /*ASCII,*/ EXIF_IFD_0,
GST_TAG_CREATOR_TOOL, /*STRING*/},
{EXIF_TAG_X_RESOLUTION, /*RATIONAL,*/ EXIF_IFD_0,
GST_TAG_IMAGE_XRESOLUTION, /*FRACTION*/}, /* inches */
{EXIF_TAG_Y_RESOLUTION, /*RATIONAL,*/ EXIF_IFD_0,
GST_TAG_IMAGE_YRESOLUTION, /*FRACTION*/}, /* inches */
{EXIF_TAG_EXPOSURE_TIME, /*RATIONAL,*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_EXPOSURE_TIME, /*FRACTION*/},
{EXIF_TAG_FNUMBER, /*RATIONAL,*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_FNUMBER, /*FRACTION*/},
{EXIF_TAG_EXPOSURE_PROGRAM, /*SHORT,*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_EXPOSURE_PROGRAM, /*UINT*/},
{EXIF_TAG_BRIGHTNESS_VALUE, /*SRATIONAL,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_BRIGHTNESS, /*FRACTION*/},
{EXIF_TAG_WHITE_BALANCE, /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_WHITE_BALANCE, /*UINT*/},
{EXIF_TAG_DIGITAL_ZOOM_RATIO, /*RATIONAL,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_DIGITAL_ZOOM, /*FRACTION*/},
{EXIF_TAG_GAIN_CONTROL, /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_GAIN, /*UINT*/},
{EXIF_TAG_CONTRAST, /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_CONTRAST, /*INT*/},
{EXIF_TAG_SATURATION, /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_SATURATION, /*INT*/},
{EXIF_TAG_BRIGHTNESS_VALUE, /*SRATIONAL,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_BRIGHTNESS /*GST_TYPE_FRACTION*/},
{EXIF_TAG_CONTRAST, /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_CONTRAST /*G_TYPE_INT*/},
{EXIF_TAG_DIGITAL_ZOOM_RATIO, /*RATIONAL,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_DIGITAL_ZOOM /*GST_TYPE_FRACTION*/},
{EXIF_TAG_EXPOSURE_PROGRAM, /*SHORT,*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_EXPOSURE_PROGRAM /*G_TYPE_UINT*/},
{EXIF_TAG_EXPOSURE_TIME, /*RATIONAL,*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_EXPOSURE_TIME /*GST_TYPE_FRACTION*/},
{EXIF_TAG_FLASH, /*SHORT*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_FLASH /*G_TYPE_UINT*/},
{EXIF_TAG_FNUMBER, /*RATIONAL,*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_FNUMBER /*GST_TYPE_FRACTION*/},
{EXIF_TAG_FOCAL_LENGTH, /*SRATIONAL*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_FOCAL_LEN /*GST_TYPE_FRACTION*/},
{EXIF_TAG_GAIN_CONTROL, /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_GAIN /*G_TYPE_UINT*/},
{EXIF_TAG_ISO_SPEED_RATINGS, /*SHORT,*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_ISO_SPEED_RATINGS /*G_TYPE_INT*/},
{EXIF_TAG_LIGHT_SOURCE , /*SHORT,*/ EXIF_IFD_EXIF,
GST_TAG_CAPTURE_LIGHT_SOURCE /*G_TYPE_UINT*/},
{EXIF_TAG_ORIENTATION , /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_ORIENTATION /*G_TYPE_UINT*/},
{EXIF_TAG_SATURATION, /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_SATURATION /*G_TYPE_INT*/},
{EXIF_TAG_WHITE_BALANCE, /*SHORT,*/ EXIF_IFD_0,
GST_TAG_CAPTURE_WHITE_BALANCE /*G_TYPE_UINT*/},
{EXIF_TAG_SOFTWARE, /*ASCII,*/ EXIF_IFD_0,
GST_TAG_CREATOR_TOOL /*G_TYPE_STRING*/},
{EXIF_TAG_MAKE, /*ASCII,*/ EXIF_IFD_0,
GST_TAG_DEVICE_MAKE /*G_TYPE_STRING*/},
{EXIF_TAG_MODEL, /*ASCII,*/ EXIF_IFD_0,
GST_TAG_DEVICE_MODEL /*G_TYPE_STRING*/},
{EXIF_TAG_X_RESOLUTION, /*RATIONAL,*/ EXIF_IFD_0,
GST_TAG_IMAGE_XRESOLUTION /*GST_TYPE_FRACTION*/}, /* inches */
{EXIF_TAG_Y_RESOLUTION, /*RATIONAL,*/ EXIF_IFD_0,
GST_TAG_IMAGE_YRESOLUTION /*GST_TYPE_FRACTION*/}, /* inches */
{0, EXIF_IFD_COUNT, NULL}
};
/* *INDENT-ON* */
@ -404,10 +414,13 @@ metadataparse_exif_data_foreach_content_func (ExifContent * content,
{
ExifIfd ifd = exif_content_get_ifd (content);
GST_LOG ("\n Content %p: %s (ifd=%d)", content, exif_ifd_get_name (ifd),
ifd);
exif_content_foreach_entry (content,
metadataparse_exif_content_foreach_entry_func, user_data);
if (ifd == EXIF_IFD_0 || ifd == EXIF_IFD_EXIF) {
GST_LOG ("\n Content %p: %s (ifd=%d)", content, exif_ifd_get_name (ifd),
ifd);
exif_content_foreach_entry (content,
metadataparse_exif_content_foreach_entry_func, user_data);
}
}
/*

View file

@ -162,10 +162,71 @@ metadata_tags_exif_register (void)
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);
/*
* bits (76543210) indicating the flash status:
* 0- Flash firing
* 0- Flash did not fire
* 1- Flash fired
* 1,2- Flash return
* 00- No strobe return detection function
* 01- reserved
* 10- Strobe return light not detected
* 11- Strobe return light detected.
* 3,4- Flash mode
* 00- unknown
* 01- Compulsory flash firing
* 10- Compulsory flash suppression
* 11- Auto mode
* 5- if flash function is present
* 0- Flash function present
* 1- No flash function
* 6- Red-eye mode
* 0- No red-eye reduction mode or unknown
* 1- Red-eye reduction supported
* So, we have the following possible values:
*
* 0000.H = Flash did not fire.
* 0001.H = Flash fired.
* 0005.H = Strobe return light not detected.
* 0007.H = Strobe return light detected.
* 0009.H = Flash fired, compulsory flash mode
* 000D.H = Flash fired, compulsory flash mode, return light not detected
* 000F.H = Flash fired, compulsory flash mode, return light detected
* 0010.H = Flash did not fire, compulsory flash mode
* 0018.H = Flash did not fire, auto mode
* 0019.H = Flash fired, auto mode
* 001D.H = Flash fired, auto mode, return light not detected
* 001F.H = Flash fired, auto mode, return light detected
* 0020.H = No flash function
* 0041.H = Flash fired, red-eye reduction mode
* 0045.H = Flash fired, red-eye reduction mode, return light not detected
* 0047.H = Flash fired, red-eye reduction mode, return light detected
* 0049.H = Flash fired, compulsory flash mode, red-eye reduction mode
* 004D.H = Flash fired, compulsory flash mode, red-eye reduction mode,
* return light not detected
* 004F.H = Flash fired, compulsory flash mode, red-eye reduction mode,
* return light detected
* 0059.H = Flash fired, auto mode, red-eye reduction mode
* 005D.H = Flash fired, auto mode, return light not detected,
* red-eye reduction mode
* 005F.H = Flash fired, auto mode, return light detected,
* red-eye reduction mode
* Other = reserved
*/
gst_tag_register (GST_TAG_CAPTURE_FLASH, GST_TAG_FLAG_META,
G_TYPE_UINT, GST_TAG_CAPTURE_FLASH, "Flash status", NULL);
gst_tag_register (GST_TAG_CAPTURE_FNUMBER, GST_TAG_FLAG_META,
GST_TYPE_FRACTION, GST_TAG_CAPTURE_FNUMBER, "F number (focal ratio)",
NULL);
gst_tag_register (GST_TAG_CAPTURE_FOCAL_LEN, GST_TAG_FLAG_META,
GST_TYPE_FRACTION, GST_TAG_CAPTURE_FOCAL_LEN,
"Focal length of lens used to take image. Unit is millimeter", NULL);
/*
0- None
1- Low gain up
@ -176,6 +237,56 @@ metadata_tags_exif_register (void)
gst_tag_register (GST_TAG_CAPTURE_GAIN, GST_TAG_FLAG_META, G_TYPE_UINT,
GST_TAG_CAPTURE_GAIN, "", NULL);
gst_tag_register (GST_TAG_CAPTURE_ISO_SPEED_RATINGS, GST_TAG_FLAG_META,
G_TYPE_INT, GST_TAG_CAPTURE_ISO_SPEED_RATINGS,
"ISO Speed and ISO Latitude as specified in ISO 12232", NULL);
/*
0- unknown (default)
1- Daylight
2- Fluorescent
3- Tungsten (incandescent light)
4- Flash
9- Fine weather
10- Cloudy weather
11- Shade
12- Daylight fluorescent (D 5700 %G%@ 7100K)
13- Day white fluorescent (N 4600 %G%@ 5400K)
14- Cool white fluorescent (W 3900 %G%@ 4500K)
15- White fluorescent (WW 3200 %G%@ 3700K)
17- Standard light A
18- Standard light B
19- Standard light C
20- D55
21- D65
22- D75
23- D50
24- ISO studio tungsten
255- other light source
Other = reserved
*/
gst_tag_register (GST_TAG_CAPTURE_LIGHT_SOURCE, GST_TAG_FLAG_META,
G_TYPE_UINT, GST_TAG_CAPTURE_LIGHT_SOURCE,
"The kind of light source.", NULL);
/*
* The relation of the '0th row' and '0th column' to visual position:
* 1- top-left
* 2- top-right
* 3- bottom-right
* 4- bottom-left
* 5- left-top
* 6- right-top
* 7- right-bottom
* 8- left-bottom
*/
gst_tag_register (GST_TAG_CAPTURE_ORIENTATION, GST_TAG_FLAG_META,
G_TYPE_UINT, GST_TAG_CAPTURE_ORIENTATION,
"The kind of light source.", NULL);
/*
from -100 to 100
[-100, -34] - low

View file

@ -84,8 +84,13 @@ typedef enum {
#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_FLASH "capture-flash"
#define GST_TAG_CAPTURE_FNUMBER "capture-fnumber"
#define GST_TAG_CAPTURE_FOCAL_LEN "capture-focal-len"
#define GST_TAG_CAPTURE_GAIN "capture-gain"
#define GST_TAG_CAPTURE_ISO_SPEED_RATINGS "capture-iso-speed-ratings"
#define GST_TAG_CAPTURE_LIGHT_SOURCE "capture-light_source"
#define GST_TAG_CAPTURE_ORIENTATION "capture-orientation"
#define GST_TAG_CAPTURE_SATURATION "capture-saturation"
#define GST_TAG_CAPTURE_WHITE_BALANCE "capture-white-balance"