diff options
author | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2008-08-26 15:58:25 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2008-08-26 15:58:25 +0000 |
commit | cedebde15adf210a0dd301830776fec1f4ca387a (patch) | |
tree | da705a162dddc43210b223fb1c5bd5dbd121c7b6 /libavformat/mxfenc.c | |
parent | ef1bc972ddf483e9938bd52a62a75c9ed217d522 (diff) | |
download | ffmpeg-cedebde15adf210a0dd301830776fec1f4ca387a.tar.gz |
Remaining parts of GSoC MXF muxer by Zhentan Feng.
Originally committed as revision 14975 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r-- | libavformat/mxfenc.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 08f80523d8..3bcd6a34c4 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -245,6 +245,42 @@ static const MXFDataDefinitionUL *mxf_get_data_definition_ul(enum CodecType type 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; |