[FFmpeg-cvslog] lavf/img2dec: Autodetect dds frames.

Carl Eugen Hoyos git at videolan.org
Mon Jun 29 17:40:59 CEST 2015


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Mon Jun 29 16:13:26 2015 +0200| [a876a4da4a926068a0a0c5c1a910be0e34f9e991] | committer: Carl Eugen Hoyos

lavf/img2dec: Autodetect dds frames.

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

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

diff --git a/libavformat/Makefile b/libavformat/Makefile
index cfff6aa..987f196 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -202,6 +202,7 @@ OBJS-$(CONFIG_IMAGE2PIPE_MUXER)          += img2enc.o img2.o
 OBJS-$(CONFIG_IMAGE2_ALIAS_PIX_DEMUXER)  += img2_alias_pix.o
 OBJS-$(CONFIG_IMAGE2_BRENDER_PIX_DEMUXER) += img2_brender_pix.o
 OBJS-$(CONFIG_IMAGE_BMP_PIPE_DEMUXER)     += img2dec.o img2.o
+OBJS-$(CONFIG_IMAGE_DDS_PIPE_DEMUXER)     += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_DPX_PIPE_DEMUXER)     += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_EXR_PIPE_DEMUXER)     += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_J2K_PIPE_DEMUXER)     += img2dec.o img2.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index d65b7d4..2caa6b1 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -335,6 +335,7 @@ void av_register_all(void)
 
     /* image demuxers */
     REGISTER_DEMUXER (IMAGE_BMP_PIPE,        image_bmp_pipe);
+    REGISTER_DEMUXER (IMAGE_DDS_PIPE,        image_dds_pipe);
     REGISTER_DEMUXER (IMAGE_DPX_PIPE,        image_dpx_pipe);
     REGISTER_DEMUXER (IMAGE_EXR_PIPE,        image_exr_pipe);
     REGISTER_DEMUXER (IMAGE_J2K_PIPE,        image_j2k_pipe);
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 0830f00..772204c 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -609,6 +609,17 @@ static int bmp_probe(AVProbeData *p)
     return AVPROBE_SCORE_EXTENSION / 4;
 }
 
+static int dds_probe(AVProbeData *p)
+{
+    const uint8_t *b = p->buf;
+
+    if (   AV_RB64(b) == 0x444453207c000000
+        && AV_RL32(b +  8)
+        && AV_RL32(b + 12))
+        return AVPROBE_SCORE_MAX - 1;
+    return 0;
+}
+
 static int dpx_probe(AVProbeData *p)
 {
     const uint8_t *b = p->buf;
@@ -799,6 +810,7 @@ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
 };
 
 IMAGEAUTO_DEMUXER(bmp,     AV_CODEC_ID_BMP)
+IMAGEAUTO_DEMUXER(dds,     AV_CODEC_ID_DDS)
 IMAGEAUTO_DEMUXER(dpx,     AV_CODEC_ID_DPX)
 IMAGEAUTO_DEMUXER(exr,     AV_CODEC_ID_EXR)
 IMAGEAUTO_DEMUXER(j2k,     AV_CODEC_ID_JPEG2000)
diff --git a/libavformat/version.h b/libavformat/version.h
index a6d368e..052551c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR  39
+#define LIBAVFORMAT_VERSION_MINOR  40
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list