[FFmpeg-cvslog] Autodetect webp files.

Carl Eugen Hoyos git at videolan.org
Fri Aug 8 17:23:43 CEST 2014


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Fri Aug  8 16:14:18 2014 +0200| [f73d75384f1d270eb12542940640d9bee50033e0] | committer: Carl Eugen Hoyos

Autodetect webp files.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f73d75384f1d270eb12542940640d9bee50033e0
---

 libavformat/Makefile     |    1 +
 libavformat/allformats.c |    1 +
 libavformat/img2dec.c    |   11 +++++++++++
 libavformat/version.h    |    2 +-
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index a31f0be..37f81ed 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 5599bae..32bd348 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 259f90b..272adac 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 a10e14e..4fbce9a 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, \



More information about the ffmpeg-cvslog mailing list