From patchwork Thu May 28 20:15:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 19953 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 43CD244A30B for ; Thu, 28 May 2020 23:16:44 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3004668B075; Thu, 28 May 2020 23:16:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.red.khirnov.net (unknown [176.97.15.10]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 827F868AF22 for ; Thu, 28 May 2020 23:16:29 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id E615F28A6C6 for ; Thu, 28 May 2020 22:16:27 +0200 (CEST) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id I9I3zM7gbYTN for ; Thu, 28 May 2020 22:16:24 +0200 (CEST) Received: from quelana.khirnov.net (quelana.khirnov.net [IPv6:2a00:c500:561:200::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "quelana.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail.red.khirnov.net (Postfix) with ESMTPS id 931E828A6E4 for ; Thu, 28 May 2020 22:16:21 +0200 (CEST) Received: from localhost (quelana.khirnov.net [IPv6:::1]) by quelana.khirnov.net (Postfix) with ESMTP id 2B19922F35 for ; Thu, 28 May 2020 22:16:17 +0200 (CEST) Received: from quelana.khirnov.net ([IPv6:::1]) by localhost (quelana.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id BgIjfqpZAuDv for ; Thu, 28 May 2020 22:16:15 +0200 (CEST) Received: from libav.daenerys.khirnov.net (libav.daenerys.khirnov.net [IPv6:2a00:c500:561:201::7]) by quelana.khirnov.net (Postfix) with ESMTP id 7E38222DCD for ; Thu, 28 May 2020 22:16:15 +0200 (CEST) Received: by libav.daenerys.khirnov.net (Postfix, from userid 1000) id 8A8D920E00E8; Thu, 28 May 2020 22:16:11 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 May 2020 22:15:44 +0200 Message-Id: <20200528201559.22618-2-anton@khirnov.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200528201559.22618-1-anton@khirnov.net> References: <20200528201559.22618-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/17] avdevice: deprecate av_*_device_next() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" These functions rely on deprecated libavformat APIs and apparently have zero users outside of cmdutils. Since the functionality they provide is apparently not useful to anyone, deprecate them without replacement. --- doc/APIchanges | 4 ++++ fftools/cmdutils.c | 2 +- fftools/cmdutils.h | 4 ++-- libavdevice/avdevice.c | 4 ++++ libavdevice/avdevice.h | 6 ++++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index fb5534b5f5..f5b2a7b964 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,10 @@ libavutil: 2017-10-21 API changes, most recent first: +2020-xx-xx - avdevice.h + Deprecate av_input_video_device_next, av_output_video_device_next, + av_input_audio_device_next, av_output_audio_device_next + 2020-xx-xx - xxxxxxxxxx - lavc 58.88.100 - avcodec.h codec.h Move AVCodec-related public API to new header codec.h. diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index dec18850d8..a948d478d5 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -2216,7 +2216,7 @@ double get_rotation(AVStream *st) return theta; } -#if CONFIG_AVDEVICE +#if CONFIG_AVDEVICE && FF_API_NEXT static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts) { int ret, i; diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h index 1917510589..ae5208f1aa 100644 --- a/fftools/cmdutils.h +++ b/fftools/cmdutils.h @@ -201,7 +201,7 @@ typedef struct OptionDef { void show_help_options(const OptionDef *options, const char *msg, int req_flags, int rej_flags, int alt_flags); -#if CONFIG_AVDEVICE +#if CONFIG_AVDEVICE && FF_API_NEXT #define CMDUTILS_COMMON_OPTIONS_AVDEVICE \ { "sources" , OPT_EXIT | HAS_ARG, { .func_arg = show_sources }, \ "list sources of the input device", "device" }, \ @@ -498,7 +498,7 @@ int show_demuxers(void *optctx, const char *opt, const char *arg); */ int show_devices(void *optctx, const char *opt, const char *arg); -#if CONFIG_AVDEVICE +#if CONFIG_AVDEVICE && FF_API_NEXT /** * Print a listing containing autodetected sinks of the output device. * Device name with options may be passed as an argument to limit results. diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c index 3d03d89f04..e45cc06153 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -78,6 +78,8 @@ const char * avdevice_license(void) return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } +#if FF_API_NEXT +FF_DISABLE_DEPRECATION_WARNINGS static void *device_next(void *prev, int output, AVClassCategory c1, AVClassCategory c2) { @@ -99,6 +101,7 @@ static void *device_next(void *prev, int output, } while (category != c1 && category != c2); return prev; } +FF_ENABLE_DEPRECATION_WARNINGS AVInputFormat *av_input_audio_device_next(AVInputFormat *d) { @@ -123,6 +126,7 @@ AVOutputFormat *av_output_video_device_next(AVOutputFormat *d) return device_next(d, 1, AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT, AV_CLASS_CATEGORY_DEVICE_OUTPUT); } +#endif int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type, void *data, size_t data_size) diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h index ee9462480e..c63f661fc7 100644 --- a/libavdevice/avdevice.h +++ b/libavdevice/avdevice.h @@ -70,6 +70,7 @@ const char *avdevice_license(void); */ void avdevice_register_all(void); +#if FF_API_NEXT /** * Audio input devices iterator. * @@ -77,6 +78,7 @@ void avdevice_register_all(void); * if d is non-NULL, returns the next registered input audio/video device after d * or NULL if d is the last one. */ +attribute_deprecated AVInputFormat *av_input_audio_device_next(AVInputFormat *d); /** @@ -86,6 +88,7 @@ AVInputFormat *av_input_audio_device_next(AVInputFormat *d); * if d is non-NULL, returns the next registered input audio/video device after d * or NULL if d is the last one. */ +attribute_deprecated AVInputFormat *av_input_video_device_next(AVInputFormat *d); /** @@ -95,6 +98,7 @@ AVInputFormat *av_input_video_device_next(AVInputFormat *d); * if d is non-NULL, returns the next registered output audio/video device after d * or NULL if d is the last one. */ +attribute_deprecated AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d); /** @@ -104,7 +108,9 @@ AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d); * if d is non-NULL, returns the next registered output audio/video device after d * or NULL if d is the last one. */ +attribute_deprecated AVOutputFormat *av_output_video_device_next(AVOutputFormat *d); +#endif typedef struct AVDeviceRect { int x; /**< x coordinate of top left corner */