From patchwork Mon Jan 16 13:38:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 40046 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1d43:b0:b8:6755:f97e with SMTP id cs3csp1038474pzb; Mon, 16 Jan 2023 05:41:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXuXoJ9W0GXjNfTvHlZc9pl1oZVM5at+W3a5fBFPXbNktJvh5+0MNYcE5Eg4uhSPhVDrRT3b X-Received: by 2002:a17:907:c498:b0:7ff:7876:9c60 with SMTP id tp24-20020a170907c49800b007ff78769c60mr1437649ejc.15.1673876513742; Mon, 16 Jan 2023 05:41:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673876513; cv=none; d=google.com; s=arc-20160816; b=cWa+d/d+s2iBnnm6F1bpFaHVMVgsFLkMhFg1xzBfjb7DaYKaBvtB5IW4ocejgOKJFv s1vIfO1Ob6B9+vSOwu/HIdhKeReRj/JAiLABg9ZpFNBEEZjEc6bWSdsQE5akh3raoByn ySrSJN9JEdhQn0GJQEZGzMmgjZ5s5L8xcbJ8JCmk47TYVGDqUIGlvF5drbWSRhGDOdFf FDVfzqazZ59VvLiniNUmwdyoM8ui6GLnR6CuvLHCo15uYXgP5UoQq1v3lK/Zjt6CM5cg CqJsbJGCJ4+GxLh434W08Zs5lNIDrWQ4dnH4Lk7hCCPZGZRd9QWc9jvqG9BJJ/V6rN3m q+Cw== 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:dkim-signature:delivered-to; bh=G/U/5s9P7/qo0egw+rO+wlpYIbPMHxNAP0y6eQGdrgw=; b=V4eavOagB6x5iN/gzuMm6SpHOnlJpf7Y4Hg13fds1/ZkGlzgbXT1R46Pm2k1Hzqkib ba2SiBxMqk54nF1z+hxhIURYJOBtN3SLUNwX5gJgSUwGR7zlwCaEqxuT05mOTUeWj7Lh 5GCK6FYb8fXd94IC+albd0wEU627Jf64z+5ROXd/qHpiHGzym4SnXX65TOCwt9Yw65CM Xc9EHsf1V3x34au+npHNFp2mNkjg7jz8S6PFeApip4LKPhogmOk2/SmaX7gFmBHpa1s4 GobZc68BFQRHPZnd0e+xnctcZhVzQgj3esU4DYZfDCe1dfSHghqiP0V+EyYnCyBREjyY P6Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=aH3F3A4U; 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=QUARANTINE 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 hj1-20020a1709069fc100b0084cd9dba340si29703045ejc.962.2023.01.16.05.41.53; Mon, 16 Jan 2023 05:41:53 -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=20210112 header.b=aH3F3A4U; 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=QUARANTINE 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 14F4F68BE1C; Mon, 16 Jan 2023 15:39:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9C96568BDFC for ; Mon, 16 Jan 2023 15:39:29 +0200 (EET) Received: by mail-ot1-f52.google.com with SMTP id j16-20020a056830271000b0067202045ee9so16104673otu.7 for ; Mon, 16 Jan 2023 05:39:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=2MGXnlug6pqlZfyLSRA9b4Qb4Q7JnyE3313X0ZwbJmU=; b=aH3F3A4UeDl6UZ6qlQPoDO0cUDzkotlKio0jM+VH+FXjgPg+imGuwGH+c795uvffkx 89eOGO7gOdT+BBdtS7rKaf2aU85GUY1h+46jIIJWU30QkdDnLPKe7cfKrylVlFwW6Hy9 B4/kDqMYHbAbzwoC8VxA7Tsy/noRo08RiR1HgagwxUvaA8Nq/CzOYLNCPAzwsGq8M7oV Y/TFOTfsJQ8FIBW1Fn97ziICBF1iVqaTrz4yKPnx26eFH1pFbEJxrNghEYPKXodk3IoF gAaV6TuxrqzwhU8EihxVOuwz9rOsUnyRBC0WmtQKlwed/JWbnqd09t+bJyBL8FA1lBy+ WoNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2MGXnlug6pqlZfyLSRA9b4Qb4Q7JnyE3313X0ZwbJmU=; b=Ux0wDIeytmVmeMpWsGRT8/m31V4Li6ug7Lr9nkR0swdPJ/pQzL8zwEFRojgaheaapz lCMLMp+PvLFhrtAJe6BcQaknqs6IoVuG+RY1JRdbojzvdQpAexbGqyWa7KM3YEDTUYE7 Vd2USBymq/wq0wzqGjAi20fH8c5G0oiqYG/P0/S29stW2gBNR0+B2QQz3bgixz9wbtAu Ek8iRJOOWYqP2fgJO6Ig3yJTtVkoKRUS3rHAz7Qpm5CZW0F42Gk9Zb9QXE3VxutPYbwZ 4Fq1+t9PMfleo2PRZ9SUG2DwYfnqwp8E9GoiNxMkX9ooVH/9ADg/Am3wnoAZVfG7ZCAu D6Bg== X-Gm-Message-State: AFqh2kpus4Ifwf8YNrUc/j07q0bkWd5pGT6g9Hn4xf60bzBOMEe7kqKL 8ERLSt69Ul0kNOx0PBiurltagTnuYuM= X-Received: by 2002:a05:6830:1e0a:b0:670:9f81:245a with SMTP id s10-20020a0568301e0a00b006709f81245amr43290157otr.12.1673876368841; Mon, 16 Jan 2023 05:39:28 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id 3-20020a9d0303000000b0066ca9001e68sm388524otv.5.2023.01.16.05.39.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 05:39:28 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 16 Jan 2023 10:38:32 -0300 Message-Id: <20230116133840.512-19-jamrial@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116133840.512-1-jamrial@gmail.com> References: <20230116133840.512-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 18/26] 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: halGaI61cSfD 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 58996404b3..f3c87a6777 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -20,12 +20,6 @@ #include "avdevice.h" #include "internal.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) { @@ -42,19 +36,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 185593053f..887fd5e3c8 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 d255ff6992..571257f31d 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 */