[FFmpeg-devel] [PATCH] webp: add support for EXIF metadata chunks
James Almer
jamrial at gmail.com
Mon Jan 13 20:37:36 CET 2014
On 13/01/14 8:22 AM, Thilo Borgmann wrote:
> Am 13.01.14 05:37, schrieb James Almer:
>> Based on mjpeg code by Thilo Borgmann
>>
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>> [...]
>> @@ -1418,10 +1426,44 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
>>
>> break;
>> }
>> + case MKTAG('E', 'X', 'I', 'F'): {
>> + int le, ifd_offset, exif_offset = bytestream2_tell(&gb);
>> + GetByteContext exif_gb;
>> +
>> + if (s->has_exif) {
>> + av_log(avctx, AV_LOG_VERBOSE, "Ignoring extra EXIF chunk\n");
>> + goto exif_end;
>> + }
>> + if (!(vp8x_flags & VP8X_FLAG_EXIF_METADATA))
>> + av_log(avctx, AV_LOG_WARNING,
>> + "EXIF chunk present, but exif bit not set in the "
>> + "VP8X header\n");
>> +
>> + s->has_exif = 1;
>
>> + bytestream2_init(&exif_gb, avpkt->data + exif_offset,
>> + avpkt->size - exif_offset);
>
> Nobody argued about it in mjpegdec.c and I do not know what bytestream2 does
> internally, but I could imagine a byte alignement could be of use here. Check
> with the specification, maybe it is good as it is, I'm not sure.
>
>
> Looks good to me otherwise - but I have no way to compile & run it right now.
>
> -Thilo
The WebM spec doesn't mention anything beyond "Exif metadata goes inside an
EXIF chunk, of which there should be no more than one", and the files i
created with libwebp worked as it is.
I also don't see any kind of alignment function from bytestream2 like there
is for getbits.
Regards.
More information about the ffmpeg-devel
mailing list