From patchwork Sat Feb 4 10:41:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 40271 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp1870453pzk; Sat, 4 Feb 2023 02:47:49 -0800 (PST) X-Google-Smtp-Source: AK7set8a7wY4Q2+IHWvfYwLIkOH5B7BvAG2gIYBBWkOvTDDR22VKGWMLLbWrpXRBFMeibdLke7p4 X-Received: by 2002:a50:d6d3:0:b0:4aa:a2b3:5a4f with SMTP id l19-20020a50d6d3000000b004aaa2b35a4fmr1326716edj.36.1675507668813; Sat, 04 Feb 2023 02:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675507668; cv=none; d=google.com; s=arc-20160816; b=jdoBdoQrmBodG78pENbQHMK2+KK2IkIAXeD5kAR130DPCXLQ4QgkncepnQpdbzkmoX iJEZqaWM9Wphaz1eFfeOSQ/2qQvE2Ol6QLA7PrF/ZhykMWa254QsNeVm+w51AswkLmev Xc9qMOcHFZwEqjvid0l+dP6aQMdYhZF2XEKVPcIQnqZrDAG5xFuSG9puLTJN0YwbHJff F3z11VuyHBKzeAHjR9fZ5sAfG035jHbsyjSlqbt+KiRaNPUnFKCayppdIHC77fCcnVna cqyvMCyPHNSEIdrDUeYvcUx8PMFmVlysrUMZ64d72+bqeTRhOizlJi7TMgJNe1J2Clg1 GpVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=7R1zPtngb1A9eyak+I7Kw6m4hIAyUiEmOSvEyM5JHcg=; b=DjHbim6aGw+XlWSkYgWaz7cTKoH5B9VR4VPzkWGOG1F1s1ichEYFvigVp6KMgevsMU WNqp+0cjPMHk/wFOO0usZVfMh8RFMk1jnBJaApFQ5WjFnb3ugLyPtfwZ/B6sgd2zbwGQ RBKnHhyPFQKb9eusdw0+2p/wWABMyVPM9XRThwUFwPX+uQ6mpJ/36+w6e2GTPY/+wnY9 bt3qr+TYS7cyvhfwCb7JKAyH+TX5yPsZGhtEUMwzt9KeIeiVQsWsxRq4lzpYl4SkfopK BgEPtOqDdYlubNo5U6xMu7+Hy7PU/vOC7YKKbO9r7+oA6LrBsaN7x82lEi+oaogSVSyg aGBw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l15-20020a056402254f00b0047f3dfa596asi6783839edb.162.2023.02.04.02.47.48; Sat, 04 Feb 2023 02:47:48 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4966468BEEF; Sat, 4 Feb 2023 12:44:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2097868BED7 for ; Sat, 4 Feb 2023 12:44:19 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id CB4002404F8 for ; Sat, 4 Feb 2023 11:44:18 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id LNg-ZIm_wBdp for ; Sat, 4 Feb 2023 11:44:18 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (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 "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 37FD8240D21 for ; Sat, 4 Feb 2023 11:44:07 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 331AF3A05EF for ; Sat, 4 Feb 2023 11:44:06 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Feb 2023 11:41:55 +0100 Message-Id: <20230204104204.20721-25-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230204104204.20721-1-anton@khirnov.net> References: <20230204104204.20721-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 24/33] avdevice: remove FF_API_DEVICE_CAPABILITIES X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: iEH3JSSzKGZL From: James Almer Signed-off-by: James Almer --- libavdevice/avdevice.c | 19 ------ libavdevice/avdevice.h | 130 ------------------------------------ libavdevice/version_major.h | 1 - 3 files changed, 150 deletions(-) diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c index b47f89c4bf2..38110ddfdb2 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -21,12 +21,6 @@ #include "internal.h" #include "libavformat/mux.h" -#if FF_API_DEVICE_CAPABILITIES -const AVOption av_device_capabilities[] = { - { NULL } -}; -#endif - int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type, void *data, size_t data_size) { @@ -43,19 +37,6 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToA return s->control_message_cb(s, type, data, data_size); } -#if FF_API_DEVICE_CAPABILITIES -int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s, - AVDictionary **device_options) -{ - return AVERROR(ENOSYS); -} - -void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s) -{ - return; -} -#endif - int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list) { int ret; diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h index 185593053f7..887fd5e3c80 100644 --- a/libavdevice/avdevice.h +++ b/libavdevice/avdevice.h @@ -327,136 +327,6 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type, void *data, size_t data_size); -#if FF_API_DEVICE_CAPABILITIES -/** - * Following API allows user to probe device capabilities (supported codecs, - * pixel formats, sample formats, resolutions, channel counts, etc). - * It is build on top op AVOption API. - * Queried capabilities make it possible to set up converters of video or audio - * parameters that fit to the device. - * - * List of capabilities that can be queried: - * - Capabilities valid for both audio and video devices: - * - codec: supported audio/video codecs. - * type: AV_OPT_TYPE_INT (AVCodecID value) - * - Capabilities valid for audio devices: - * - sample_format: supported sample formats. - * type: AV_OPT_TYPE_INT (AVSampleFormat value) - * - sample_rate: supported sample rates. - * type: AV_OPT_TYPE_INT - * - channels: supported number of channels. - * type: AV_OPT_TYPE_INT - * - channel_layout: supported channel layouts. - * type: AV_OPT_TYPE_INT64 - * - Capabilities valid for video devices: - * - pixel_format: supported pixel formats. - * type: AV_OPT_TYPE_INT (AVPixelFormat value) - * - window_size: supported window sizes (describes size of the window size presented to the user). - * type: AV_OPT_TYPE_IMAGE_SIZE - * - frame_size: supported frame sizes (describes size of provided video frames). - * type: AV_OPT_TYPE_IMAGE_SIZE - * - fps: supported fps values - * type: AV_OPT_TYPE_RATIONAL - * - * Value of the capability may be set by user using av_opt_set() function - * and AVDeviceCapabilitiesQuery object. Following queries will - * limit results to the values matching already set capabilities. - * For example, setting a codec may impact number of formats or fps values - * returned during next query. Setting invalid value may limit results to zero. - * - * Example of the usage basing on opengl output device: - * - * @code - * AVFormatContext *oc = NULL; - * AVDeviceCapabilitiesQuery *caps = NULL; - * AVOptionRanges *ranges; - * int ret; - * - * if ((ret = avformat_alloc_output_context2(&oc, NULL, "opengl", NULL)) < 0) - * goto fail; - * if (avdevice_capabilities_create(&caps, oc, NULL) < 0) - * goto fail; - * - * //query codecs - * if (av_opt_query_ranges(&ranges, caps, "codec", AV_OPT_MULTI_COMPONENT_RANGE)) < 0) - * goto fail; - * //pick codec here and set it - * av_opt_set(caps, "codec", AV_CODEC_ID_RAWVIDEO, 0); - * - * //query format - * if (av_opt_query_ranges(&ranges, caps, "pixel_format", AV_OPT_MULTI_COMPONENT_RANGE)) < 0) - * goto fail; - * //pick format here and set it - * av_opt_set(caps, "pixel_format", AV_PIX_FMT_YUV420P, 0); - * - * //query and set more capabilities - * - * fail: - * //clean up code - * avdevice_capabilities_free(&query, oc); - * avformat_free_context(oc); - * @endcode - */ - -/** - * Structure describes device capabilities. - * - * It is used by devices in conjunction with av_device_capabilities AVOption table - * to implement capabilities probing API based on AVOption API. Should not be used directly. - */ -typedef struct AVDeviceCapabilitiesQuery { - const AVClass *av_class; - AVFormatContext *device_context; - enum AVCodecID codec; - enum AVSampleFormat sample_format; - enum AVPixelFormat pixel_format; - int sample_rate; - int channels; - int64_t channel_layout; - int window_width; - int window_height; - int frame_width; - int frame_height; - AVRational fps; -} AVDeviceCapabilitiesQuery; - -/** - * AVOption table used by devices to implement device capabilities API. Should not be used by a user. - */ -attribute_deprecated -extern const AVOption av_device_capabilities[]; - -/** - * Initialize capabilities probing API based on AVOption API. - * - * avdevice_capabilities_free() must be called when query capabilities API is - * not used anymore. - * - * @param[out] caps Device capabilities data. Pointer to a NULL pointer must be passed. - * @param s Context of the device. - * @param device_options An AVDictionary filled with device-private options. - * On return this parameter will be destroyed and replaced with a dict - * containing options that were not found. May be NULL. - * The same options must be passed later to avformat_write_header() for output - * devices or avformat_open_input() for input devices, or at any other place - * that affects device-private options. - * - * @return >= 0 on success, negative otherwise. - */ -attribute_deprecated -int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s, - AVDictionary **device_options); - -/** - * Free resources created by avdevice_capabilities_create() - * - * @param caps Device capabilities data to be freed. - * @param s Context of the device. - */ -attribute_deprecated -void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s); -#endif - /** * Structure describes basic parameters of the device. */ diff --git a/libavdevice/version_major.h b/libavdevice/version_major.h index d255ff6992d..571257f31d7 100644 --- a/libavdevice/version_major.h +++ b/libavdevice/version_major.h @@ -32,6 +32,5 @@ * dropped at a future version bump. The defines themselves are not part of * the public API and may change, break or disappear at any time. */ -#define FF_API_DEVICE_CAPABILITIES (LIBAVDEVICE_VERSION_MAJOR < 60) #endif /* AVDEVICE_VERSION_MAJOR_H */