[FFmpeg-cvslog] r14975 - in trunk: Changelog libavformat/Makefile libavformat/allformats.c libavformat/mxf.h libavformat/mxfenc.c

cehoyos subversion
Tue Aug 26 17:58:29 CEST 2008


Author: cehoyos
Date: Tue Aug 26 17:58:25 2008
New Revision: 14975

Log:
Remaining parts of GSoC MXF muxer by Zhentan Feng.

Modified:
   trunk/Changelog
   trunk/libavformat/Makefile
   trunk/libavformat/allformats.c
   trunk/libavformat/mxf.h
   trunk/libavformat/mxfenc.c

Modified: trunk/Changelog
==============================================================================
--- trunk/Changelog	(original)
+++ trunk/Changelog	Tue Aug 26 17:58:25 2008
@@ -132,6 +132,7 @@ version <next>
 - Apple Lossless Audio Codec (ALAC) encoder
 - AAC decoder
 - floating point PCM encoder/decoder
+- MXF muxer
 
 version 0.4.9-pre1:
 

Modified: trunk/libavformat/Makefile
==============================================================================
--- trunk/libavformat/Makefile	(original)
+++ trunk/libavformat/Makefile	Tue Aug 26 17:58:25 2008
@@ -109,6 +109,7 @@ OBJS-$(CONFIG_MSNWC_TCP_DEMUXER)        
 OBJS-$(CONFIG_MTV_DEMUXER)               += mtv.o
 OBJS-$(CONFIG_MVI_DEMUXER)               += mvi.o
 OBJS-$(CONFIG_MXF_DEMUXER)               += mxfdec.o mxf.o
+OBJS-$(CONFIG_MXF_MUXER)                 += mxfenc.o mxf.o
 OBJS-$(CONFIG_NSV_DEMUXER)               += nsvdec.o
 OBJS-$(CONFIG_NULL_MUXER)                += raw.o
 OBJS-$(CONFIG_NUT_DEMUXER)               += nutdec.o nut.o riff.o

Modified: trunk/libavformat/allformats.c
==============================================================================
--- trunk/libavformat/allformats.c	(original)
+++ trunk/libavformat/allformats.c	Tue Aug 26 17:58:25 2008
@@ -124,7 +124,7 @@ void av_register_all(void)
     REGISTER_DEMUXER  (MSNWC_TCP, msnwc_tcp);
     REGISTER_DEMUXER  (MTV, mtv);
     REGISTER_DEMUXER  (MVI, mvi);
-    REGISTER_DEMUXER  (MXF, mxf);
+    REGISTER_MUXDEMUX (MXF, mxf);
     REGISTER_DEMUXER  (NSV, nsv);
     REGISTER_MUXER    (NULL, null);
     REGISTER_MUXDEMUX (NUT, nut);

Modified: trunk/libavformat/mxf.h
==============================================================================
--- trunk/libavformat/mxf.h	(original)
+++ trunk/libavformat/mxf.h	Tue Aug 26 17:58:25 2008
@@ -63,7 +63,7 @@ typedef struct {
 
 extern const MXFDataDefinitionUL ff_mxf_data_definition_uls[];
 extern const MXFCodecUL ff_mxf_codec_uls[];
-extern const MXFCodecUL ff_mxf_essence_container_uls[];
+extern const MXFCodecUL ff_mxf_essence_container_uls[6];
 
 #ifdef DEBUG
 #define PRINT_KEY(pc, s, x) dprintf(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \

Modified: trunk/libavformat/mxfenc.c
==============================================================================
--- trunk/libavformat/mxfenc.c	(original)
+++ trunk/libavformat/mxfenc.c	Tue Aug 26 17:58:25 2008
@@ -245,6 +245,42 @@ static const MXFDataDefinitionUL *mxf_ge
     return uls;
 }
 
+static int mxf_write_essence_container_refs(AVFormatContext *s, int write)
+{
+    ByteIOContext *pb = s->pb;
+    AVStream *st;
+    int i, count = 0, j = 0;
+    const MXFCodecUL *codec_ul;
+    int essence_container_ul_sign[sizeof(ff_mxf_essence_container_uls) / sizeof(MXFCodecUL)] = { 0 };
+
+    for (codec_ul = ff_mxf_essence_container_uls; codec_ul->id; codec_ul++) {
+        for (i = 0; i < s->nb_streams; i++) {
+            st = s->streams[i];
+            if (st->codec->codec_id == codec_ul->id) {
+                essence_container_ul_sign[count] = j;
+                count++;
+                break;
+            }
+        }
+        j++;
+        // considering WAV/AES3 frame wrapped, when get the first CODEC_ID_PCM_S16LE, break;
+        // this is a temporary method, when we can get  more information, modofy this.
+        if (codec_ul->id == CODEC_ID_PCM_S16LE)
+            break;
+    }
+
+    if (write) {
+        mxf_write_refs_count(pb, count);
+        for (i = 0; i < count; i++) {
+            put_buffer(pb, ff_mxf_essence_container_uls[essence_container_ul_sign[i]].uid, 16);
+        }
+        av_log(s,AV_LOG_DEBUG, "essence container count:%d\n", count);
+        for (i = 0; i < count; i++)
+            PRINT_KEY(s, "essence container ul:\n", ff_mxf_essence_container_uls[essence_container_ul_sign[i]].uid);
+    }
+    return count;
+}
+
 static void mxf_write_preface(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;




More information about the ffmpeg-cvslog mailing list