diff options
author | Paul B Mahol <onemda@gmail.com> | 2018-12-08 13:06:31 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-12-10 11:20:41 +0100 |
commit | eade85bbbd935f4ab5e6315a45650c2bf01465c6 (patch) | |
tree | 592880259439aac8bd1c044508949486ee44ffd2 | |
parent | 8f66d46ce5f41be8084ad14061cec8f8e769d711 (diff) | |
download | ffmpeg-eade85bbbd935f4ab5e6315a45650c2bf01465c6.tar.gz |
avformat: add gif pipe demuxer
-rw-r--r-- | libavformat/Makefile | 1 | ||||
-rw-r--r-- | libavformat/allformats.c | 1 | ||||
-rw-r--r-- | libavformat/img2dec.c | 15 | ||||
-rw-r--r-- | libavformat/version.h | 4 |
4 files changed, 19 insertions, 2 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index d0d621de07..0e43a12df5 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -242,6 +242,7 @@ 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_GIF_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_J2K_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_JPEG_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER) += img2dec.o img2.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 5fb5bf17c6..df83b04484 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -463,6 +463,7 @@ extern AVInputFormat ff_image_bmp_pipe_demuxer; extern AVInputFormat ff_image_dds_pipe_demuxer; extern AVInputFormat ff_image_dpx_pipe_demuxer; extern AVInputFormat ff_image_exr_pipe_demuxer; +extern AVInputFormat ff_image_gif_pipe_demuxer; extern AVInputFormat ff_image_j2k_pipe_demuxer; extern AVInputFormat ff_image_jpeg_pipe_demuxer; extern AVInputFormat ff_image_jpegls_pipe_demuxer; diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index ff4757e532..e82b1df50b 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -29,6 +29,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/parseutils.h" #include "libavutil/intreadwrite.h" +#include "libavcodec/gif.h" #include "avformat.h" #include "avio_internal.h" #include "internal.h" @@ -1005,6 +1006,19 @@ static int xwd_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2 + 1; } +static int gif_probe(AVProbeData *p) +{ + /* check magick */ + if (memcmp(p->buf, gif87a_sig, 6) && memcmp(p->buf, gif89a_sig, 6)) + return 0; + + /* width or height contains zero? */ + if (!AV_RL16(&p->buf[6]) || !AV_RL16(&p->buf[8])) + return 0; + + return AVPROBE_SCORE_MAX - 1; +} + #define IMAGEAUTO_DEMUXER(imgname, codecid)\ static const AVClass imgname ## _class = {\ .class_name = AV_STRINGIFY(imgname) " demuxer",\ @@ -1028,6 +1042,7 @@ 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(gif, AV_CODEC_ID_GIF) IMAGEAUTO_DEMUXER(j2k, AV_CODEC_ID_JPEG2000) IMAGEAUTO_DEMUXER(jpeg, AV_CODEC_ID_MJPEG) IMAGEAUTO_DEMUXER(jpegls, AV_CODEC_ID_JPEGLS) diff --git a/libavformat/version.h b/libavformat/version.h index 30f2a84ddb..391ebed462 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -32,8 +32,8 @@ // 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 23 -#define LIBAVFORMAT_VERSION_MICRO 102 +#define LIBAVFORMAT_VERSION_MINOR 24 +#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ |