summaryrefslogtreecommitdiff
path: root/libavformat/img2dec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2014-07-04 02:10:26 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2014-07-04 02:10:26 +0200
commit4c145b692c31802b6f1be248f56450e20331269b (patch)
treeb28f296df196e309b96552a4d7c25f876f8d8f4b /libavformat/img2dec.c
parent8279a152847005a124de1f4b33b35b9c85e1a116 (diff)
Autodetect JPEG2000 imagess.
Autodetection of jp2 files does not work yet, the files are detected as mov.
Diffstat (limited to 'libavformat/img2dec.c')
-rw-r--r--libavformat/img2dec.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index a8f87efb67..e795842afe 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -583,6 +583,16 @@ static int exr_probe(AVProbeData *p)
return 0;
}
+static int j2k_probe(AVProbeData *p)
+{
+ const uint8_t *b = p->buf;
+
+ if (AV_RB64(b) == 0x0000000c6a502020 ||
+ AV_RB32(b) == 0xff4fff51)
+ return AVPROBE_SCORE_EXTENSION + 1;
+ return 0;
+}
+
static int pictor_probe(AVProbeData *p)
{
const uint8_t *b = p->buf;
@@ -653,6 +663,7 @@ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
IMAGEAUTO_DEMUXER(bmp, AV_CODEC_ID_BMP)
IMAGEAUTO_DEMUXER(dpx, AV_CODEC_ID_DPX)
IMAGEAUTO_DEMUXER(exr, AV_CODEC_ID_EXR)
+IMAGEAUTO_DEMUXER(j2k, AV_CODEC_ID_JPEG2000)
IMAGEAUTO_DEMUXER(pictor, AV_CODEC_ID_PICTOR)
IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
IMAGEAUTO_DEMUXER(sgi, AV_CODEC_ID_SGI)