annotate ffmpeg/libavformat/dnxhddec.c @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents f445c3017523
children
rev   line source
yading@11 1 /*
yading@11 2 * RAW DNxHD (SMPTE VC-3) demuxer
yading@11 3 * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier@gmail.com>
yading@11 4 * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
yading@11 5 *
yading@11 6 * This file is part of FFmpeg.
yading@11 7 *
yading@11 8 * FFmpeg is free software; you can redistribute it and/or
yading@11 9 * modify it under the terms of the GNU Lesser General Public
yading@11 10 * License as published by the Free Software Foundation; either
yading@11 11 * version 2.1 of the License, or (at your option) any later version.
yading@11 12 *
yading@11 13 * FFmpeg is distributed in the hope that it will be useful,
yading@11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
yading@11 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
yading@11 16 * Lesser General Public License for more details.
yading@11 17 *
yading@11 18 * You should have received a copy of the GNU Lesser General Public
yading@11 19 * License along with FFmpeg; if not, write to the Free Software
yading@11 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
yading@11 21 */
yading@11 22
yading@11 23 #include "libavutil/intreadwrite.h"
yading@11 24 #include "avformat.h"
yading@11 25 #include "rawdec.h"
yading@11 26
yading@11 27 static int dnxhd_probe(AVProbeData *p)
yading@11 28 {
yading@11 29 static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
yading@11 30 int w, h, compression_id;
yading@11 31 if (p->buf_size < 0x2c)
yading@11 32 return 0;
yading@11 33 if (memcmp(p->buf, header, 5))
yading@11 34 return 0;
yading@11 35 h = AV_RB16(p->buf + 0x18);
yading@11 36 w = AV_RB16(p->buf + 0x1a);
yading@11 37 if (!w || !h)
yading@11 38 return 0;
yading@11 39 compression_id = AV_RB32(p->buf + 0x28);
yading@11 40 if (compression_id < 1235 || compression_id > 1253)
yading@11 41 return 0;
yading@11 42 return AVPROBE_SCORE_MAX;
yading@11 43 }
yading@11 44
yading@11 45 FF_DEF_RAWVIDEO_DEMUXER(dnxhd, "raw DNxHD (SMPTE VC-3)", dnxhd_probe, NULL, AV_CODEC_ID_DNXHD)