changeset 6439:4053f191ae61 libavformat

move dnxhd demuxer to its own file
author aurel
date Sun, 29 Aug 2010 21:51:47 +0000
parents 2facedc9f9d7
children 8beba113f242
files Makefile dnxhddec.c raw.c
diffstat 3 files changed, 55 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sun Aug 29 21:44:26 2010 +0000
+++ b/Makefile	Sun Aug 29 21:51:47 2010 +0000
@@ -54,7 +54,7 @@
 OBJS-$(CONFIG_DAUD_MUXER)                += daud.o
 OBJS-$(CONFIG_DIRAC_DEMUXER)             += diracdec.o raw.o
 OBJS-$(CONFIG_DIRAC_MUXER)               += raw.o
-OBJS-$(CONFIG_DNXHD_DEMUXER)             += raw.o
+OBJS-$(CONFIG_DNXHD_DEMUXER)             += dnxhddec.o raw.o
 OBJS-$(CONFIG_DNXHD_MUXER)               += raw.o
 OBJS-$(CONFIG_DSICIN_DEMUXER)            += dsicin.o
 OBJS-$(CONFIG_DTS_DEMUXER)               += dtsdec.o raw.o
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dnxhddec.c	Sun Aug 29 21:51:47 2010 +0000
@@ -0,0 +1,54 @@
+/*
+ * RAW DNxHD (SMPTE VC-3) demuxer
+ * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier@gmail.com>
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "avformat.h"
+#include "raw.h"
+
+static int dnxhd_probe(AVProbeData *p)
+{
+    static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
+    int w, h, compression_id;
+    if (p->buf_size < 0x2c)
+        return 0;
+    if (memcmp(p->buf, header, 5))
+        return 0;
+    h = AV_RB16(p->buf + 0x18);
+    w = AV_RB16(p->buf + 0x1a);
+    if (!w || !h)
+        return 0;
+    compression_id = AV_RB32(p->buf + 0x28);
+    if (compression_id < 1237 || compression_id > 1253)
+        return 0;
+    return AVPROBE_SCORE_MAX;
+}
+
+AVInputFormat dnxhd_demuxer = {
+    "dnxhd",
+    NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
+    0,
+    dnxhd_probe,
+    ff_raw_video_read_header,
+    ff_raw_read_partial_packet,
+    .flags= AVFMT_GENERIC_INDEX,
+    .value = CODEC_ID_DNXHD,
+};
--- a/raw.c	Sun Aug 29 21:44:26 2010 +0000
+++ b/raw.c	Sun Aug 29 21:51:47 2010 +0000
@@ -241,26 +241,6 @@
 }
 #endif
 
-#if CONFIG_DNXHD_DEMUXER
-static int dnxhd_probe(AVProbeData *p)
-{
-    static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
-    int w, h, compression_id;
-    if (p->buf_size < 0x2c)
-        return 0;
-    if (memcmp(p->buf, header, 5))
-        return 0;
-    h = AV_RB16(p->buf + 0x18);
-    w = AV_RB16(p->buf + 0x1a);
-    if (!w || !h)
-        return 0;
-    compression_id = AV_RB32(p->buf + 0x28);
-    if (compression_id < 1237 || compression_id > 1253)
-        return 0;
-    return AVPROBE_SCORE_MAX;
-}
-#endif
-
 #if CONFIG_AC3_DEMUXER || CONFIG_EAC3_DEMUXER
 static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
 {
@@ -363,19 +343,6 @@
 };
 #endif
 
-#if CONFIG_DNXHD_DEMUXER
-AVInputFormat dnxhd_demuxer = {
-    "dnxhd",
-    NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
-    0,
-    dnxhd_probe,
-    ff_raw_video_read_header,
-    ff_raw_read_partial_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .value = CODEC_ID_DNXHD,
-};
-#endif
-
 #if CONFIG_DNXHD_MUXER
 AVOutputFormat dnxhd_muxer = {
     "dnxhd",