lavc: deprecate the audio resampling API.

It has been superseded by lavr.
pull/6/head
Anton Khirnov 12 years ago
parent f6f7d15041
commit 30223b3bf2
  1. 10
      libavcodec/avcodec.h
  2. 4
      libavcodec/resample.c
  3. 4
      libavcodec/resample2.c
  4. 3
      libavcodec/version.h

@ -4022,9 +4022,11 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
* @} * @}
*/ */
#if FF_API_AVCODEC_RESAMPLE
/** /**
* @defgroup lavc_resample Audio resampling * @defgroup lavc_resample Audio resampling
* @ingroup libavc * @ingroup libavc
* @deprecated use libavresample instead
* *
* @{ * @{
*/ */
@ -4049,6 +4051,7 @@ typedef struct ReSampleContext ReSampleContext;
* @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
* @return allocated ReSampleContext, NULL if error occurred * @return allocated ReSampleContext, NULL if error occurred
*/ */
attribute_deprecated
ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
int output_rate, int input_rate, int output_rate, int input_rate,
enum AVSampleFormat sample_fmt_out, enum AVSampleFormat sample_fmt_out,
@ -4056,6 +4059,7 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
int filter_length, int log2_phase_count, int filter_length, int log2_phase_count,
int linear, double cutoff); int linear, double cutoff);
attribute_deprecated
int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
/** /**
@ -4064,6 +4068,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
* @param s a non-NULL pointer to a resample context previously * @param s a non-NULL pointer to a resample context previously
* created with av_audio_resample_init() * created with av_audio_resample_init()
*/ */
attribute_deprecated
void audio_resample_close(ReSampleContext *s); void audio_resample_close(ReSampleContext *s);
@ -4076,6 +4081,7 @@ void audio_resample_close(ReSampleContext *s);
between the 2 closest, if 0 the closest will be used between the 2 closest, if 0 the closest will be used
* @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
*/ */
attribute_deprecated
struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff); struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
/** /**
@ -4087,6 +4093,7 @@ struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter
* @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
* @return the number of samples written in dst or -1 if an error occurred * @return the number of samples written in dst or -1 if an error occurred
*/ */
attribute_deprecated
int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx); int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
@ -4102,12 +4109,15 @@ int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consum
* note, due to rounding the actual compensation might be slightly different, * note, due to rounding the actual compensation might be slightly different,
* especially if the compensation_distance is large and the in_rate used during init is small * especially if the compensation_distance is large and the in_rate used during init is small
*/ */
attribute_deprecated
void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance); void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
attribute_deprecated
void av_resample_close(struct AVResampleContext *c); void av_resample_close(struct AVResampleContext *c);
/** /**
* @} * @}
*/ */
#endif
/** /**
* @addtogroup lavc_picture * @addtogroup lavc_picture

@ -32,6 +32,8 @@
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/samplefmt.h" #include "libavutil/samplefmt.h"
#if FF_API_AVCODEC_RESAMPLE
#define MAX_CHANNELS 8 #define MAX_CHANNELS 8
struct AVResampleContext; struct AVResampleContext;
@ -373,3 +375,5 @@ void audio_resample_close(ReSampleContext *s)
av_audio_convert_free(s->convert_ctx[1]); av_audio_convert_free(s->convert_ctx[1]);
av_free(s); av_free(s);
} }
#endif

@ -29,6 +29,8 @@
#include "dsputil.h" #include "dsputil.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#if FF_API_AVCODEC_RESAMPLE
#ifndef CONFIG_RESAMPLE_HP #ifndef CONFIG_RESAMPLE_HP
#define FILTER_SHIFT 15 #define FILTER_SHIFT 15
@ -319,3 +321,5 @@ av_log(NULL, AV_LOG_DEBUG, "%d %d %d\n", c->dst_incr, c->ideal_dst_incr, c->comp
return dst_index; return dst_index;
} }
#endif

@ -82,5 +82,8 @@
#ifndef FF_API_VDA_ASYNC #ifndef FF_API_VDA_ASYNC
#define FF_API_VDA_ASYNC (LIBAVCODEC_VERSION_MAJOR < 55) #define FF_API_VDA_ASYNC (LIBAVCODEC_VERSION_MAJOR < 55)
#endif #endif
#ifndef FF_API_AVCODEC_RESAMPLE
#define FF_API_AVCODEC_RESAMPLE (LIBAVCODEC_VERSION_MAJOR < 55)
#endif
#endif /* AVCODEC_VERSION_H */ #endif /* AVCODEC_VERSION_H */

Loading…
Cancel
Save