The makernote is "a tag for manufacturers of Exif writers to record any desired information.
The following step shows how to enable the tag and put your additional information into makernote.
STEP1:ADD the tag EXIF_TAG_MAKERNOTE into the list exifTagID[]
/vendor/mediatek/proprietary/hardware/mtkcam/utils/exif/common/exif_type.h
#define EXIF_TAG_MAKERNOTE 0x927C
static unsigned short exifTagID[] = {
.......
EXIF_TAG_FOCALLEN,
EXIF_TAG_MAKERNOTE, // add EXIF_TAG_MAKERNOTE Tag
/*EXIF_TAG_USRCOMMENT,*/
}
STEP2: Add the tag update function
/vendor/mediatek/proprietary/hardware/mtkcam/utils/exif/common/exif_make.cpp
unsigned int
ExifUtils::exifTagUpdate(
unsigned int
ExifUtils::exifTagUpdate(
//Add the tag update function
err = ifdListNodeModify(IFD_TYPE_EXIFIFD, EXIF_TAG_MAKERNOTE, XXXXXXXX); //XXX The additional information you want
if (err != EXIF_NO_ERROR) {
MEXIF_LOGE("EXIF_TAG_MAKERNOTE FAIL(%x)", err);
return err;
}
}
STEP3: Setup the buf size for your additional information
enum ifdDataType {
IFD_DATATYPE_BYTE = 1,
IFD_DATATYPE_ASCII,
IFD_DATATYPE_SHORT,
IFD_DATATYPE_LONG,
IFD_DATATYPE_RATIONAL,
IFD_DATATYPE_UNDEFINED = 7,
IFD_DATATYPE_SLONG = 9,
IFD_DATATYPE_SRATIONAL = 10
};
IFD_DATATYPE_BYTE = 1,
IFD_DATATYPE_ASCII,
IFD_DATATYPE_SHORT,
IFD_DATATYPE_LONG,
IFD_DATATYPE_RATIONAL,
IFD_DATATYPE_UNDEFINED = 7,
IFD_DATATYPE_SLONG = 9,
IFD_DATATYPE_SRATIONAL = 10
};
vendor\mediatek\proprietary\hardware\mtkcam\utils\exif\common\Exif_ifdinit.cpp
unsigned int
ExifUtils::ifdExifIFDValInit
ExifUtils::ifdExifIFDValInit
{
case EXIF_TAG_MAKERNOTE: //Add
pifd->type = IFD_DATATYPE_UNDEFINED; //data type
pifd->count = 256; // Depend on your data to change the size.
pifd->valoff = plist->valBufPos;
plist->valBufPos += 256; // Depend on your data to change the size.
pdata += 256; // Depend on your data to change the size.
break;
pifd->type = IFD_DATATYPE_UNDEFINED; //data type
pifd->count = 256; // Depend on your data to change the size.
pifd->valoff = plist->valBufPos;
plist->valBufPos += 256; // Depend on your data to change the size.
pdata += 256; // Depend on your data to change the size.
break;
}