diff options
author | Carl Eugen Hoyos | 2015-06-29 16:13:26 +0200 |
---|---|---|
committer | Carl Eugen Hoyos | 2015-06-29 16:13:26 +0200 |
commit | a876a4da4a926068a0a0c5c1a910be0e34f9e991 (patch) | |
tree | 9a284dc40c48dc86265a6c8f52d0792e55b5e6ff /libavformat | |
parent | f6ab967eae497733f6adc12b30075980fd6eea98 (diff) |
lavf/img2dec: Autodetect dds frames.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/Makefile | 1 | ||||
-rw-r--r-- | libavformat/allformats.c | 1 | ||||
-rw-r--r-- | libavformat/img2dec.c | 12 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
4 files changed, 15 insertions, 1 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index cfff6aab46..987f196859 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 d65b7d4681..2caa6b111b 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 0830f0073c..772204cde6 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 a6d368ec0f..052551cfb5 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, \ |