comparison mxfenc.c @ 3780:261cd3e672e5 libavformat

Remaining parts of GSoC MXF muxer by Zhentan Feng.
author cehoyos
date Tue, 26 Aug 2008 15:58:25 +0000
parents 85d3aca03313
children a6d4e93e171b
comparison
equal deleted inserted replaced
3779:4ea69956d2e8 3780:261cd3e672e5
243 uls ++; 243 uls ++;
244 } 244 }
245 return uls; 245 return uls;
246 } 246 }
247 247
248 static int mxf_write_essence_container_refs(AVFormatContext *s, int write)
249 {
250 ByteIOContext *pb = s->pb;
251 AVStream *st;
252 int i, count = 0, j = 0;
253 const MXFCodecUL *codec_ul;
254 int essence_container_ul_sign[sizeof(ff_mxf_essence_container_uls) / sizeof(MXFCodecUL)] = { 0 };
255
256 for (codec_ul = ff_mxf_essence_container_uls; codec_ul->id; codec_ul++) {
257 for (i = 0; i < s->nb_streams; i++) {
258 st = s->streams[i];
259 if (st->codec->codec_id == codec_ul->id) {
260 essence_container_ul_sign[count] = j;
261 count++;
262 break;
263 }
264 }
265 j++;
266 // considering WAV/AES3 frame wrapped, when get the first CODEC_ID_PCM_S16LE, break;
267 // this is a temporary method, when we can get more information, modofy this.
268 if (codec_ul->id == CODEC_ID_PCM_S16LE)
269 break;
270 }
271
272 if (write) {
273 mxf_write_refs_count(pb, count);
274 for (i = 0; i < count; i++) {
275 put_buffer(pb, ff_mxf_essence_container_uls[essence_container_ul_sign[i]].uid, 16);
276 }
277 av_log(s,AV_LOG_DEBUG, "essence container count:%d\n", count);
278 for (i = 0; i < count; i++)
279 PRINT_KEY(s, "essence container ul:\n", ff_mxf_essence_container_uls[essence_container_ul_sign[i]].uid);
280 }
281 return count;
282 }
283
248 static void mxf_write_preface(AVFormatContext *s) 284 static void mxf_write_preface(AVFormatContext *s)
249 { 285 {
250 MXFContext *mxf = s->priv_data; 286 MXFContext *mxf = s->priv_data;
251 ByteIOContext *pb = s->pb; 287 ByteIOContext *pb = s->pb;
252 288