From patchwork Tue Jul 2 09:08:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Sayers X-Patchwork-Id: 50279 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cc64:0:b0:482:c625:d099 with SMTP id k4csp2292885vqv; Tue, 2 Jul 2024 02:09:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV3Oi1CVdOH4JPJoYYOgOej48wnaBMQj+Yv4i1sQhi82owoDaNfuYvU1J5TtW+7VypSe0/WA8DqmVCsj5dPjcYvEzgjFN9xfgFOTg== X-Google-Smtp-Source: AGHT+IF+a00IaYCQm7GYpaUuysQ/pksFk91VtYc5DgCxC3aYp9X6GLxdnDSroYrkWBSX/JCzQsMB X-Received: by 2002:a05:6402:5194:b0:57d:6326:c658 with SMTP id 4fb4d7f45d1cf-5879c36f7f1mr6492921a12.0.1719911398808; Tue, 02 Jul 2024 02:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719911398; cv=none; d=google.com; s=arc-20160816; b=0Dl214mA+rwHVVDmYvCLCNYvynPeFGMHvse+PMQtCVpOyHvEksXn/54c4CZAtZagy2 F2i03MSze4oqxHTYWAlFA0ivHME9XhKIa/R8Vy3yTwouViu7aG7w6ZI9FjZV6HQoZ3UC rDtTxUvW96YadsNzpiO+diURc/LIDSYbcdAHkPZEcGLTYk9myr1shvdpomRXqktu7bql AZgZBCEntxh2I5WBrWwrbvDzicWxp11+HfXWxtRG/QgGWX1Z5bqzZYuHk94B4eoDZDe6 se2ABTAp8+O9Qbbhm3FGlmosAASdMIm0oTJh/DFZn0bsaSlC+fepy900EJbUsRRzHaP2 E4PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=c07pIW0/J1IeibnD+r2jHz0uIoSkwPTn86WD0LdAfws=; fh=73ExZnkQ8FYbu/qeQNmI0dtHCfShNh8/NmZJs1umltM=; b=qheo9QBK6yTzG/zemqGzlIrNKoj6pL/gIuSEwR0Npox6elHkqcw754EDnY01OGIKzk 7m8yiIKwNfQyAln7fRY0363TuY7JH7yH/wTYzR1dL7OcPKNcat8qLBQGq0k+bWNWEoF/ 2D4Byns6JgTdGLEBCf47fXDnw2S3sTcdYhFNYMFxwIuP4dBnpWMbpEFTMRBmzHRZ15sX uB/BE1ZFwIRZczjZn9fe5Nasi9qzZa4Ii95I9Qkiy/VcIun17dSuKE2tBOIBlUiV5MAw v6wTkwi/pGiRE1lb8p6suJ+7XZv/katl8FmlRQphcrmjBMxZza+DSNCxNFeLBrZzgouQ AiAg==; dara=google.com 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 4fb4d7f45d1cf-586150750f6si4736993a12.455.2024.07.02.02.09.58; Tue, 02 Jul 2024 02:09:58 -0700 (PDT) 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 E938168D8DE; Tue, 2 Jul 2024 12:09:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from alt2.a-painless.mh.aa.net.uk (alt2.a-painless.mh.aa.net.uk [81.187.30.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C4DA68D655 for ; Tue, 2 Jul 2024 12:09:27 +0300 (EEST) Received: from 0.b.4.b.7.4.0.8.c.4.a.5.d.8.b.2.0.5.8.0.9.1.8.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:819:850:2b8d:5a4c:8047:b4b0] helo=andrews-2024-laptop.lan) by painless-a.thn.aa.net.uk with esmtp (Exim 4.96) (envelope-from ) id 1sOZVu-004H8u-0i; Tue, 02 Jul 2024 10:09:26 +0100 From: Andrew Sayers To: ffmpeg-devel@ffmpeg.org Date: Tue, 2 Jul 2024 10:08:39 +0100 Message-ID: <20240702090917.319956-3-ffmpeg-devel@pileofstuff.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702090917.319956-1-ffmpeg-devel@pileofstuff.org> References: <20240702090917.319956-1-ffmpeg-devel@pileofstuff.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places 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: Andrew Sayers Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9i8CxbyuIvkJ An inattentive user might not see the explanation at the top of this file. Paste the explanation to all the places they might see it. --- libavutil/opt.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libavutil/opt.h b/libavutil/opt.h index b78c3406fa..289ae9f410 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -496,6 +496,9 @@ typedef struct AVOptionRanges { /** * Set the values of all AVOption fields to their default values. * + * Note: after a struct is initialized, only options with the + * AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be modified. + * * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) */ void av_opt_set_defaults(void *s); @@ -505,6 +508,9 @@ void av_opt_set_defaults(void *s); * AVOption fields for which (opt->flags & mask) == flags will have their * default applied to s. * + * Note: after a struct is initialized, only options with the + * AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be modified. + * * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) * @param mask combination of AV_OPT_FLAG_* * @param flags combination of AV_OPT_FLAG_* @@ -674,6 +680,9 @@ enum { * key. ctx must be an AVClass context, storing is done using * AVOptions. * + * Note: after a struct is initialized, only options with the + * AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be modified. + * * @param opts options string to parse, may be NULL * @param key_val_sep a 0-terminated list of characters used to * separate key from value @@ -692,6 +701,9 @@ int av_set_options_string(void *ctx, const char *opts, * Parse the key-value pairs list in opts. For each key=value pair found, * set the value of the corresponding option in ctx. * + * Note: after a struct is initialized, only options with the + * AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be modified. + * * @param ctx the AVClass object to set options on * @param opts the options string, key-value pairs separated by a * delimiter @@ -722,6 +734,9 @@ int av_opt_set_from_string(void *ctx, const char *opts, /** * Set all the options from a given dictionary on an object. * + * Note: after a struct is initialized, only options with the + * AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be modified. + * * @param obj a struct whose first element is a pointer to AVClass * @param options options to process. This dictionary will be freed and replaced * by a new one containing all options not found in obj. @@ -739,6 +754,9 @@ int av_opt_set_dict(void *obj, struct AVDictionary **options); /** * Set all the options from a given dictionary on an object. * + * Note: after a struct is initialized, only options with the + * AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be modified. + * * @param obj a struct whose first element is a pointer to AVClass * @param options options to process. This dictionary will be freed and replaced * by a new one containing all options not found in obj. @@ -777,6 +795,9 @@ int av_opt_copy(void *dest, const void *src); * @{ * Those functions set the field of obj with the given name to value. * + * Note: after a struct is initialized, only options with the + * AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be modified. + * * @param[in] obj A struct whose first element is a pointer to an AVClass. * @param[in] name the name of the field to set * @param[in] val The value to set. In case of av_opt_set() if the field is not