From patchwork Sat Dec 30 14:59:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rostislav Pehlivanov X-Patchwork-Id: 7032 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp11707029jad; Sat, 30 Dec 2017 07:07:43 -0800 (PST) X-Google-Smtp-Source: ACJfBotEcria8Z9o2HdIrTEa32KTqofGORjNCPv3FeFNgFgdkSrc6C4DTh/EhzgqM58v14w5FXyF X-Received: by 10.223.153.15 with SMTP id x15mr3452992wrb.189.1514646463845; Sat, 30 Dec 2017 07:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514646463; cv=none; d=google.com; s=arc-20160816; b=cHoYFYUywdMGCYPyr/Dif28IRcImO/tnjA9lXYrD0EBWZiFqbHDVjwlsUOSoOiSXnI 0h932b/fw8dWnMPBlYGykzo0SnEnb1pU0IBOmj401lAbNVMpXVxr/MrTnnC5jYD18kZd eXBPPW7DZ6TqJH4hXVJZh0i+iBEbolB97AiPGsDo75HViWgylZ/B1FzPPpDiQOhkJQLf KUIQHn7naSM3ldSegBdfK2L1SVsHJKrsN8rxSxC07nK5cc7jASxYRfA58jTX5X4a/1Cd nJXJhX/zmIoa/4wIC3U8dZj235N7nZFB30ye222iCtz0WTixrfCZSuhyxDDhdJLhRrw7 ld+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=6cCbImNEya1EwEd8nvHpX9+sh2MqaJaUAcQExnS2NEY=; b=tKJ1UuGI454UTFhFrGV8Rv4gWvUeXsIYbhLns7Ph2RpXk7JSy5Sg/Itzt6tPpvR4O3 kza0Gm/xCgG3SBeuZAqhx8wZfp31sdrx3ioHYK8Dkg+fi+zKmyCNHy+hVYyydqEKogJF 4U5Z1LyYCxmEN6Nb3DRLBGxOmOyn0uTH9h8Gi0iJwomdTS2fcTvlZRTVxhY/W5j2FAxr kadMF6smHvqU9JcUBSbXgJFHJcuwqkP6LpJXxmxOY/oVMDBBs3ZV6u7Z9kUieYOCG8uk c/bu8VTNaauJCuj9my3D24/46eP0TgaG2+NZjnkhE4UbO8gFzxLYqoxMw/UZ0opJqZu/ pq5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=sZ/+keZa; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g28si18204907wmi.214.2017.12.30.07.07.42; Sat, 30 Dec 2017 07:07:43 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=sZ/+keZa; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 94AF4689C89; Sat, 30 Dec 2017 17:07:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 56E8C689B5C for ; Sat, 30 Dec 2017 17:07:20 +0200 (EET) Received: by mail-wm0-f67.google.com with SMTP id r78so52457007wme.5 for ; Sat, 30 Dec 2017 07:07:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o0u9kKMbDQ/LYBjxIN4A7tHs6g/5a7/IyLG0IovXPmA=; b=sZ/+keZaNJRfKs9eeD2IT3TGcqbwCqYacDTZ4MUJQ9nGIEL/xwwklOY/NovDE2lqMT a29nrE+65HU6/dtDTlCCc/xXJ86jIP9JkFg5rCPszom/5cxkKS7++pigb2K+yLodtDPZ LEkGTG/e/ROn+D+LV0sOl+T16OjnAVbVEuc+kMn2WNBIuQAYxfuW60kvvk06PPJCziOf 6W8ZKNpjAv0gHs1PaUqbiNbcywQEjo1hu6XOz7Iz4WHd1dKZe4LdzKGspYADg+j7T0p0 gYAcJfxnKtLowNd3lZGcZ+oYoawUNyi07/DS5kQ4a62PLIy4KtcHuMYsdE3ciWnByH35 Nqfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o0u9kKMbDQ/LYBjxIN4A7tHs6g/5a7/IyLG0IovXPmA=; b=UXXaItjJgLr0BHmcD+4h6zPd1eJmjP7V+2tnbKMpaEgabeRFrzJ+W1OWyG5GQpiTqW lBkS3NciiSv2p8uyr27mGXjhu3dbNw5+tgzxOLpEeDiJrggz0wvH3glK3yphAfX/XU3/ RdaK27WaQyMT4lJxLF34zECpwSxvo0kia/KBcEO9CQ5eNYpVvwGI5mybN5j4tPUdeBpz kOl0Bnsmlbpi4Wl1NpjhZ1xi2gMcbc7blnMOjJ238Y+zufSaWWRuiZy1VvMcBz92sMZV T6/fy8HxHqJiWqKFPM2wXi4mBzwbwh4zEt4X7ghPGIeo0MJPWu0p/MQ4e+NAo5jQDkk0 Osog== X-Gm-Message-State: AKGB3mKKDYwJRGabudOZtJ3JR/I8BuuqbTd9oxjO69ibmibcHWITEWTN VXN706+tQpg3XeJEVrASro3y18V+ X-Received: by 10.28.183.132 with SMTP id h126mr33167577wmf.76.1514645963004; Sat, 30 Dec 2017 06:59:23 -0800 (PST) Received: from skyhide.pars.ee ([2a00:23c4:7c83:f700:7cf4:8d37:4e1e:a6aa]) by smtp.gmail.com with ESMTPSA id r3sm19364275wmg.31.2017.12.30.06.59.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Dec 2017 06:59:21 -0800 (PST) From: Rostislav Pehlivanov To: ffmpeg-devel@ffmpeg.org Date: Sat, 30 Dec 2017 14:59:19 +0000 Message-Id: <20171230145919.5812-1-atomnuker@gmail.com> X-Mailer: git-send-email 2.15.1.620.gb9897f4670 In-Reply-To: <3a3f37d4-3173-0bd9-c9e1-6c8a5630184b@gmail.com> References: <3a3f37d4-3173-0bd9-c9e1-6c8a5630184b@gmail.com> Subject: [FFmpeg-devel] [PATCH v4] lavr: deprecate the entire library X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Rostislav Pehlivanov MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- I've kept the deprecations on the enums - they can't hurt. configure | 4 +- doc/APIchanges | 9 ++++ libavresample/avresample.h | 106 ++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 110 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 688f6ab803..f2fdb93668 100755 --- a/configure +++ b/configure @@ -133,7 +133,7 @@ Component options: --disable-swscale disable libswscale build --disable-postproc disable libpostproc build --disable-avfilter disable libavfilter build - --enable-avresample enable libavresample build [no] + --enable-avresample enable libavresample build (deprecated) [no] --disable-pthreads disable pthreads [autodetect] --disable-w32threads disable Win32 threads [autodetect] --disable-os2threads disable OS/2 threads [autodetect] @@ -6521,7 +6521,7 @@ check_deps $CONFIG_LIST \ $ALL_COMPONENTS \ enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86" - +enabled avresample && warn "Building with deprecated library libavresample" if test $target_os = "haiku"; then disable memalign diff --git a/doc/APIchanges b/doc/APIchanges index 3c9f237596..38c1be61c7 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,15 @@ libavutil: 2017-10-21 API changes, most recent first: +2017-xx-xx - xxxxxxx - lavr 4.0.0 - avresample.h + 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, 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. + 2017-xx-xx - xxxxxxx - lavc 58.9.100 - avcodec.h Deprecate av_lockmgr_register(). You need to build FFmpeg with threading support enabled to get basic thread-safety (which is the default build 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); /**