Revision 9b4f1cdb

View differences:

libavcodec/avcodec.h
3227 3227

  
3228 3228
typedef struct ReSampleContext ReSampleContext;
3229 3229

  
3230
#if FF_API_AUDIO_OLD
3231
/**
3232
 * @deprecated Use av_audio_resample_init() instead.
3233
 */
3234
attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
3235
                                                          int output_rate, int input_rate);
3236
#endif
3237

  
3238 3230
/**
3239 3231
 *  Initialize audio resampling context.
3240 3232
 *
......
3706 3698
 */
3707 3699
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
3708 3700

  
3709
#if FF_API_AUDIO_OLD
3710
/**
3711
 * Decode an audio frame from buf into samples.
3712
 * Wrapper function which calls avcodec_decode_audio3.
3713
 *
3714
 * @deprecated Use avcodec_decode_audio3 instead.
3715
 * @param avctx the codec context
3716
 * @param[out] samples the output buffer
3717
 * @param[in,out] frame_size_ptr the output buffer size in bytes
3718
 * @param[in] buf the input buffer
3719
 * @param[in] buf_size the input buffer size in bytes
3720
 * @return On error a negative value is returned, otherwise the number of bytes
3721
 * used or zero if no frame could be decompressed.
3722
 */
3723
attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
3724
                         int *frame_size_ptr,
3725
                         const uint8_t *buf, int buf_size);
3726
#endif
3727

  
3728 3701
/**
3729 3702
 * Decode the audio frame of size avpkt->size from avpkt->data into samples.
3730 3703
 * Some decoders may support multiple frames in a single AVPacket, such
libavcodec/resample.c
218 218
    return s;
219 219
}
220 220

  
221
#if FF_API_AUDIO_OLD
222
ReSampleContext *audio_resample_init(int output_channels, int input_channels,
223
                                     int output_rate, int input_rate)
224
{
225
    return av_audio_resample_init(output_channels, input_channels,
226
                                  output_rate, input_rate,
227
                                  AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
228
                                  TAPS, 10, 0, 0.8);
229
}
230
#endif
231

  
232 221
/* resample audio. 'nb_samples' is the number of input samples */
233 222
/* XXX: optimize it ! */
234 223
int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples)
libavcodec/utils.c
679 679
    return ret;
680 680
}
681 681

  
682
#if FF_API_AUDIO_OLD
683
int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
684
                         int *frame_size_ptr,
685
                         const uint8_t *buf, int buf_size)
686
{
687
    AVPacket avpkt;
688
    av_init_packet(&avpkt);
689
    avpkt.data = buf;
690
    avpkt.size = buf_size;
691

  
692
    return avcodec_decode_audio3(avctx, samples, frame_size_ptr, &avpkt);
693
}
694
#endif
695

  
696 682
int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
697 683
                         int *frame_size_ptr,
698 684
                         AVPacket *avpkt)
libavcodec/version.h
41 41
#ifndef FF_API_PALETTE_CONTROL
42 42
#define FF_API_PALETTE_CONTROL  (LIBAVCODEC_VERSION_MAJOR < 54)
43 43
#endif
44
#ifndef FF_API_AUDIO_OLD
45
#define FF_API_AUDIO_OLD        (LIBAVCODEC_VERSION_MAJOR < 53)
46
#endif
47 44
#ifndef FF_API_VIDEO_OLD
48 45
#define FF_API_VIDEO_OLD        (LIBAVCODEC_VERSION_MAJOR < 53)
49 46
#endif

Also available in: Unified diff