summaryrefslogtreecommitdiff
path: root/libavresample
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-12-25 02:05:52 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2018-01-04 01:38:22 +0000
commitc29038f3041a4080342b2e333c1967d136749c0f (patch)
tree77ce562e6c08087985b9ea3bc9d3d77636278cc5 /libavresample
parent88cbd25b193dddb852bc1921b733c5dde5fee2fe (diff)
downloadffmpeg-c29038f3041a4080342b2e333c1967d136749c0f.tar.gz
lavr: deprecate the entire library
Deprecate the entire library. Merged years ago to provide compatibility with Libav, it remained unmaintained by the FFmpeg project and duplicated functionality provided by libswresample. In order to improve consistency and reduce attack surface, as well as to ease burden on maintainers, it has been deprecated. Users of this library are asked to migrate to libswresample, which, as well as providing more functionality, is faster and has higher accuracy. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavresample')
-rw-r--r--libavresample/avresample.h106
1 files changed, 99 insertions, 7 deletions
diff --git a/libavresample/avresample.h b/libavresample/avresample.h
index 193443e2a6..440e1a16e7 100644
--- a/libavresample/avresample.h
+++ b/libavresample/avresample.h
@@ -103,24 +103,33 @@
#define AVRESAMPLE_MAX_CHANNELS 32
-typedef struct AVAudioResampleContext AVAudioResampleContext;
+typedef attribute_deprecated struct AVAudioResampleContext AVAudioResampleContext;
-/** Mixing Coefficient Types */
-enum AVMixCoeffType {
+/**
+ * @deprecated use libswresample
+ *
+ * Mixing Coefficient Types */
+enum attribute_deprecated AVMixCoeffType {
AV_MIX_COEFF_TYPE_Q8, /** 16-bit 8.8 fixed-point */
AV_MIX_COEFF_TYPE_Q15, /** 32-bit 17.15 fixed-point */
AV_MIX_COEFF_TYPE_FLT, /** floating-point */
AV_MIX_COEFF_TYPE_NB, /** Number of coeff types. Not part of ABI */
};
-/** Resampling Filter Types */
-enum AVResampleFilterType {
+/**
+ * @deprecated use libswresample
+ *
+ * Resampling Filter Types */
+enum attribute_deprecated AVResampleFilterType {
AV_RESAMPLE_FILTER_TYPE_CUBIC, /**< Cubic */
AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL, /**< Blackman Nuttall Windowed Sinc */
AV_RESAMPLE_FILTER_TYPE_KAISER, /**< Kaiser Windowed Sinc */
};
-enum AVResampleDitherMethod {
+/**
+ * @deprecated use libswresample
+ */
+enum attribute_deprecated AVResampleDitherMethod {
AV_RESAMPLE_DITHER_NONE, /**< Do not use dithering */
AV_RESAMPLE_DITHER_RECTANGULAR, /**< Rectangular Dither */
AV_RESAMPLE_DITHER_TRIANGULAR, /**< Triangular Dither*/
@@ -130,22 +139,37 @@ enum AVResampleDitherMethod {
};
/**
+ *
+ * @deprecated use libswresample
+ *
* Return the LIBAVRESAMPLE_VERSION_INT constant.
*/
+attribute_deprecated
unsigned avresample_version(void);
/**
+ *
+ * @deprecated use libswresample
+ *
* Return the libavresample build-time configuration.
* @return configure string
*/
+attribute_deprecated
const char *avresample_configuration(void);
/**
+ *
+ * @deprecated use libswresample
+ *
* Return the libavresample license.
*/
+attribute_deprecated
const char *avresample_license(void);
/**
+ *
+ * @deprecated use libswresample
+ *
* Get the AVClass for AVAudioResampleContext.
*
* Can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options
@@ -155,16 +179,24 @@ const char *avresample_license(void);
*
* @return AVClass for AVAudioResampleContext
*/
+attribute_deprecated
const AVClass *avresample_get_class(void);
/**
+ *
+ * @deprecated use libswresample
+ *
* Allocate AVAudioResampleContext and set options.
*
* @return allocated audio resample context, or NULL on failure
*/
+attribute_deprecated
AVAudioResampleContext *avresample_alloc_context(void);
/**
+ *
+ * @deprecated use libswresample
+ *
* Initialize AVAudioResampleContext.
* @note The context must be configured using the AVOption API.
* @note The fields "in_channel_layout", "out_channel_layout",
@@ -178,17 +210,25 @@ AVAudioResampleContext *avresample_alloc_context(void);
* @param avr audio resample context
* @return 0 on success, negative AVERROR code on failure
*/
+attribute_deprecated
int avresample_open(AVAudioResampleContext *avr);
/**
+ *
+ * @deprecated use libswresample
+ *
* Check whether an AVAudioResampleContext is open or closed.
*
* @param avr AVAudioResampleContext to check
* @return 1 if avr is open, 0 if avr is closed.
*/
+attribute_deprecated
int avresample_is_open(AVAudioResampleContext *avr);
/**
+ *
+ * @deprecated use libswresample
+ *
* Close AVAudioResampleContext.
*
* This closes the context, but it does not change the parameters. The context
@@ -201,18 +241,26 @@ int avresample_is_open(AVAudioResampleContext *avr);
*
* @param avr audio resample context
*/
+attribute_deprecated
void avresample_close(AVAudioResampleContext *avr);
/**
+ *
+ * @deprecated use libswresample
+ *
* Free AVAudioResampleContext and associated AVOption values.
*
* This also calls avresample_close() before freeing.
*
* @param avr audio resample context
*/
+attribute_deprecated
void avresample_free(AVAudioResampleContext **avr);
/**
+ *
+ * @deprecated use libswresample
+ *
* Generate a channel mixing matrix.
*
* This function is the one used internally by libavresample for building the
@@ -234,12 +282,16 @@ void avresample_free(AVAudioResampleContext **avr);
* @param matrix_encoding matrixed stereo downmix mode (e.g. dplii)
* @return 0 on success, negative AVERROR code on failure
*/
+attribute_deprecated
int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
double center_mix_level, double surround_mix_level,
double lfe_mix_level, int normalize, double *matrix,
int stride, enum AVMatrixEncoding matrix_encoding);
/**
+ *
+ * @deprecated use libswresample
+ *
* Get the current channel mixing matrix.
*
* If no custom matrix has been previously set or the AVAudioResampleContext is
@@ -251,10 +303,14 @@ int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
* @param stride distance between adjacent input channels in the matrix array
* @return 0 on success, negative AVERROR code on failure
*/
+attribute_deprecated
int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
int stride);
/**
+ *
+ * @deprecated use libswresample
+ *
* Set channel mixing matrix.
*
* Allows for setting a custom mixing matrix, overriding the default matrix
@@ -272,10 +328,14 @@ int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
* @param stride distance between adjacent input channels in the matrix array
* @return 0 on success, negative AVERROR code on failure
*/
+attribute_deprecated
int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
int stride);
/**
+ *
+ * @deprecated use libswresample
+ *
* Set a customized input channel mapping.
*
* This function can only be called when the allocated context is not open.
@@ -302,10 +362,14 @@ int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
* @param channel_map customized input channel mapping
* @return 0 on success, negative AVERROR code on failure
*/
+attribute_deprecated
int avresample_set_channel_mapping(AVAudioResampleContext *avr,
const int *channel_map);
/**
+ *
+ * @deprecated use libswresample
+ *
* Set compensation for resampling.
*
* This can be called anytime after avresample_open(). If resampling is not
@@ -318,10 +382,14 @@ int avresample_set_channel_mapping(AVAudioResampleContext *avr,
* @param compensation_distance compensation distance, in samples
* @return 0 on success, negative AVERROR code on failure
*/
+attribute_deprecated
int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
int compensation_distance);
/**
+ *
+ * @deprecated use libswresample
+ *
* Provide the upper bound on the number of samples the configured
* conversion would output.
*
@@ -331,10 +399,13 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
* @return number of samples or AVERROR(EINVAL) if the value
* would exceed INT_MAX
*/
-
+attribute_deprecated
int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples);
/**
+ *
+ * @deprecated use libswresample
+ *
* Convert input samples and write them to the output FIFO.
*
* The upper bound on the number of output samples can be obtained through
@@ -376,12 +447,16 @@ int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples);
* not including converted samples added to the internal
* output FIFO
*/
+attribute_deprecated
int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
int out_plane_size, int out_samples,
uint8_t * const *input, int in_plane_size,
int in_samples);
/**
+ *
+ * @deprecated use libswresample
+ *
* Return the number of samples currently in the resampling delay buffer.
*
* When resampling, there may be a delay between the input and output. Any
@@ -394,9 +469,13 @@ int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
* @param avr audio resample context
* @return number of samples currently in the resampling delay buffer
*/
+attribute_deprecated
int avresample_get_delay(AVAudioResampleContext *avr);
/**
+ *
+ * @deprecated use libswresample
+ *
* Return the number of available samples in the output FIFO.
*
* During conversion, if the user does not specify an output buffer or
@@ -411,9 +490,13 @@ int avresample_get_delay(AVAudioResampleContext *avr);
* @param avr audio resample context
* @return number of samples available for reading
*/
+attribute_deprecated
int avresample_available(AVAudioResampleContext *avr);
/**
+ *
+ * @deprecated use libswresample
+ *
* Read samples from the output FIFO.
*
* During conversion, if the user does not specify an output buffer or
@@ -430,9 +513,13 @@ int avresample_available(AVAudioResampleContext *avr);
* @param nb_samples number of samples to read from the FIFO
* @return the number of samples written to output
*/
+attribute_deprecated
int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples);
/**
+ *
+ * @deprecated use libswresample
+ *
* Convert the samples in the input AVFrame and write them to the output AVFrame.
*
* Input and output AVFrames must have channel_layout, sample_rate and format set.
@@ -476,10 +563,14 @@ int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_sample
* @return 0 on success, AVERROR on failure or nonmatching
* configuration.
*/
+attribute_deprecated
int avresample_convert_frame(AVAudioResampleContext *avr,
AVFrame *output, AVFrame *input);
/**
+ *
+ * @deprecated use libswresample
+ *
* Configure or reconfigure the AVAudioResampleContext using the information
* provided by the AVFrames.
*
@@ -494,6 +585,7 @@ int avresample_convert_frame(AVAudioResampleContext *avr,
* @param in input AVFrame
* @return 0 on success, AVERROR on failure.
*/
+attribute_deprecated
int avresample_config(AVAudioResampleContext *avr, AVFrame *out, AVFrame *in);
/**