aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/img2dec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2014-08-08 16:14:18 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2014-08-08 16:14:18 +0200
commitf73d75384f1d270eb12542940640d9bee50033e0 (patch)
treecc7c810099bf0cda92ee8b4536f5226bf03b5139 /libavformat/img2dec.c
parente4d983e2db0e73e711ae63dc9495316e121ec3da (diff)
downloadffmpeg-f73d75384f1d270eb12542940640d9bee50033e0.tar.gz
Autodetect webp files.
Diffstat (limited to 'libavformat/img2dec.c')
-rw-r--r--libavformat/img2dec.c11
1 files changed, 11 insertions, 0 deletions
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)