diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-08-08 16:14:18 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-08-08 16:14:18 +0200 |
commit | f73d75384f1d270eb12542940640d9bee50033e0 (patch) | |
tree | cc7c810099bf0cda92ee8b4536f5226bf03b5139 | |
parent | e4d983e2db0e73e711ae63dc9495316e121ec3da (diff) | |
download | ffmpeg-f73d75384f1d270eb12542940640d9bee50033e0.tar.gz |
Autodetect webp files.
-rw-r--r-- | libavformat/Makefile | 1 | ||||
-rw-r--r-- | libavformat/allformats.c | 1 | ||||
-rw-r--r-- | libavformat/img2dec.c | 11 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
4 files changed, 14 insertions, 1 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index a31f0bec19..37f81ed49d 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -197,6 +197,7 @@ OBJS-$(CONFIG_IMAGE_PNG_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_SGI_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_TIFF_PIPE_DEMUXER) += img2dec.o img2.o +OBJS-$(CONFIG_IMAGE_WEBP_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_INGENIENT_DEMUXER) += ingenientdec.o rawdec.o OBJS-$(CONFIG_IPMOVIE_DEMUXER) += ipmovie.o OBJS-$(CONFIG_IRCAM_DEMUXER) += ircamdec.o ircam.o pcm.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 5599baeec5..32bd3481ff 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -330,6 +330,7 @@ void av_register_all(void) REGISTER_DEMUXER (IMAGE_SGI_PIPE, image_sgi_pipe); REGISTER_DEMUXER (IMAGE_SUNRAST_PIPE, image_sunrast_pipe); REGISTER_DEMUXER (IMAGE_TIFF_PIPE, image_tiff_pipe); + REGISTER_DEMUXER (IMAGE_WEBP_PIPE, image_webp_pipe); /* protocols */ diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 259f90bc56..272adac69d 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -658,6 +658,16 @@ static int tiff_probe(AVProbeData *p) return 0; } +static int webp_probe(AVProbeData *p) +{ + const uint8_t *b = p->buf; + + if (AV_RB32(b) == 0x52494646 && + AV_RB32(b + 8) == 0x57454250) + return AVPROBE_SCORE_MAX - 1; + return 0; +} + #define IMAGEAUTO_DEMUXER(imgname, codecid)\ static const AVClass imgname ## _class = {\ .class_name = AV_STRINGIFY(imgname) " demuxer",\ @@ -685,3 +695,4 @@ IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG) IMAGEAUTO_DEMUXER(sgi, AV_CODEC_ID_SGI) IMAGEAUTO_DEMUXER(sunrast, AV_CODEC_ID_SUNRAST) IMAGEAUTO_DEMUXER(tiff, AV_CODEC_ID_TIFF) +IMAGEAUTO_DEMUXER(webp, AV_CODEC_ID_WEBP) diff --git a/libavformat/version.h b/libavformat/version.h index a10e14e455..4fbce9acf7 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 55 -#define LIBAVFORMAT_VERSION_MINOR 53 +#define LIBAVFORMAT_VERSION_MINOR 54 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |