Mercurial > libavformat.hg
comparison audio.c @ 1169:d18cc9a1fd02 libavformat
allow individual selection of muxers and demuxers
author | mru |
---|---|
date | Mon, 10 Jul 2006 21:14:37 +0000 |
parents | d89d7ef290da |
children | 0899bfe4105c |
comparison
equal
deleted
inserted
replaced
1168:c894489e2abe | 1169:d18cc9a1fd02 |
---|---|
311 | 311 |
312 audio_close(s); | 312 audio_close(s); |
313 return 0; | 313 return 0; |
314 } | 314 } |
315 | 315 |
316 static AVInputFormat audio_demuxer = { | 316 #ifdef CONFIG_AUDIO_DEMUXER |
317 AVInputFormat audio_demuxer = { | |
317 "audio_device", | 318 "audio_device", |
318 "audio grab and output", | 319 "audio grab and output", |
319 sizeof(AudioData), | 320 sizeof(AudioData), |
320 NULL, | 321 NULL, |
321 audio_read_header, | 322 audio_read_header, |
322 audio_read_packet, | 323 audio_read_packet, |
323 audio_read_close, | 324 audio_read_close, |
324 .flags = AVFMT_NOFILE, | 325 .flags = AVFMT_NOFILE, |
325 }; | 326 }; |
326 | 327 #endif |
327 static AVOutputFormat audio_muxer = { | 328 |
329 #ifdef CONFIG_AUDIO_MUXER | |
330 AVOutputFormat audio_muxer = { | |
328 "audio_device", | 331 "audio_device", |
329 "audio grab and output", | 332 "audio grab and output", |
330 "", | 333 "", |
331 "", | 334 "", |
332 sizeof(AudioData), | 335 sizeof(AudioData), |
342 audio_write_header, | 345 audio_write_header, |
343 audio_write_packet, | 346 audio_write_packet, |
344 audio_write_trailer, | 347 audio_write_trailer, |
345 .flags = AVFMT_NOFILE, | 348 .flags = AVFMT_NOFILE, |
346 }; | 349 }; |
347 | 350 #endif |
348 int audio_init(void) | |
349 { | |
350 av_register_input_format(&audio_demuxer); | |
351 av_register_output_format(&audio_muxer); | |
352 return 0; | |
353 } |