comparison mpegaudiodec.c @ 3777:20545fbb6f7c libavcodec

add some #ifdef CONFIG_ENCODERS/DECODERS
author mru
date Wed, 27 Sep 2006 19:54:07 +0000
parents 1843a85123b7
children 92d8a536268f
comparison
equal deleted inserted replaced
3776:1843a85123b7 3777:20545fbb6f7c
2577 av_log(avctx, AV_LOG_DEBUG, "Error while decoding mpeg audio frame\n"); //FIXME return -1 / but also return the number of bytes consumed 2577 av_log(avctx, AV_LOG_DEBUG, "Error while decoding mpeg audio frame\n"); //FIXME return -1 / but also return the number of bytes consumed
2578 s->frame_size = 0; 2578 s->frame_size = 0;
2579 return buf_size; 2579 return buf_size;
2580 } 2580 }
2581 2581
2582 2582 #ifdef CONFIG_MP3ADU_DECODER
2583 static int decode_frame_adu(AVCodecContext * avctx, 2583 static int decode_frame_adu(AVCodecContext * avctx,
2584 void *data, int *data_size, 2584 void *data, int *data_size,
2585 uint8_t * buf, int buf_size) 2585 uint8_t * buf, int buf_size)
2586 { 2586 {
2587 MPADecodeContext *s = avctx->priv_data; 2587 MPADecodeContext *s = avctx->priv_data;
2625 } 2625 }
2626 2626
2627 *data_size = out_size; 2627 *data_size = out_size;
2628 return buf_size; 2628 return buf_size;
2629 } 2629 }
2630 2630 #endif /* CONFIG_MP3ADU_DECODER */
2631 2631
2632 #ifdef CONFIG_MP3ON4_DECODER
2632 /* Next 3 arrays are indexed by channel config number (passed via codecdata) */ 2633 /* Next 3 arrays are indexed by channel config number (passed via codecdata) */
2633 static int mp3Frames[16] = {0,1,1,2,3,3,4,5,2}; /* number of mp3 decoder instances */ 2634 static int mp3Frames[16] = {0,1,1,2,3,3,4,5,2}; /* number of mp3 decoder instances */
2634 static int mp3Channels[16] = {0,1,2,3,4,5,6,8,4}; /* total output channels */ 2635 static int mp3Channels[16] = {0,1,2,3,4,5,6,8,4}; /* total output channels */
2635 /* offsets into output buffer, assume output order is FL FR BL BR C LFE */ 2636 /* offsets into output buffer, assume output order is FL FR BL BR C LFE */
2636 static int chan_offset[9][5] = { 2637 static int chan_offset[9][5] = {
2783 avctx->bit_rate += s->mp3decctx[i]->bit_rate; 2784 avctx->bit_rate += s->mp3decctx[i]->bit_rate;
2784 2785
2785 *data_size = out_size; 2786 *data_size = out_size;
2786 return buf_size; 2787 return buf_size;
2787 } 2788 }
2788 2789 #endif /* CONFIG_MP3ON4_DECODER */
2789 2790
2791 #ifdef CONFIG_MP2_DECODER
2790 AVCodec mp2_decoder = 2792 AVCodec mp2_decoder =
2791 { 2793 {
2792 "mp2", 2794 "mp2",
2793 CODEC_TYPE_AUDIO, 2795 CODEC_TYPE_AUDIO,
2794 CODEC_ID_MP2, 2796 CODEC_ID_MP2,
2797 NULL, 2799 NULL,
2798 NULL, 2800 NULL,
2799 decode_frame, 2801 decode_frame,
2800 CODEC_CAP_PARSE_ONLY, 2802 CODEC_CAP_PARSE_ONLY,
2801 }; 2803 };
2802 2804 #endif
2805 #ifdef CONFIG_MP3_DECODER
2803 AVCodec mp3_decoder = 2806 AVCodec mp3_decoder =
2804 { 2807 {
2805 "mp3", 2808 "mp3",
2806 CODEC_TYPE_AUDIO, 2809 CODEC_TYPE_AUDIO,
2807 CODEC_ID_MP3, 2810 CODEC_ID_MP3,
2810 NULL, 2813 NULL,
2811 NULL, 2814 NULL,
2812 decode_frame, 2815 decode_frame,
2813 CODEC_CAP_PARSE_ONLY, 2816 CODEC_CAP_PARSE_ONLY,
2814 }; 2817 };
2815 2818 #endif
2819 #ifdef CONFIG_MP3ADU_DECODER
2816 AVCodec mp3adu_decoder = 2820 AVCodec mp3adu_decoder =
2817 { 2821 {
2818 "mp3adu", 2822 "mp3adu",
2819 CODEC_TYPE_AUDIO, 2823 CODEC_TYPE_AUDIO,
2820 CODEC_ID_MP3ADU, 2824 CODEC_ID_MP3ADU,
2823 NULL, 2827 NULL,
2824 NULL, 2828 NULL,
2825 decode_frame_adu, 2829 decode_frame_adu,
2826 CODEC_CAP_PARSE_ONLY, 2830 CODEC_CAP_PARSE_ONLY,
2827 }; 2831 };
2828 2832 #endif
2833 #ifdef CONFIG_MP3ON4_DECODER
2829 AVCodec mp3on4_decoder = 2834 AVCodec mp3on4_decoder =
2830 { 2835 {
2831 "mp3on4", 2836 "mp3on4",
2832 CODEC_TYPE_AUDIO, 2837 CODEC_TYPE_AUDIO,
2833 CODEC_ID_MP3ON4, 2838 CODEC_ID_MP3ON4,
2836 NULL, 2841 NULL,
2837 decode_close_mp3on4, 2842 decode_close_mp3on4,
2838 decode_frame_mp3on4, 2843 decode_frame_mp3on4,
2839 0 2844 0
2840 }; 2845 };
2846 #endif