[FFmpeg-cvslog] lavf/img2dec: Auto-detect Kodak Photo CD image files.
Carl Eugen Hoyos
git at videolan.org
Sat Sep 5 11:48:18 EEST 2020
ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Sat Sep 5 10:45:52 2020 +0200| [d263838958def82118bc2abe7fe1ccb0821af550] | committer: Carl Eugen Hoyos
lavf/img2dec: Auto-detect Kodak Photo CD image files.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d263838958def82118bc2abe7fe1ccb0821af550
---
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 7f852c05ff..2368bc15ac 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -261,6 +261,7 @@ OBJS-$(CONFIG_IMAGE_PBM_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_PCX_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_PGM_PIPE_DEMUXER) += img2dec.o img2.o
+OBJS-$(CONFIG_IMAGE_PHOTOCD_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_PICTOR_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_PNG_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_PPM_PIPE_DEMUXER) += img2dec.o img2.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 8a733b3f4d..3438a14141 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -494,6 +494,7 @@ extern AVInputFormat ff_image_pcx_pipe_demuxer;
extern AVInputFormat ff_image_pgmyuv_pipe_demuxer;
extern AVInputFormat ff_image_pgm_pipe_demuxer;
extern AVInputFormat ff_image_pgx_pipe_demuxer;
+extern AVInputFormat ff_image_photocd_pipe_demuxer;
extern AVInputFormat ff_image_pictor_pipe_demuxer;
extern AVInputFormat ff_image_png_pipe_demuxer;
extern AVInputFormat ff_image_ppm_pipe_demuxer;
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index a7e89cd056..9a3c9fad02 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -1070,6 +1070,17 @@ static int gif_probe(const AVProbeData *p)
return AVPROBE_SCORE_MAX - 1;
}
+static int photocd_probe(const AVProbeData *p)
+{
+ if (!memcmp(p->buf, "PCD_OPA", 7))
+ return AVPROBE_SCORE_MAX - 1;
+
+ if (p->buf_size < 0x807 || memcmp(p->buf + 0x800, "PCD_IPI", 7))
+ return 0;
+
+ return AVPROBE_SCORE_MAX - 1;
+}
+
#define IMAGEAUTO_DEMUXER(imgname, codecid)\
static const AVClass imgname ## _class = {\
.class_name = AV_STRINGIFY(imgname) " demuxer",\
@@ -1103,6 +1114,7 @@ IMAGEAUTO_DEMUXER(pcx, AV_CODEC_ID_PCX)
IMAGEAUTO_DEMUXER(pgm, AV_CODEC_ID_PGM)
IMAGEAUTO_DEMUXER(pgmyuv, AV_CODEC_ID_PGMYUV)
IMAGEAUTO_DEMUXER(pgx, AV_CODEC_ID_PGX)
+IMAGEAUTO_DEMUXER(photocd, AV_CODEC_ID_PHOTOCD)
IMAGEAUTO_DEMUXER(pictor, AV_CODEC_ID_PICTOR)
IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
IMAGEAUTO_DEMUXER(ppm, AV_CODEC_ID_PPM)
diff --git a/libavformat/version.h b/libavformat/version.h
index 4208d38072..7771a6abf2 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
-#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