From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4D07542776 for ; Wed, 30 Mar 2022 12:20:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C80DD68B26E; Wed, 30 Mar 2022 15:19:41 +0300 (EEST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 915BE68B1E2 for ; Wed, 30 Mar 2022 15:19:40 +0300 (EEST) Received: by mail-lf1-f49.google.com with SMTP id z12so21684249lfu.10 for ; Wed, 30 Mar 2022 05:19:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jTvhHiTlFb1Byx9ON+ugLk11hvpWzvJE2DX/dpeDuqY=; b=YxSV/QrvlT3t2Z+0wg+hcvBeoYJqve0k6SjWHbMfrks8QWIeoGNdTGOLQ5vrMIUZKC /O3daDy3vfFF8VPxk7zJMcCYppeAx3jonzMNClXbFk0we1JyncaQjHJf+gon2PEj2tv9 e3qeSw7KSZOOg3icmQdlcyKqu3hNzlMia8mr0HINC9mWhocoAMjq7EnVXs79/6bxM+Rq wiLtALUMuYWbIah5xdNOpdBWLNCVJaYT9Xpli1Bx4d9rI0yzpyDJ/8NAX0rATuv8MLA6 LKVLHWulA5nr6WtCcrQzaGWYjJuttN62ndkRFqiB/YwHk7IoSkq7TKxBYvvjgRDByTq1 HrJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jTvhHiTlFb1Byx9ON+ugLk11hvpWzvJE2DX/dpeDuqY=; b=CKzGxOVvDIAbz5rBqUFWkqNow/n5XPFHIPc8OOHUgB4b4k3QA2BCSkN0e6YMKDh1tu k0uQYtY2eLlsY3EqhW24JROQXaQhuyU7dCmucZ6Wxu1dpbIstcok/DiGK+1ny/L8EudR KURo6iH/YZ02ywLp0NGV3ZurhGgcvPx8CDNHuKez0YM/5f5aoXvDBCuv3pA5BE9n/a3g LmIg1PKA4ZmR1znD1poYJREd5LnNUgHj5aYk0fn67mcW0Qir0Tbo5oQuyOCF0HRrtRKZ 6OaIeFnuRXWgFLu+6CcEekBax99HGviTR3cBfbShr3uZW4+qZ04TS8NrClphEVVWQiO7 X3uQ== X-Gm-Message-State: AOAM533sWh0FEU/MgTeGD1xXuWpAw4LzRCWWqgIpeiCAlHBQY71dW8Yu /ggjyHOGc+AZ/2dBx4BkjumOZMJM6UQ= X-Google-Smtp-Source: ABdhPJxo5Lm3amt2tBqZM3D/ydwLkLD1rT26FWBuaCAL7+TFkF8hPn3qowawlh/XddQldOCRbhqHbA== X-Received: by 2002:a05:6512:324b:b0:44a:8704:e8dd with SMTP id c11-20020a056512324b00b0044a8704e8ddmr6419632lfr.301.1648642779374; Wed, 30 Mar 2022 05:19:39 -0700 (PDT) Received: from localhost.localdomain (deedock.humlab.lu.se. [130.235.135.183]) by smtp.gmail.com with ESMTPSA id j6-20020a05651231c600b0044a618a23c0sm2202021lfe.267.2022.03.30.05.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 05:19:38 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Wed, 30 Mar 2022 14:17:57 +0200 Message-Id: <20220330121806.822-13-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220330121806.822-1-dcnieho@gmail.com> References: <20220330121806.822-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 12/21] avdevice: change device capabilities option type 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 Cc: Diederick Niehorster Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Changes fps option from AVRational to double. This since any device capability query results are returned in AVOptionRanges, which hold the value as doubles, which can't contain AVRationals. Also updated documentation of other capabilities, some had the wrong option type listed. micro version bump as this capabilities API is unused for now. Signed-off-by: Diederick Niehorster --- libavdevice/avdevice.c | 4 ++-- libavdevice/avdevice.h | 6 +++--- libavdevice/internal.h | 4 +++- libavdevice/version.h | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c index 1cc9cd3923..863f8df477 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -51,8 +51,8 @@ const AVOption ff_device_capabilities[] = { {.str = NULL}, -1, INT_MAX, E|D|V }, { "frame_size", "frame size", OFFSET(frame_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, -1, INT_MAX, E|D|V }, - { "fps", "fps", OFFSET(fps), AV_OPT_TYPE_RATIONAL, - {.dbl = -1}, -1, INT_MAX, E|D|V }, + { "fps", "fps", OFFSET(fps), AV_OPT_TYPE_DOUBLE, + {.dbl = NAN}, 0, INT_MAX, E|D|V }, { NULL } }; diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h index 6d45c74616..a815d65f12 100644 --- a/libavdevice/avdevice.h +++ b/libavdevice/avdevice.h @@ -360,7 +360,7 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, * type: AV_OPT_TYPE_INT (AVCodecID value) * - Capabilities valid for audio devices: * - sample_format: supported sample formats. - * type: AV_OPT_TYPE_INT (AVSampleFormat value) + * type: AV_OPT_TYPE_SAMPLE_FMT * - sample_rate: supported sample rates. * type: AV_OPT_TYPE_INT * - channels: supported number of channels. @@ -369,13 +369,13 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, * type: AV_OPT_TYPE_INT64 * - Capabilities valid for video devices: * - pixel_format: supported pixel formats. - * type: AV_OPT_TYPE_INT (AVPixelFormat value) + * type: AV_OPT_TYPE_PIXEL_FMT * - 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 + * type: AV_OPT_TYPE_DOUBLE * * Value of the capability may be set by user using av_opt_set() function * and AVDeviceCapabilitiesQuery object. Following queries will diff --git a/libavdevice/internal.h b/libavdevice/internal.h index eee493a4c7..5f0bd403dd 100644 --- a/libavdevice/internal.h +++ b/libavdevice/internal.h @@ -50,7 +50,9 @@ struct AVDeviceCapabilitiesQuery { int window_height; int frame_width; int frame_height; - AVRational fps; + // NB: an AVRational cannot be represented in the AVOptionRange + // output of av_opt_query_ranges, so we store fps as double instead + double fps; }; /** diff --git a/libavdevice/version.h b/libavdevice/version.h index 09156778db..181987d287 100644 --- a/libavdevice/version.h +++ b/libavdevice/version.h @@ -31,7 +31,7 @@ #include "version_major.h" #define LIBAVDEVICE_VERSION_MINOR 1 -#define LIBAVDEVICE_VERSION_MICRO 100 +#define LIBAVDEVICE_VERSION_MICRO 101 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ LIBAVDEVICE_VERSION_MINOR, \ -- 2.28.0.windows.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".