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 A625049A35 for ; Mon, 26 Feb 2024 17:18:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A8BAA68C7FF; Mon, 26 Feb 2024 19:18:51 +0200 (EET) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BB50F68BE7C for ; Mon, 26 Feb 2024 19:18:49 +0200 (EET) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-29ab7073dd2so853914a91.0 for ; Mon, 26 Feb 2024 09:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708967926; x=1709572726; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=4rXOtTOZ6vhBwI0r0pI7KTT/0BOv8LXcCB/HHMq21ng=; b=GqGenJ6mDq/msJ+VleEQp8YlieihmvkbFKmt72BDLDooc/NZj1ZcPXtiDORAS5AhvM n30MUTt0RrLINFxai+2t/HNci0vZs/xNZvrBNmhxC3zQN1xl+KUiucn8BW09b2StQPCA pM030UaOLonwMATAGLoTU6DjO73Lq2jtFrH42fiSoRDimfFSHx0TSP/qhmLG3cgie9KV 5eanWN9028I8AqqE1x8npxN0Ojk7VZBK2BYc2/r5Lk5sTqSWqBRkB2yU1mNyI0bcGc8D C9T8w77TyuEKLE+vDxRPs/LQbiiaaBhmohwnBek5PiJMU79/Ak/fR4P6YQMQNhOhoyMF DqxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708967927; x=1709572727; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4rXOtTOZ6vhBwI0r0pI7KTT/0BOv8LXcCB/HHMq21ng=; b=VxtQXuzPkqMhBagly7EvlEq24AC19y8U/WzkAtS55Qwu0YsfmmxHVvM8+TsOIh1bMK 9G/YiLvTvRE7kXapHDLISeLXl/yrGk4+eqtPiLHjee+aF5MqmEu2m7d254dAmxOlBXji PBa14YD+SMV2O3jLCzCmUfEIib7qitoJf5ApdNqbeO7twd2erF1EDftG74zt3DlFSSj6 bCrE/Q2AQMItlmMDR3piPI4U2R9PZt/vMUqqS5oIYSGcJ1XMw7GnxhX8E8Cj8YMKHkLn CYZJk9qLbV9otiAgsuZ/bdNKRoiKHWxEMPV1tX+Z5BE0+vzAaNxrFOwCE93EX1YS+rpX 3AQQ== X-Gm-Message-State: AOJu0YyWbP6Tvq7ddPRgM4PY4bnb5ckckDPYNwzRg2jNsrkL+YNmmhnZ ymr4GG/aT8/UbqBa/KTuY4z1lo2cYzrF3QbjZ7Xn1S0JSJp9NKCGaeMw39pZ X-Google-Smtp-Source: AGHT+IExZTAxWz2i/+xsCDOJJ3s+iLTbzPSG0qtU5Yh4lOJ3hHQB3hnTEh1DwMEWZ59M/yznWuRRhA== X-Received: by 2002:a17:90a:744a:b0:299:35a1:f716 with SMTP id o10-20020a17090a744a00b0029935a1f716mr4963271pjk.12.1708967926588; Mon, 26 Feb 2024 09:18:46 -0800 (PST) Received: from [192.168.0.11] ([190.194.169.124]) by smtp.gmail.com with ESMTPSA id r4-20020a17090a438400b0029a6e7f2480sm5294173pjg.12.2024.02.26.09.18.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Feb 2024 09:18:46 -0800 (PST) Message-ID: Date: Mon, 26 Feb 2024 14:19:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240223143115.16521-1-anton@khirnov.net> <20240223143115.16521-16-anton@khirnov.net> <170896764704.29002.11257003666537600643@lain.khirnov.net> Content-Language: en-US From: James Almer In-Reply-To: <170896764704.29002.11257003666537600643@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 15/38] lavu/opt: add array options 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 2/26/2024 2:14 PM, Anton Khirnov wrote: > Quoting Marton Balint (2024-02-23 20:05:06) >> >> >> On Fri, 23 Feb 2024, Anton Khirnov wrote: >> >>> AVOption.array_max_size is added before AVOption.unit to avoid >>> increasing sizeof(AVOption). >>> --- >>> doc/APIchanges | 3 + >>> libavutil/opt.c | 344 ++++++++++++++++++++++++++++++++++++------ >>> libavutil/opt.h | 26 ++++ >>> libavutil/tests/opt.c | 34 +++++ >>> tests/ref/fate/opt | 23 ++- >>> 5 files changed, 385 insertions(+), 45 deletions(-) >>> >> [...] >> >>> --- a/libavutil/opt.h >>> +++ b/libavutil/opt.h >>> @@ -288,6 +288,16 @@ enum AVOptionType{ >>> */ >>> #define AV_OPT_FLAG_CHILD_CONSTS (1 << 18) >>> >>> +/** >>> + * The option is an array. >>> + * >>> + * When adding array options to an object, @ref AVOption.offset should refer to >>> + * a pointer corresponding to the option type. The pointer should be immediately >>> + * followed by an unsigned int that will store the number of elements in the >>> + * array. >>> + */ >>> +#define AV_OPT_FLAG_ARRAY (1 << 19) >>> + >>> /** >>> * AVOption >>> */ >>> @@ -313,6 +323,16 @@ typedef struct AVOption { >>> union { >>> int64_t i64; >>> double dbl; >>> + >>> + /** >>> + * This member is always used for AV_OPT_FLAG_ARRAY options. When >>> + * non-NULL, the first character of the string must be the separator to >>> + * be used for (de)serializing lists to/from strings with av_opt_get(), >> >> This is quite ugly. Also it breaks the assumption that if the user sets an >> option value to the default value of the option, than it will work. > > I don't follow, what assumption are you talking about? > >> So let's just remove this feature for now. >> >> Eventually I think some new struct should be introduced, e.g. >> AVOptionExtension, which can be used to specify additional option >> settings, such as array min/max size, and maybe separator. It would be a >> lot more clean and future proof than filling the holes in AVOption. > > I've actually considered that, but don't see a clean way of linking such > an extension with its option. We only have an int-sized hole, so can't > add a new pointer field to AVOption. If there's no other solution, then adding a new field is ok. _______________________________________________ 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".