mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
Add more tags mapping.
Original commit message from CVS: Add more tags mapping.
This commit is contained in:
parent
9d8a7aa18f
commit
30f55f67f4
5 changed files with 474 additions and 255 deletions
|
@ -1,3 +1,11 @@
|
|||
2008-02-05 Edgard Lima <edgard.lima@indt.org.br>
|
||||
|
||||
* ext/metadata/metadata_mapping.htm:
|
||||
* ext/metadata/metadataexif.c:
|
||||
* ext/metadata/metadatatags.c:
|
||||
* ext/metadata/metadatatags.h:
|
||||
Add more tags mapping.
|
||||
|
||||
2008-02-05 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||
|
||||
* gst/mpegtsparse/mpegtsparse.c:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -140,44 +140,78 @@ typedef struct _tag_MapIntStr
|
|||
/* *INDENT-OFF* */
|
||||
/* When changing this table, update 'metadata_mapping.htm' file too. */
|
||||
static MapIntStr mappedTags[] = {
|
||||
{EXIF_TAG_BRIGHTNESS_VALUE, /*SRATIONAL,*/ EXIF_IFD_0,
|
||||
{EXIF_TAG_APERTURE_VALUE, /*RATIONAL,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_CAPTURE_APERTURE /*GST_TYPE_FRACTION*/},
|
||||
|
||||
{EXIF_TAG_BRIGHTNESS_VALUE, /*SRATIONAL,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_CAPTURE_BRIGHTNESS /*GST_TYPE_FRACTION*/},
|
||||
{EXIF_TAG_CONTRAST, /*SHORT,*/ EXIF_IFD_0,
|
||||
|
||||
{EXIF_TAG_CONTRAST, /*SHORT,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_CAPTURE_CONTRAST /*G_TYPE_INT*/},
|
||||
{EXIF_TAG_DIGITAL_ZOOM_RATIO, /*RATIONAL,*/ EXIF_IFD_0,
|
||||
|
||||
{EXIF_TAG_CUSTOM_RENDERED, /*SHORT,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_CAPTURE_CUSTOM_RENDERED /*G_TYPE_UINT*/},
|
||||
|
||||
{EXIF_TAG_DIGITAL_ZOOM_RATIO, /*RATIONAL,*/ EXIF_IFD_EXIF,
|
||||
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,
|
||||
|
||||
{EXIF_TAG_GAIN_CONTROL, /*SHORT,*/ EXIF_IFD_EXIF,
|
||||
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,
|
||||
|
||||
{EXIF_TAG_LIGHT_SOURCE, /*SHORT,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_CAPTURE_LIGHT_SOURCE /*G_TYPE_UINT*/},
|
||||
{EXIF_TAG_ORIENTATION , /*SHORT,*/ EXIF_IFD_0,
|
||||
|
||||
{EXIF_TAG_ORIENTATION, /*SHORT,*/ EXIF_IFD_0,
|
||||
GST_TAG_CAPTURE_ORIENTATION /*G_TYPE_UINT*/},
|
||||
{EXIF_TAG_SATURATION, /*SHORT,*/ EXIF_IFD_0,
|
||||
|
||||
{EXIF_TAG_SATURATION, /*SHORT,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_CAPTURE_SATURATION /*G_TYPE_INT*/},
|
||||
{EXIF_TAG_WHITE_BALANCE, /*SHORT,*/ EXIF_IFD_0,
|
||||
|
||||
{EXIF_TAG_SHUTTER_SPEED_VALUE, /*SRATIONAL,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_CAPTURE_SHUTTER_SPEED /*GST_TYPE_FRACTION*/},
|
||||
|
||||
{EXIF_TAG_WHITE_BALANCE, /*SHORT,*/ EXIF_IFD_EXIF,
|
||||
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_PIXEL_Y_DIMENSION, /*LONG,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_IMAGE_HEIGHT /*G_TYPE_INT*/}, /* inches */
|
||||
|
||||
{EXIF_TAG_PIXEL_X_DIMENSION, /*LONG,*/ EXIF_IFD_EXIF,
|
||||
GST_TAG_IMAGE_WIDTH /*G_TYPE_INT*/}, /* inches */
|
||||
|
||||
{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* */
|
||||
|
@ -532,6 +566,9 @@ metadataparse_exif_content_foreach_entry_func (ExifEntry * entry,
|
|||
case EXIF_FORMAT_SHORT:
|
||||
value = exif_get_short (entry->data, byte_order);
|
||||
break;
|
||||
case EXIF_FORMAT_LONG:
|
||||
value = exif_get_long (entry->data, byte_order);
|
||||
break;
|
||||
default:
|
||||
GST_ERROR ("Unexpected Exif Tag Type (%s - %s)",
|
||||
tag, exif_format_get_name (entry->format));
|
||||
|
@ -685,17 +722,28 @@ metadatamux_exif_for_each_tag_in_list (const GstTagList * list,
|
|||
} else {
|
||||
gst_tag_list_get_int (list, tag, &value);
|
||||
}
|
||||
if (entry->tag == EXIF_TAG_CONTRAST
|
||||
|| entry->tag == EXIF_TAG_SATURATION) {
|
||||
if (value < -33)
|
||||
value = 1; /* low */
|
||||
else if (value < 34)
|
||||
value = 0; /* normal */
|
||||
else
|
||||
value = 2; /* high */
|
||||
|
||||
switch (entry->format) {
|
||||
case EXIF_FORMAT_SHORT:
|
||||
if (entry->tag == EXIF_TAG_CONTRAST
|
||||
|| entry->tag == EXIF_TAG_SATURATION) {
|
||||
if (value < -33)
|
||||
value = 1; /* low */
|
||||
else if (value < 34)
|
||||
value = 0; /* normal */
|
||||
else
|
||||
value = 2; /* high */
|
||||
}
|
||||
v_short = value;
|
||||
exif_set_short (entry->data, byte_order, v_short);
|
||||
break;
|
||||
case EXIF_FORMAT_LONG:
|
||||
exif_set_long (entry->data, byte_order, value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
v_short = value;
|
||||
exif_set_short (entry->data, byte_order, v_short);
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -114,6 +114,10 @@ metadata_tags_exif_register (void)
|
|||
|
||||
/* capture tags */
|
||||
|
||||
gst_tag_register (GST_TAG_CAPTURE_APERTURE, GST_TAG_FLAG_META,
|
||||
GST_TYPE_FRACTION, GST_TAG_CAPTURE_APERTURE,
|
||||
"Aperture (in APEX units)", 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
|
||||
|
@ -132,6 +136,15 @@ metadata_tags_exif_register (void)
|
|||
gst_tag_register (GST_TAG_CAPTURE_CONTRAST, GST_TAG_FLAG_META, G_TYPE_INT,
|
||||
GST_TAG_CAPTURE_CONTRAST, "", NULL);
|
||||
|
||||
/*
|
||||
* 0- Normal process
|
||||
* 1- Custom process
|
||||
*/
|
||||
|
||||
gst_tag_register (GST_TAG_CAPTURE_CUSTOM_RENDERED, GST_TAG_FLAG_META,
|
||||
G_TYPE_UINT, GST_TAG_CAPTURE_CUSTOM_RENDERED,
|
||||
"Indicates the use of special processing on image data", NULL);
|
||||
|
||||
/* if Zero ZOOM not used
|
||||
*/
|
||||
gst_tag_register (GST_TAG_CAPTURE_DIGITAL_ZOOM, GST_TAG_FLAG_META,
|
||||
|
@ -295,7 +308,11 @@ metadata_tags_exif_register (void)
|
|||
*** 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);
|
||||
GST_TAG_CAPTURE_SATURATION, "The saturation", NULL);
|
||||
|
||||
gst_tag_register (GST_TAG_CAPTURE_SHUTTER_SPEED, GST_TAG_FLAG_META,
|
||||
GST_TYPE_FRACTION, GST_TAG_CAPTURE_SHUTTER_SPEED, "Shutter speed (APEX)",
|
||||
NULL);
|
||||
|
||||
/*
|
||||
0- Auto
|
||||
|
@ -331,6 +348,11 @@ metadata_tags_exif_register (void)
|
|||
|
||||
/* image tags */
|
||||
|
||||
gst_tag_register (GST_TAG_IMAGE_HEIGHT, GST_TAG_FLAG_META,
|
||||
G_TYPE_UINT, GST_TAG_IMAGE_HEIGHT, "Image height in pixels", NULL);
|
||||
gst_tag_register (GST_TAG_IMAGE_WIDTH, GST_TAG_FLAG_META,
|
||||
G_TYPE_UINT, GST_TAG_IMAGE_WIDTH, "Image width in pixels", NULL);
|
||||
|
||||
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);
|
||||
|
|
|
@ -79,8 +79,10 @@ typedef enum {
|
|||
|
||||
/* individual tags */
|
||||
|
||||
#define GST_TAG_CAPTURE_APERTURE "capture-aperture"
|
||||
#define GST_TAG_CAPTURE_BRIGHTNESS "capture-brightness"
|
||||
#define GST_TAG_CAPTURE_CONTRAST "capture-contrast"
|
||||
#define GST_TAG_CAPTURE_CUSTOM_RENDERED "capture-custom-rendered"
|
||||
#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"
|
||||
|
@ -89,9 +91,10 @@ typedef enum {
|
|||
#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_LIGHT_SOURCE "capture-light-source"
|
||||
#define GST_TAG_CAPTURE_ORIENTATION "capture-orientation"
|
||||
#define GST_TAG_CAPTURE_SATURATION "capture-saturation"
|
||||
#define GST_TAG_CAPTURE_SHUTTER_SPEED "capture-shutter-speed"
|
||||
#define GST_TAG_CAPTURE_WHITE_BALANCE "capture-white-balance"
|
||||
|
||||
#define GST_TAG_CREATOR_TOOL "creator-tool"
|
||||
|
@ -99,6 +102,8 @@ typedef enum {
|
|||
#define GST_TAG_DEVICE_MAKE "device-make"
|
||||
#define GST_TAG_DEVICE_MODEL "device-model"
|
||||
|
||||
#define GST_TAG_IMAGE_HEIGHT "image-height"
|
||||
#define GST_TAG_IMAGE_WIDTH "image-width"
|
||||
#define GST_TAG_IMAGE_XRESOLUTION "image-xresolution"
|
||||
#define GST_TAG_IMAGE_YRESOLUTION "image-yresolution"
|
||||
|
||||
|
|
Loading…
Reference in a new issue