[FFmpeg-devel] [PATCH] webp: add support for EXIF metadata chunks

Thilo Borgmann thilo.borgmann at mail.de
Mon Jan 13 12:22:52 CET 2014


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


More information about the ffmpeg-devel mailing list