Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
@ 2024-06-05 13:18 Andrew Sayers
  2024-06-05 13:34 ` Paul B Mahol
  0 siblings, 1 reply; 38+ messages in thread
From: Andrew Sayers @ 2024-06-05 13:18 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

An external API developer might think they can use AVOptions to modify values
during playback (e.g. putting a playback quality slider next to the volume
slider).  Make it clear that behaviour is not recommended.

Include the warning in the group description and the text for every function
that sets options, but leave it implicit in functions that get options.
This reflects the fact that *modifying* options is likely to cause weird bugs,
while *reading* options isn't guaranteed but is likely to be safe.
---
 libavutil/opt.h | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/libavutil/opt.h b/libavutil/opt.h
index 07e27a9208..13292c6473 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -53,11 +53,16 @@
  * question is allowed to access the field. This allows us to extend the
  * semantics of those fields without breaking API compatibility.
  *
+ * Note that AVOptions functions are not reentrant, and options may be accessed
+ * from internal FFmpeg threads.  Unless otherwise noted, it is best to avoid
+ * modifying options once a struct has been initialized.
+ *
  * @section avoptions_scope Scope of AVOptions
  *
  * AVOptions is designed to support any set of multimedia configuration options
- * that can be defined at compile-time.  Although it is mainly used to expose
- * FFmpeg options, you are welcome to adapt it to your own use case.
+ * that can be defined at compile-time and set at object creation time.  Although
+ * it is mainly used to expose FFmpeg options, you are welcome to adapt it
+ * to your own use case.
  *
  * No single approach can ever fully solve the problem of configuration,
  * but please submit a patch if you believe you have found a problem
@@ -483,6 +488,9 @@ typedef struct AVOptionRanges {
 /**
  * Set the values of all AVOption fields to their default values.
  *
+ * Note: like all AVOptions functions, this is not reentrant.  Unless
+ * otherwise noted, it should only be used before initializing the struct.
+ *
  * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass)
  */
 void av_opt_set_defaults(void *s);
@@ -492,6 +500,9 @@ void av_opt_set_defaults(void *s);
  * AVOption fields for which (opt->flags & mask) == flags will have their
  * default applied to s.
  *
+ * Note: like all AVOptions functions, this is not reentrant.  Unless
+ * otherwise noted, it should only be used before initializing the struct.
+ *
  * @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_*
@@ -661,6 +672,9 @@ enum {
  * key. ctx must be an AVClass context, storing is done using
  * AVOptions.
  *
+ * Note: like all AVOptions functions, this is not reentrant.  Unless
+ * otherwise noted, it should only be used before initializing the struct.
+ *
  * @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
@@ -679,6 +693,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: like all AVOptions functions, this is not reentrant.  Unless
+ * otherwise noted, it should only be used before initializing the struct.
+ *
  * @param ctx          the AVClass object to set options on
  * @param opts         the options string, key-value pairs separated by a
  *                     delimiter
@@ -709,6 +726,9 @@ int av_opt_set_from_string(void *ctx, const char *opts,
 /**
  * Set all the options from a given dictionary on an object.
  *
+ * Note: like all AVOptions functions, this is not reentrant.  Unless
+ * otherwise noted, it should only be used before initializing the struct.
+ *
  * @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.
@@ -726,6 +746,9 @@ int av_opt_set_dict(void *obj, struct AVDictionary **options);
 /**
  * Set all the options from a given dictionary on an object.
  *
+ * Note: like all AVOptions functions, this is not reentrant.  Unless
+ * otherwise noted, it should only be used before initializing the struct.
+ *
  * @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.
@@ -764,6 +787,9 @@ int av_opt_copy(void *dest, const void *src);
  * @{
  * Those functions set the field of obj with the given name to value.
  *
+ * Note: like all AVOptions functions, these are not reentrant.  Unless
+ * otherwise noted, they should only be used before initializing the struct.
+ *
  * @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
-- 
2.45.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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-05 13:18 [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant Andrew Sayers
@ 2024-06-05 13:34 ` Paul B Mahol
  2024-06-05 13:43   ` Andrew Sayers
  0 siblings, 1 reply; 38+ messages in thread
From: Paul B Mahol @ 2024-06-05 13:34 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andrew Sayers

On Wed, Jun 5, 2024 at 3:18 PM Andrew Sayers <ffmpeg-devel@pileofstuff.org>
wrote:

> An external API developer might think they can use AVOptions to modify
> values
> during playback (e.g. putting a playback quality slider next to the volume
> slider).  Make it clear that behaviour is not recommended.
>

There are options that can be changed at runtime,
And it works just fine.


>
> Include the warning in the group description and the text for every
> function
> that sets options, but leave it implicit in functions that get options.
> This reflects the fact that *modifying* options is likely to cause weird
> bugs,
> while *reading* options isn't guaranteed but is likely to be safe.
> ---
>  libavutil/opt.h | 30 ++++++++++++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/libavutil/opt.h b/libavutil/opt.h
> index 07e27a9208..13292c6473 100644
> --- a/libavutil/opt.h
> +++ b/libavutil/opt.h
> @@ -53,11 +53,16 @@
>   * question is allowed to access the field. This allows us to extend the
>   * semantics of those fields without breaking API compatibility.
>   *
> + * Note that AVOptions functions are not reentrant, and options may be
> accessed
> + * from internal FFmpeg threads.  Unless otherwise noted, it is best to
> avoid
> + * modifying options once a struct has been initialized.
> + *
>   * @section avoptions_scope Scope of AVOptions
>   *
>   * AVOptions is designed to support any set of multimedia configuration
> options
> - * that can be defined at compile-time.  Although it is mainly used to
> expose
> - * FFmpeg options, you are welcome to adapt it to your own use case.
> + * that can be defined at compile-time and set at object creation time.
> Although
> + * it is mainly used to expose FFmpeg options, you are welcome to adapt it
> + * to your own use case.
>   *
>   * No single approach can ever fully solve the problem of configuration,
>   * but please submit a patch if you believe you have found a problem
> @@ -483,6 +488,9 @@ typedef struct AVOptionRanges {
>  /**
>   * Set the values of all AVOption fields to their default values.
>   *
> + * Note: like all AVOptions functions, this is not reentrant.  Unless
> + * otherwise noted, it should only be used before initializing the struct.
> + *
>   * @param s an AVOption-enabled struct (its first member must be a
> pointer to AVClass)
>   */
>  void av_opt_set_defaults(void *s);
> @@ -492,6 +500,9 @@ void av_opt_set_defaults(void *s);
>   * AVOption fields for which (opt->flags & mask) == flags will have their
>   * default applied to s.
>   *
> + * Note: like all AVOptions functions, this is not reentrant.  Unless
> + * otherwise noted, it should only be used before initializing the struct.
> + *
>   * @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_*
> @@ -661,6 +672,9 @@ enum {
>   * key. ctx must be an AVClass context, storing is done using
>   * AVOptions.
>   *
> + * Note: like all AVOptions functions, this is not reentrant.  Unless
> + * otherwise noted, it should only be used before initializing the struct.
> + *
>   * @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
> @@ -679,6 +693,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: like all AVOptions functions, this is not reentrant.  Unless
> + * otherwise noted, it should only be used before initializing the struct.
> + *
>   * @param ctx          the AVClass object to set options on
>   * @param opts         the options string, key-value pairs separated by a
>   *                     delimiter
> @@ -709,6 +726,9 @@ int av_opt_set_from_string(void *ctx, const char *opts,
>  /**
>   * Set all the options from a given dictionary on an object.
>   *
> + * Note: like all AVOptions functions, this is not reentrant.  Unless
> + * otherwise noted, it should only be used before initializing the struct.
> + *
>   * @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.
> @@ -726,6 +746,9 @@ int av_opt_set_dict(void *obj, struct AVDictionary
> **options);
>  /**
>   * Set all the options from a given dictionary on an object.
>   *
> + * Note: like all AVOptions functions, this is not reentrant.  Unless
> + * otherwise noted, it should only be used before initializing the struct.
> + *
>   * @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.
> @@ -764,6 +787,9 @@ int av_opt_copy(void *dest, const void *src);
>   * @{
>   * Those functions set the field of obj with the given name to value.
>   *
> + * Note: like all AVOptions functions, these are not reentrant.  Unless
> + * otherwise noted, they should only be used before initializing the
> struct.
> + *
>   * @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
> --
> 2.45.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".
>
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-05 13:34 ` Paul B Mahol
@ 2024-06-05 13:43   ` Andrew Sayers
  2024-06-05 13:46     ` Ronald S. Bultje
  2024-06-05 13:50     ` Paul B Mahol
  0 siblings, 2 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-06-05 13:43 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Wed, Jun 05, 2024 at 03:34:50PM +0200, Paul B Mahol wrote:
> On Wed, Jun 5, 2024 at 3:18 PM Andrew Sayers <ffmpeg-devel@pileofstuff.org>
> wrote:
> 
> > An external API developer might think they can use AVOptions to modify
> > values
> > during playback (e.g. putting a playback quality slider next to the volume
> > slider).  Make it clear that behaviour is not recommended.
> >
> 
> There are options that can be changed at runtime,
> And it works just fine.

How would an external developer know which options can be safely changed
(preferably including in future versions of FFmpeg) vs. ones where their tests
got lucky and happened not to trigger a read during a non-atomic write?
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-05 13:43   ` Andrew Sayers
@ 2024-06-05 13:46     ` Ronald S. Bultje
  2024-06-05 14:22       ` Andrew Sayers
  2024-06-05 13:50     ` Paul B Mahol
  1 sibling, 1 reply; 38+ messages in thread
From: Ronald S. Bultje @ 2024-06-05 13:46 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Hi,

On Wed, Jun 5, 2024 at 9:44 AM Andrew Sayers <ffmpeg-devel@pileofstuff.org>
wrote:

> On Wed, Jun 05, 2024 at 03:34:50PM +0200, Paul B Mahol wrote:
> > On Wed, Jun 5, 2024 at 3:18 PM Andrew Sayers <
> ffmpeg-devel@pileofstuff.org>
> > wrote:
> >
> > > An external API developer might think they can use AVOptions to modify
> > > values
> > > during playback (e.g. putting a playback quality slider next to the
> volume
> > > slider).  Make it clear that behaviour is not recommended.
> > >
> >
> > There are options that can be changed at runtime,
> > And it works just fine.
>
> How would an external developer know which options can be safely changed
> (preferably including in future versions of FFmpeg) vs. ones where their
> tests
> got lucky and happened not to trigger a read during a non-atomic write?
>

If you see that happening, it would be good to submit a bug report. Right
now it's very abstract.

Ronald
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-05 13:43   ` Andrew Sayers
  2024-06-05 13:46     ` Ronald S. Bultje
@ 2024-06-05 13:50     ` Paul B Mahol
  2024-06-06 16:02       ` [FFmpeg-devel] [PATCH v2] lavu/opt: Discuss AV_OPT_FLAG_RUNTIME_PARAM more explicitly Andrew Sayers
  1 sibling, 1 reply; 38+ messages in thread
From: Paul B Mahol @ 2024-06-05 13:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Wed, Jun 5, 2024 at 3:44 PM Andrew Sayers <ffmpeg-devel@pileofstuff.org>
wrote:

> On Wed, Jun 05, 2024 at 03:34:50PM +0200, Paul B Mahol wrote:
> > On Wed, Jun 5, 2024 at 3:18 PM Andrew Sayers <
> ffmpeg-devel@pileofstuff.org>
> > wrote:
> >
> > > An external API developer might think they can use AVOptions to modify
> > > values
> > > during playback (e.g. putting a playback quality slider next to the
> volume
> > > slider).  Make it clear that behaviour is not recommended.
> > >
> >
> > There are options that can be changed at runtime,
> > And it works just fine.
>
> How would an external developer know which options can be safely changed
> (preferably including in future versions of FFmpeg) vs. ones where their
> tests
> got lucky and happened not to trigger a read during a non-atomic write?
>

See this flag:

#define AV_OPT_FLAG_RUNTIME_PARAM   (1 << 15)

What is the point/gain in changing options from multiple threads
concurrently?



> _______________________________________________
> 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".
>
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-05 13:46     ` Ronald S. Bultje
@ 2024-06-05 14:22       ` Andrew Sayers
  2024-06-05 23:17         ` Michael Niedermayer
  0 siblings, 1 reply; 38+ messages in thread
From: Andrew Sayers @ 2024-06-05 14:22 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Wed, Jun 05, 2024 at 09:46:16AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, Jun 5, 2024 at 9:44 AM Andrew Sayers <ffmpeg-devel@pileofstuff.org>
> wrote:
> 
> > On Wed, Jun 05, 2024 at 03:34:50PM +0200, Paul B Mahol wrote:
> > > On Wed, Jun 5, 2024 at 3:18 PM Andrew Sayers <
> > ffmpeg-devel@pileofstuff.org>
> > > wrote:
> > >
> > > > An external API developer might think they can use AVOptions to modify
> > > > values
> > > > during playback (e.g. putting a playback quality slider next to the
> > volume
> > > > slider).  Make it clear that behaviour is not recommended.
> > > >
> > >
> > > There are options that can be changed at runtime,
> > > And it works just fine.
> >
> > How would an external developer know which options can be safely changed
> > (preferably including in future versions of FFmpeg) vs. ones where their
> > tests
> > got lucky and happened not to trigger a read during a non-atomic write?
> >
> 
> If you see that happening, it would be good to submit a bug report. Right
> now it's very abstract.

I think we might be talking past each other - here's a concrete example:

The private struct "SetTSContext" includes an AVOptions-accessible member
"time_base", currently implemented as an AVRational (i.e. a pair of ints).
write_number() in libavutil/opt.c sets options of type AV_OPT_TYPE_RATIONAL
in such a way that a poorly-timed read could see the new numerator
and old denominator (or the other way around).

If I wrote a program that let users dynamically change the time base,
and someone switched their timebase from 1/30 to 100/3000, one unlucky user
might have a few frames encoded with a timebase of 100/30.  Is that something
the AVOptions API is supposed to support?  If yes, the bug is that
AVOptions access isn't guarded by a mutex.  If no, there's no bug, just an
edge case worth mentioning in the docs.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-05 14:22       ` Andrew Sayers
@ 2024-06-05 23:17         ` Michael Niedermayer
  2024-06-06  8:29           ` Andrew Sayers
  0 siblings, 1 reply; 38+ messages in thread
From: Michael Niedermayer @ 2024-06-05 23:17 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 2617 bytes --]

On Wed, Jun 05, 2024 at 03:22:55PM +0100, Andrew Sayers wrote:
> On Wed, Jun 05, 2024 at 09:46:16AM -0400, Ronald S. Bultje wrote:
> > Hi,
> > 
> > On Wed, Jun 5, 2024 at 9:44 AM Andrew Sayers <ffmpeg-devel@pileofstuff.org>
> > wrote:
> > 
> > > On Wed, Jun 05, 2024 at 03:34:50PM +0200, Paul B Mahol wrote:
> > > > On Wed, Jun 5, 2024 at 3:18 PM Andrew Sayers <
> > > ffmpeg-devel@pileofstuff.org>
> > > > wrote:
> > > >
> > > > > An external API developer might think they can use AVOptions to modify
> > > > > values
> > > > > during playback (e.g. putting a playback quality slider next to the
> > > volume
> > > > > slider).  Make it clear that behaviour is not recommended.
> > > > >
> > > >
> > > > There are options that can be changed at runtime,
> > > > And it works just fine.
> > >
> > > How would an external developer know which options can be safely changed
> > > (preferably including in future versions of FFmpeg) vs. ones where their
> > > tests
> > > got lucky and happened not to trigger a read during a non-atomic write?
> > >
> > 
> > If you see that happening, it would be good to submit a bug report. Right
> > now it's very abstract.
> 
> I think we might be talking past each other - here's a concrete example:
> 
> The private struct "SetTSContext" includes an AVOptions-accessible member
> "time_base", currently implemented as an AVRational (i.e. a pair of ints).
> write_number() in libavutil/opt.c sets options of type AV_OPT_TYPE_RATIONAL
> in such a way that a poorly-timed read could see the new numerator
> and old denominator (or the other way around).
> 
> If I wrote a program that let users dynamically change the time base,
> and someone switched their timebase from 1/30 to 100/3000, one unlucky user
> might have a few frames encoded with a timebase of 100/30.  Is that something
> the AVOptions API is supposed to support?  If yes, the bug is that
> AVOptions access isn't guarded by a mutex.  If no, there's no bug, just an
> edge case worth mentioning in the docs.

AVOption simply provides light weight access to the struct fields.
Calling AVOption non re-entrant in modifying a field you arent even allowed
to modify from 2 threads is confusing

If you want to modify a field from 2 threads that field could be some sort
of atomic type. This can then easily be added to AVOption

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-05 23:17         ` Michael Niedermayer
@ 2024-06-06  8:29           ` Andrew Sayers
  2024-06-06 14:24             ` Michael Niedermayer
  0 siblings, 1 reply; 38+ messages in thread
From: Andrew Sayers @ 2024-06-06  8:29 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Thu, Jun 06, 2024 at 01:17:48AM +0200, Michael Niedermayer wrote:
[...]
> AVOption simply provides light weight access to the struct fields.
> Calling AVOption non re-entrant in modifying a field you arent even allowed
> to modify from 2 threads is confusing

I think you're saying there's already a rule about modifying AVOptions from
2 threads.  Could you explain that in more detail?

> If you want to modify a field from 2 threads that field could be some sort
> of atomic type. This can then easily be added to AVOption

Doing that for a single option would involve publicly guaranteeing its
representation for at least one major version.  At that point, you might as well
just tell people to access it as a member of a public struct.

To be clear - this isn't a programming problem, it's a design problem.
The interface currently allows external developers to assume something will
always work when it's actually just something that could be supported some day.
Writing up the current behaviour as a guarantee lets them avoid writing code
that will generate hard-to-reproduce bugs, at the cost of making it slightly
harder for us to do something we've never needed to do in the past.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-06  8:29           ` Andrew Sayers
@ 2024-06-06 14:24             ` Michael Niedermayer
  2024-06-06 15:16               ` Andrew Sayers
  0 siblings, 1 reply; 38+ messages in thread
From: Michael Niedermayer @ 2024-06-06 14:24 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1971 bytes --]

On Thu, Jun 06, 2024 at 09:29:24AM +0100, Andrew Sayers wrote:
> On Thu, Jun 06, 2024 at 01:17:48AM +0200, Michael Niedermayer wrote:
> [...]
> > AVOption simply provides light weight access to the struct fields.
> > Calling AVOption non re-entrant in modifying a field you arent even allowed
> > to modify from 2 threads is confusing
> 
> I think you're saying there's already a rule about modifying AVOptions from
> 2 threads.  Could you explain that in more detail?

Well, one way this can be argued is this:
Latest C draft: (but i doubt this is different) ISO/IEC 9899:2017   C17 ballot N2176

"Two expression evaluations conflict if one of them modifies a memory location and the other one
 reads or modifies the same memory location"

so if you have 2 threads and one writes into a int and another reads it at the
same time, the code is broken.
The code doing said act through some API doesnt become less broken

Calling AVOption non re-rentrant because of that is false thats as if one executed
strtok_r(a,b,c) with the VERY same a,b,c from 2 threads and then said
its not thread safe

strtok_r() is thread safe and reentrant if its used correctly, so is AVOption


> 
> > If you want to modify a field from 2 threads that field could be some sort
> > of atomic type. This can then easily be added to AVOption
> 
> Doing that for a single option would involve publicly guaranteeing its
> representation for at least one major version.

A feature can be added at any time without a major version bump
adding an option that uses a atomic type can thus also be done at any time

It can be possible to transparenntly change the underlaying representation
under an AVOption without ABI break but that requires some thought and care

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is a danger to trust the dream we wish for rather than
the science we have, -- Dr. Kenneth Brown

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-06 14:24             ` Michael Niedermayer
@ 2024-06-06 15:16               ` Andrew Sayers
  2024-06-06 15:21                 ` Andreas Rheinhardt
  0 siblings, 1 reply; 38+ messages in thread
From: Andrew Sayers @ 2024-06-06 15:16 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Thu, Jun 06, 2024 at 04:24:11PM +0200, Michael Niedermayer wrote:
> On Thu, Jun 06, 2024 at 09:29:24AM +0100, Andrew Sayers wrote:
> > On Thu, Jun 06, 2024 at 01:17:48AM +0200, Michael Niedermayer wrote:
> > [...]
> > > AVOption simply provides light weight access to the struct fields.
> > > Calling AVOption non re-entrant in modifying a field you arent even allowed
> > > to modify from 2 threads is confusing
> > 
> > I think you're saying there's already a rule about modifying AVOptions from
> > 2 threads.  Could you explain that in more detail?
> 
> Well, one way this can be argued is this:
> Latest C draft: (but i doubt this is different) ISO/IEC 9899:2017   C17 ballot N2176
> 
> "Two expression evaluations conflict if one of them modifies a memory location and the other one
>  reads or modifies the same memory location"
> 
> so if you have 2 threads and one writes into a int and another reads it at the
> same time, the code is broken.
> The code doing said act through some API doesnt become less broken
> 
> Calling AVOption non re-rentrant because of that is false thats as if one executed
> strtok_r(a,b,c) with the VERY same a,b,c from 2 threads and then said
> its not thread safe
> 
> strtok_r() is thread safe and reentrant if its used correctly, so is AVOption
[...]

Ok, how about if the patch avoided the word "reentrant" and just said:

+ * Note: AVOptions values should not be modified after a struct is initialized.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-06 15:16               ` Andrew Sayers
@ 2024-06-06 15:21                 ` Andreas Rheinhardt
  2024-06-06 15:43                   ` Andrew Sayers
  0 siblings, 1 reply; 38+ messages in thread
From: Andreas Rheinhardt @ 2024-06-06 15:21 UTC (permalink / raw)
  To: ffmpeg-devel

Andrew Sayers:
> On Thu, Jun 06, 2024 at 04:24:11PM +0200, Michael Niedermayer wrote:
>> On Thu, Jun 06, 2024 at 09:29:24AM +0100, Andrew Sayers wrote:
>>> On Thu, Jun 06, 2024 at 01:17:48AM +0200, Michael Niedermayer wrote:
>>> [...]
>>>> AVOption simply provides light weight access to the struct fields.
>>>> Calling AVOption non re-entrant in modifying a field you arent even allowed
>>>> to modify from 2 threads is confusing
>>>
>>> I think you're saying there's already a rule about modifying AVOptions from
>>> 2 threads.  Could you explain that in more detail?
>>
>> Well, one way this can be argued is this:
>> Latest C draft: (but i doubt this is different) ISO/IEC 9899:2017   C17 ballot N2176
>>
>> "Two expression evaluations conflict if one of them modifies a memory location and the other one
>>  reads or modifies the same memory location"
>>
>> so if you have 2 threads and one writes into a int and another reads it at the
>> same time, the code is broken.
>> The code doing said act through some API doesnt become less broken
>>
>> Calling AVOption non re-rentrant because of that is false thats as if one executed
>> strtok_r(a,b,c) with the VERY same a,b,c from 2 threads and then said
>> its not thread safe
>>
>> strtok_r() is thread safe and reentrant if its used correctly, so is AVOption
> [...]
> 
> Ok, how about if the patch avoided the word "reentrant" and just said:
> 
> + * Note: AVOptions values should not be modified after a struct is initialized.

This is wrong either. As Paul has already pointed out to you, some
options are allowed to be modified lateron.

- Andreas

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant
  2024-06-06 15:21                 ` Andreas Rheinhardt
@ 2024-06-06 15:43                   ` Andrew Sayers
  0 siblings, 0 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-06-06 15:43 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Thu, Jun 06, 2024 at 05:21:00PM +0200, Andreas Rheinhardt wrote:
> Andrew Sayers:
> > On Thu, Jun 06, 2024 at 04:24:11PM +0200, Michael Niedermayer wrote:
> >> On Thu, Jun 06, 2024 at 09:29:24AM +0100, Andrew Sayers wrote:
> >>> On Thu, Jun 06, 2024 at 01:17:48AM +0200, Michael Niedermayer wrote:
> >>> [...]
> >>>> AVOption simply provides light weight access to the struct fields.
> >>>> Calling AVOption non re-entrant in modifying a field you arent even allowed
> >>>> to modify from 2 threads is confusing
> >>>
> >>> I think you're saying there's already a rule about modifying AVOptions from
> >>> 2 threads.  Could you explain that in more detail?
> >>
> >> Well, one way this can be argued is this:
> >> Latest C draft: (but i doubt this is different) ISO/IEC 9899:2017   C17 ballot N2176
> >>
> >> "Two expression evaluations conflict if one of them modifies a memory location and the other one
> >>  reads or modifies the same memory location"
> >>
> >> so if you have 2 threads and one writes into a int and another reads it at the
> >> same time, the code is broken.
> >> The code doing said act through some API doesnt become less broken
> >>
> >> Calling AVOption non re-rentrant because of that is false thats as if one executed
> >> strtok_r(a,b,c) with the VERY same a,b,c from 2 threads and then said
> >> its not thread safe
> >>
> >> strtok_r() is thread safe and reentrant if its used correctly, so is AVOption
> > [...]
> > 
> > Ok, how about if the patch avoided the word "reentrant" and just said:
> > 
> > + * Note: AVOptions values should not be modified after a struct is initialized.
> 
> This is wrong either. As Paul has already pointed out to you, some
> options are allowed to be modified lateron.

Ah, I'd interpreted "runtime" to be the opposite of "compile-time", not
"initialization-time".  I'll propose a new patch that should be clearer.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v2] lavu/opt: Discuss AV_OPT_FLAG_RUNTIME_PARAM more explicitly
  2024-06-05 13:50     ` Paul B Mahol
@ 2024-06-06 16:02       ` Andrew Sayers
  2024-06-16 16:04         ` Stefano Sabatini
  0 siblings, 1 reply; 38+ messages in thread
From: Andrew Sayers @ 2024-06-06 16:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

After a struct is initialized, only options with the
AV_OPT_FLAG_RUNTIME_PARAM flag can be modified.

Make that clearer, for the sake of readers who would otherwise
assume all options can be modified at any time.
---
 libavutil/opt.h | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/libavutil/opt.h b/libavutil/opt.h
index 07e27a9208..d23c10bcf5 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -53,6 +53,9 @@
  * question is allowed to access the field. This allows us to extend the
  * semantics of those fields without breaking API compatibility.
  *
+ * Note: only options with the AV_OPT_FLAG_RUNTIME_PARAM flag can be
+ * modified after the struct is initialized.
+ *
  * @section avoptions_scope Scope of AVOptions
  *
  * AVOptions is designed to support any set of multimedia configuration options
@@ -300,7 +303,7 @@ enum AVOptionType{
 #define AV_OPT_FLAG_BSF_PARAM       (1 << 8)
 
 /**
- * A generic parameter which can be set by the user at runtime.
+ * A generic parameter which can be set by the user after initialization.
  */
 #define AV_OPT_FLAG_RUNTIME_PARAM   (1 << 15)
 /**
@@ -483,6 +486,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_RUNTIME_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);
@@ -492,6 +498,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_RUNTIME_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_*
@@ -661,6 +670,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_RUNTIME_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
@@ -679,6 +691,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_RUNTIME_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
@@ -709,6 +724,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_RUNTIME_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.
@@ -726,6 +744,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_RUNTIME_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.
@@ -764,6 +785,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_RUNTIME_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
-- 
2.45.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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] lavu/opt: Discuss AV_OPT_FLAG_RUNTIME_PARAM more explicitly
  2024-06-06 16:02       ` [FFmpeg-devel] [PATCH v2] lavu/opt: Discuss AV_OPT_FLAG_RUNTIME_PARAM more explicitly Andrew Sayers
@ 2024-06-16 16:04         ` Stefano Sabatini
  2024-06-16 17:08           ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
  0 siblings, 1 reply; 38+ messages in thread
From: Stefano Sabatini @ 2024-06-16 16:04 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andrew Sayers

On date Thursday 2024-06-06 17:02:06 +0100, Andrew Sayers wrote:
> After a struct is initialized, only options with the
> AV_OPT_FLAG_RUNTIME_PARAM flag can be modified.
> 
> Make that clearer, for the sake of readers who would otherwise
> assume all options can be modified at any time.
> ---
>  libavutil/opt.h | 26 +++++++++++++++++++++++++-
>  1 file changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/opt.h b/libavutil/opt.h
> index 07e27a9208..d23c10bcf5 100644
> --- a/libavutil/opt.h
> +++ b/libavutil/opt.h
> @@ -53,6 +53,9 @@
>   * question is allowed to access the field. This allows us to extend the
>   * semantics of those fields without breaking API compatibility.
>   *
> + * Note: only options with the AV_OPT_FLAG_RUNTIME_PARAM flag can be
> + * modified after the struct is initialized.
> + *
>   * @section avoptions_scope Scope of AVOptions
>   *
>   * AVOptions is designed to support any set of multimedia configuration options
> @@ -300,7 +303,7 @@ enum AVOptionType{
>  #define AV_OPT_FLAG_BSF_PARAM       (1 << 8)
>  

>  /**
> - * A generic parameter which can be set by the user at runtime.
> + * A generic parameter which can be set by the user after initialization.
>   */
>  #define AV_OPT_FLAG_RUNTIME_PARAM   (1 << 15)

I'm fine with changing the description, but then I wonder if we should
also rename the flag accordingly (by adding a new alias and
deprecating the old one):
AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
??

>  /**
> @@ -483,6 +486,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_RUNTIME_PARAM flag can be modified.
> + *

drop this note and the following ones, this is assumed by the flags so
there is no need to repeat this all over

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-06-16 16:04         ` Stefano Sabatini
@ 2024-06-16 17:08           ` Andrew Sayers
  2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
                               ` (4 more replies)
  0 siblings, 5 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-06-16 17:08 UTC (permalink / raw)
  To: ffmpeg-devel

AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM is fine by me, here's a patch.
I've added a "@deprecated" comment for the old name, but would this
need to be queued up for 8.0?  Technically this is a backwards-incompatible
change to the existing API, even though it doesn't change the ABI or generate
warnings when compiling code.

My vote is always going to be for putting documentation in the first place
people look, even at the expense of redundancy.  But I can live without the
extra comments so long as the flag is renamed.  This patch moves the extra
documentation to an optional commit - I'm fine with just applying #1 and #3
if people prefer, but it's there if the conversation goes the other way.

Also, I think this is better, but can also live with the v2 patch,
so long as the other notes remain in.

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM
  2024-06-16 17:08           ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
@ 2024-06-16 17:08             ` Andrew Sayers
  2024-07-01 22:33               ` Stefano Sabatini
  2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places Andrew Sayers
                               ` (3 subsequent siblings)
  4 siblings, 1 reply; 38+ messages in thread
From: Andrew Sayers @ 2024-06-16 17:08 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

The old name could be misread as the opposite of "AV_OPT_FLAG_READONLY" -
some things can be set at runtime, others are read-only.  Clarify that
this refers to options that can be set after the struct is initialized.
---
 libavutil/opt.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavutil/opt.h b/libavutil/opt.h
index 07e27a9208..e050d126ed 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -53,6 +53,9 @@
  * question is allowed to access the field. This allows us to extend the
  * semantics of those fields without breaking API compatibility.
  *
+ * Note: only options with the AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be
+ * modified after the struct is initialized.
+ *
  * @section avoptions_scope Scope of AVOptions
  *
  * AVOptions is designed to support any set of multimedia configuration options
@@ -300,7 +303,12 @@ enum AVOptionType{
 #define AV_OPT_FLAG_BSF_PARAM       (1 << 8)
 
 /**
- * A generic parameter which can be set by the user at runtime.
+ * A generic parameter which can be set by the user after the struct is initialized.
+ */
+#define AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM   (1 << 15)
+/**
+ * A generic parameter which can be set by the user after the struct is initialized.
+ * @deprecated Renamed to AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM for clarity
  */
 #define AV_OPT_FLAG_RUNTIME_PARAM   (1 << 15)
 /**
-- 
2.45.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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v3 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places
  2024-06-16 17:08           ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
  2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
@ 2024-06-16 17:08             ` Andrew Sayers
  2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 3/3] all: s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g Andrew Sayers
                               ` (2 subsequent siblings)
  4 siblings, 0 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-06-16 17:08 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

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 e050d126ed..06cbe3c336 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -491,6 +491,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);
@@ -500,6 +503,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_*
@@ -669,6 +675,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
@@ -687,6 +696,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
@@ -717,6 +729,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.
@@ -734,6 +749,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.
@@ -772,6 +790,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
-- 
2.45.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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v3 3/3] all: s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g
  2024-06-16 17:08           ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
  2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
  2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places Andrew Sayers
@ 2024-06-16 17:08             ` Andrew Sayers
  2024-06-16 17:22             ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Paul B Mahol
  2024-07-01 22:26             ` Stefano Sabatini
  4 siblings, 0 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-06-16 17:08 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

Use the new name for the macro throughout the codebase.

Patch generated with the following command:

sed -i -e 's/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g' \
    $( git grep -l AV_OPT_FLAG_RUNTIME_PARAM | grep -v '^libavutil/opt.h' | grep -v '^doc/APIchanges$' )
---
 libavfilter/af_aap.c               | 2 +-
 libavfilter/af_acrusher.c          | 2 +-
 libavfilter/af_adelay.c            | 2 +-
 libavfilter/af_adenorm.c           | 2 +-
 libavfilter/af_adrc.c              | 2 +-
 libavfilter/af_adynamicequalizer.c | 2 +-
 libavfilter/af_adynamicsmooth.c    | 2 +-
 libavfilter/af_aemphasis.c         | 2 +-
 libavfilter/af_aexciter.c          | 2 +-
 libavfilter/af_afade.c             | 2 +-
 libavfilter/af_afftdn.c            | 2 +-
 libavfilter/af_afir.c              | 2 +-
 libavfilter/af_afreqshift.c        | 2 +-
 libavfilter/af_afwtdn.c            | 2 +-
 libavfilter/af_agate.c             | 2 +-
 libavfilter/af_alimiter.c          | 2 +-
 libavfilter/af_amix.c              | 2 +-
 libavfilter/af_anlmdn.c            | 2 +-
 libavfilter/af_anlms.c             | 2 +-
 libavfilter/af_apsyclip.c          | 2 +-
 libavfilter/af_arls.c              | 2 +-
 libavfilter/af_arnndn.c            | 2 +-
 libavfilter/af_asetnsamples.c      | 2 +-
 libavfilter/af_asoftclip.c         | 2 +-
 libavfilter/af_asubboost.c         | 2 +-
 libavfilter/af_asupercut.c         | 2 +-
 libavfilter/af_atempo.c            | 2 +-
 libavfilter/af_atilt.c             | 2 +-
 libavfilter/af_biquads.c           | 2 +-
 libavfilter/af_compensationdelay.c | 2 +-
 libavfilter/af_crossfeed.c         | 2 +-
 libavfilter/af_crystalizer.c       | 2 +-
 libavfilter/af_dialoguenhance.c    | 2 +-
 libavfilter/af_dynaudnorm.c        | 2 +-
 libavfilter/af_extrastereo.c       | 2 +-
 libavfilter/af_firequalizer.c      | 2 +-
 libavfilter/af_rubberband.c        | 2 +-
 libavfilter/af_sidechaincompress.c | 2 +-
 libavfilter/af_silenceremove.c     | 2 +-
 libavfilter/af_speechnorm.c        | 2 +-
 libavfilter/af_stereotools.c       | 2 +-
 libavfilter/af_stereowiden.c       | 2 +-
 libavfilter/af_surround.c          | 2 +-
 libavfilter/af_virtualbass.c       | 2 +-
 libavfilter/af_volume.c            | 2 +-
 libavfilter/avf_a3dscope.c         | 2 +-
 libavfilter/avf_avectorscope.c     | 2 +-
 libavfilter/avfilter.c             | 4 ++--
 libavfilter/f_graphmonitor.c       | 2 +-
 libavfilter/f_perms.c              | 2 +-
 libavfilter/f_realtime.c           | 2 +-
 libavfilter/f_streamselect.c       | 2 +-
 libavfilter/qrencode.c             | 2 +-
 libavfilter/setpts.c               | 2 +-
 libavfilter/src_avsynctest.c       | 2 +-
 libavfilter/vf_amplify.c           | 2 +-
 libavfilter/vf_atadenoise.c        | 2 +-
 libavfilter/vf_avgblur.c           | 2 +-
 libavfilter/vf_backgroundkey.c     | 2 +-
 libavfilter/vf_bbox.c              | 2 +-
 libavfilter/vf_bilateral.c         | 2 +-
 libavfilter/vf_blend.c             | 2 +-
 libavfilter/vf_cas.c               | 2 +-
 libavfilter/vf_chromakey.c         | 2 +-
 libavfilter/vf_chromanr.c          | 2 +-
 libavfilter/vf_chromashift.c       | 2 +-
 libavfilter/vf_colorbalance.c      | 2 +-
 libavfilter/vf_colorchannelmixer.c | 2 +-
 libavfilter/vf_colorcontrast.c     | 2 +-
 libavfilter/vf_colorcorrect.c      | 2 +-
 libavfilter/vf_colorize.c          | 2 +-
 libavfilter/vf_colorkey.c          | 2 +-
 libavfilter/vf_colorlevels.c       | 2 +-
 libavfilter/vf_colormap.c          | 2 +-
 libavfilter/vf_colortemperature.c  | 2 +-
 libavfilter/vf_convolution.c       | 2 +-
 libavfilter/vf_crop.c              | 2 +-
 libavfilter/vf_cropdetect.c        | 2 +-
 libavfilter/vf_curves.c            | 2 +-
 libavfilter/vf_datascope.c         | 2 +-
 libavfilter/vf_dblur.c             | 2 +-
 libavfilter/vf_deband.c            | 2 +-
 libavfilter/vf_deblock.c           | 2 +-
 libavfilter/vf_despill.c           | 2 +-
 libavfilter/vf_displace.c          | 2 +-
 libavfilter/vf_drawbox.c           | 2 +-
 libavfilter/vf_drawtext.c          | 2 +-
 libavfilter/vf_eq.c                | 2 +-
 libavfilter/vf_estdif.c            | 2 +-
 libavfilter/vf_exposure.c          | 2 +-
 libavfilter/vf_feedback.c          | 2 +-
 libavfilter/vf_fftdnoiz.c          | 2 +-
 libavfilter/vf_fillborders.c       | 2 +-
 libavfilter/vf_frei0r.c            | 2 +-
 libavfilter/vf_gblur.c             | 2 +-
 libavfilter/vf_guided.c            | 2 +-
 libavfilter/vf_hqdn3d.c            | 2 +-
 libavfilter/vf_hsvkey.c            | 2 +-
 libavfilter/vf_hue.c               | 2 +-
 libavfilter/vf_huesaturation.c     | 2 +-
 libavfilter/vf_il.c                | 2 +-
 libavfilter/vf_lagfun.c            | 2 +-
 libavfilter/vf_lenscorrection.c    | 2 +-
 libavfilter/vf_libplacebo.c        | 2 +-
 libavfilter/vf_limitdiff.c         | 2 +-
 libavfilter/vf_limiter.c           | 2 +-
 libavfilter/vf_lumakey.c           | 2 +-
 libavfilter/vf_lut.c               | 2 +-
 libavfilter/vf_lut2.c              | 2 +-
 libavfilter/vf_lut3d.c             | 2 +-
 libavfilter/vf_maskedclamp.c       | 2 +-
 libavfilter/vf_maskedmerge.c       | 2 +-
 libavfilter/vf_maskedminmax.c      | 2 +-
 libavfilter/vf_maskedthreshold.c   | 2 +-
 libavfilter/vf_maskfun.c           | 2 +-
 libavfilter/vf_median.c            | 2 +-
 libavfilter/vf_mix.c               | 2 +-
 libavfilter/vf_monochrome.c        | 2 +-
 libavfilter/vf_morpho.c            | 2 +-
 libavfilter/vf_multiply.c          | 2 +-
 libavfilter/vf_negate.c            | 2 +-
 libavfilter/vf_neighbor.c          | 2 +-
 libavfilter/vf_nnedi.c             | 2 +-
 libavfilter/vf_normalize.c         | 2 +-
 libavfilter/vf_phase.c             | 2 +-
 libavfilter/vf_pixelize.c          | 2 +-
 libavfilter/vf_pseudocolor.c       | 2 +-
 libavfilter/vf_readeia608.c        | 2 +-
 libavfilter/vf_rotate.c            | 2 +-
 libavfilter/vf_scale.c             | 2 +-
 libavfilter/vf_scroll.c            | 2 +-
 libavfilter/vf_shear.c             | 2 +-
 libavfilter/vf_spp.c               | 2 +-
 libavfilter/vf_swaprect.c          | 2 +-
 libavfilter/vf_threshold.c         | 2 +-
 libavfilter/vf_v360.c              | 2 +-
 libavfilter/vf_varblur.c           | 2 +-
 libavfilter/vf_vectorscope.c       | 2 +-
 libavfilter/vf_vibrance.c          | 2 +-
 libavfilter/vf_w3fdif.c            | 2 +-
 libavfilter/vf_waveform.c          | 2 +-
 libavfilter/vf_xmedian.c           | 2 +-
 libavfilter/vf_yaepblur.c          | 2 +-
 libavfilter/vf_zscale.c            | 2 +-
 libavfilter/vsrc_gradients.c       | 2 +-
 libavfilter/vsrc_testsrc.c         | 2 +-
 libavutil/opt.c                    | 2 +-
 libavutil/tests/opt.c              | 6 +++---
 148 files changed, 151 insertions(+), 151 deletions(-)

diff --git a/libavfilter/af_aap.c b/libavfilter/af_aap.c
index e4cd6f8281..50e80be2a5 100644
--- a/libavfilter/af_aap.c
+++ b/libavfilter/af_aap.c
@@ -74,7 +74,7 @@ typedef struct AudioAPContext {
 
 #define OFFSET(x) offsetof(AudioAPContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption aap_options[] = {
     { "order",      "set the filter order",      OFFSET(order),       AV_OPT_TYPE_INT,   {.i64=16},   1, INT16_MAX, A },
diff --git a/libavfilter/af_acrusher.c b/libavfilter/af_acrusher.c
index 48d7029b05..6b4eef884d 100644
--- a/libavfilter/af_acrusher.c
+++ b/libavfilter/af_acrusher.c
@@ -69,7 +69,7 @@ typedef struct ACrusherContext {
 } ACrusherContext;
 
 #define OFFSET(x) offsetof(ACrusherContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption acrusher_options[] = {
     { "level_in", "set level in",         OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1},    0.015625, 64, A },
diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c
index 8c4d4db287..5082f34a83 100644
--- a/libavfilter/af_adelay.c
+++ b/libavfilter/af_adelay.c
@@ -59,7 +59,7 @@ typedef struct AudioDelayContext {
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption adelay_options[] = {
-    { "delays", "set list of delays for each channel", OFFSET(delays), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A | AV_OPT_FLAG_RUNTIME_PARAM },
+    { "delays", "set list of delays for each channel", OFFSET(delays), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
     { "all",    "use last available delay for remained channels", OFFSET(all), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
     { NULL }
 };
diff --git a/libavfilter/af_adenorm.c b/libavfilter/af_adenorm.c
index f5f9039172..ccd6a621b8 100644
--- a/libavfilter/af_adenorm.c
+++ b/libavfilter/af_adenorm.c
@@ -248,7 +248,7 @@ static const AVFilterPad adenorm_outputs[] = {
 };
 
 #define OFFSET(x) offsetof(ADenormContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption adenorm_options[] = {
     { "level", "set level", OFFSET(level_db), AV_OPT_TYPE_DOUBLE, {.dbl=-351},   -451,        -90, FLAGS },
diff --git a/libavfilter/af_adrc.c b/libavfilter/af_adrc.c
index 7a7d5e0370..6202b351d0 100644
--- a/libavfilter/af_adrc.c
+++ b/libavfilter/af_adrc.c
@@ -94,7 +94,7 @@ typedef struct AudioDRCContext {
 } AudioDRCContext;
 
 #define OFFSET(x) offsetof(AudioDRCContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption adrc_options[] = {
     { "transfer",    "set the transfer expression", OFFSET(expr_str),   AV_OPT_TYPE_STRING, {.str="p"},  0,    0, FLAGS },
diff --git a/libavfilter/af_adynamicequalizer.c b/libavfilter/af_adynamicequalizer.c
index 59fdaf99b7..941186351a 100644
--- a/libavfilter/af_adynamicequalizer.c
+++ b/libavfilter/af_adynamicequalizer.c
@@ -221,7 +221,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 
 #define OFFSET(x) offsetof(AudioDynamicEqualizerContext, x)
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption adynamicequalizer_options[] = {
     { "threshold",  "set detection threshold", OFFSET(threshold),  AV_OPT_TYPE_DOUBLE, {.dbl=0},        0, 100,     FLAGS },
diff --git a/libavfilter/af_adynamicsmooth.c b/libavfilter/af_adynamicsmooth.c
index 8afe592226..935fb79420 100644
--- a/libavfilter/af_adynamicsmooth.c
+++ b/libavfilter/af_adynamicsmooth.c
@@ -101,7 +101,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(AudioDynamicSmoothContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption adynamicsmooth_options[] = {
     { "sensitivity",  "set smooth sensitivity",  OFFSET(sensitivity),  AV_OPT_TYPE_DOUBLE, {.dbl=2},     0, 1000000, FLAGS },
diff --git a/libavfilter/af_aemphasis.c b/libavfilter/af_aemphasis.c
index d808eec1ca..5444befd9a 100644
--- a/libavfilter/af_aemphasis.c
+++ b/libavfilter/af_aemphasis.c
@@ -44,7 +44,7 @@ typedef struct AudioEmphasisContext {
 } AudioEmphasisContext;
 
 #define OFFSET(x) offsetof(AudioEmphasisContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption aemphasis_options[] = {
     { "level_in",      "set input gain", OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 64, FLAGS },
diff --git a/libavfilter/af_aexciter.c b/libavfilter/af_aexciter.c
index 1f1639d24c..017dce989c 100644
--- a/libavfilter/af_aexciter.c
+++ b/libavfilter/af_aexciter.c
@@ -50,7 +50,7 @@ typedef struct AExciterContext {
 } AExciterContext;
 
 #define OFFSET(x) offsetof(AExciterContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption aexciter_options[] = {
     { "level_in",  "set level in",    OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1},           0, 64, A },
diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index 3a45873460..5652aac0d1 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -62,7 +62,7 @@ enum CurveType { NONE = -1, TRI, QSIN, ESIN, HSIN, LOG, IPAR, QUA, CUB, SQU, CBR
 
 #define OFFSET(x) offsetof(AudioFadeContext, x)
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
     static const enum AVSampleFormat sample_fmts[] = {
         AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index 96c2246074..13bf669dbf 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -161,7 +161,7 @@ typedef struct AudioFFTDeNoiseContext {
 
 #define OFFSET(x) offsetof(AudioFFTDeNoiseContext, x)
 #define AF  AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption afftdn_options[] = {
     { "noise_reduction", "set the noise reduction",OFFSET(noise_reduction), AV_OPT_TYPE_FLOAT,{.dbl = 12},   .01, 97, AFR },
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index 24f8f8cbf1..27b4667ba6 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -726,7 +726,7 @@ static int process_command(AVFilterContext *ctx,
 }
 
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 #define OFFSET(x) offsetof(AudioFIRContext, x)
 
diff --git a/libavfilter/af_afreqshift.c b/libavfilter/af_afreqshift.c
index 9a6cfd2fc1..730aec9950 100644
--- a/libavfilter/af_afreqshift.c
+++ b/libavfilter/af_afreqshift.c
@@ -345,7 +345,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(AFreqShift, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption afreqshift_options[] = {
     { "shift", "set frequency shift", OFFSET(shift), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -INT_MAX, INT_MAX, FLAGS },
diff --git a/libavfilter/af_afwtdn.c b/libavfilter/af_afwtdn.c
index fb172f26cc..0432357619 100644
--- a/libavfilter/af_afwtdn.c
+++ b/libavfilter/af_afwtdn.c
@@ -438,7 +438,7 @@ typedef struct AudioFWTDNContext {
 
 #define OFFSET(x) offsetof(AudioFWTDNContext, x)
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption afwtdn_options[] = {
     { "sigma", "set noise sigma", OFFSET(sigma), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, AFR },
diff --git a/libavfilter/af_agate.c b/libavfilter/af_agate.c
index d725485950..fc43bbae03 100644
--- a/libavfilter/af_agate.c
+++ b/libavfilter/af_agate.c
@@ -64,7 +64,7 @@ typedef struct AudioGateContext {
 } AudioGateContext;
 
 #define OFFSET(x) offsetof(AudioGateContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "level_in",  "set input level",        OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1},           0.015625,   64, A },
diff --git a/libavfilter/af_alimiter.c b/libavfilter/af_alimiter.c
index 6ccce2d7de..49c053c490 100644
--- a/libavfilter/af_alimiter.c
+++ b/libavfilter/af_alimiter.c
@@ -76,7 +76,7 @@ typedef struct AudioLimiterContext {
 } AudioLimiterContext;
 
 #define OFFSET(x) offsetof(AudioLimiterContext, x)
-#define AF AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define AF AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption alimiter_options[] = {
     { "level_in",  "set input level",  OFFSET(level_in),     AV_OPT_TYPE_DOUBLE, {.dbl=1},.015625,   64, AF },
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index ade4ef76a8..e6cfcf5b17 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -182,7 +182,7 @@ typedef struct MixContext {
 #define OFFSET(x) offsetof(MixContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
-#define T AV_OPT_FLAG_RUNTIME_PARAM
+#define T AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption amix_options[] = {
     { "inputs", "Number of inputs.",
             OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT16_MAX, A|F },
diff --git a/libavfilter/af_anlmdn.c b/libavfilter/af_anlmdn.c
index f8e4f92c47..87ce714a2a 100644
--- a/libavfilter/af_anlmdn.c
+++ b/libavfilter/af_anlmdn.c
@@ -63,7 +63,7 @@ enum OutModes {
 };
 
 #define OFFSET(x) offsetof(AudioNLMeansContext, x)
-#define AFT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption anlmdn_options[] = {
     { "strength", "set denoising strength", OFFSET(a),  AV_OPT_TYPE_FLOAT,    {.dbl=0.00001},0.00001, 10000, AFT },
diff --git a/libavfilter/af_anlms.c b/libavfilter/af_anlms.c
index e1c85da053..9f0140baad 100644
--- a/libavfilter/af_anlms.c
+++ b/libavfilter/af_anlms.c
@@ -66,7 +66,7 @@ typedef struct AudioNLMSContext {
 
 #define OFFSET(x) offsetof(AudioNLMSContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption anlms_options[] = {
     { "order",   "set the filter order",   OFFSET(order),   AV_OPT_TYPE_INT,   {.i64=256},  1, INT16_MAX, A },
diff --git a/libavfilter/af_apsyclip.c b/libavfilter/af_apsyclip.c
index b542166b56..dbf377ca7c 100644
--- a/libavfilter/af_apsyclip.c
+++ b/libavfilter/af_apsyclip.c
@@ -66,7 +66,7 @@ typedef struct AudioPsyClipContext {
 } AudioPsyClipContext;
 
 #define OFFSET(x) offsetof(AudioPsyClipContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption apsyclip_options[] = {
     { "level_in",   "set input level",         OFFSET(level_in),   AV_OPT_TYPE_DOUBLE, {.dbl=1},.015625,   64, FLAGS },
diff --git a/libavfilter/af_arls.c b/libavfilter/af_arls.c
index aab0990409..334a194e14 100644
--- a/libavfilter/af_arls.c
+++ b/libavfilter/af_arls.c
@@ -64,7 +64,7 @@ typedef struct AudioRLSContext {
 
 #define OFFSET(x) offsetof(AudioRLSContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption arls_options[] = {
     { "order",    "set the filter order",  OFFSET(order),  AV_OPT_TYPE_INT,   {.i64=16}, 1, INT16_MAX, A },
diff --git a/libavfilter/af_arnndn.c b/libavfilter/af_arnndn.c
index b29af87df9..763974b73a 100644
--- a/libavfilter/af_arnndn.c
+++ b/libavfilter/af_arnndn.c
@@ -1587,7 +1587,7 @@ static const AVFilterPad inputs[] = {
 };
 
 #define OFFSET(x) offsetof(AudioRNNContext, x)
-#define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption arnndn_options[] = {
     { "model", "set model name", OFFSET(model_name), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, AF },
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index a12e6cadf9..e83414ba62 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -38,7 +38,7 @@ typedef struct ASNSContext {
 } ASNSContext;
 
 #define OFFSET(x) offsetof(ASNSContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption asetnsamples_options[] = {
     { "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
diff --git a/libavfilter/af_asoftclip.c b/libavfilter/af_asoftclip.c
index e6483c439c..3bda305aa2 100644
--- a/libavfilter/af_asoftclip.c
+++ b/libavfilter/af_asoftclip.c
@@ -65,7 +65,7 @@ typedef struct ASoftClipContext {
 } ASoftClipContext;
 
 #define OFFSET(x) offsetof(ASoftClipContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption asoftclip_options[] = {
     { "type", "set softclip type", OFFSET(type), AV_OPT_TYPE_INT,    {.i64=0},         -1, NB_TYPES-1, A, .unit = "types" },
diff --git a/libavfilter/af_asubboost.c b/libavfilter/af_asubboost.c
index f559895418..1c314f4f5a 100644
--- a/libavfilter/af_asubboost.c
+++ b/libavfilter/af_asubboost.c
@@ -211,7 +211,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 }
 
 #define OFFSET(x) offsetof(ASubBoostContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption asubboost_options[] = {
     { "dry",      "set dry gain", OFFSET(dry_gain), AV_OPT_TYPE_DOUBLE, {.dbl=1.0},      0,   1, FLAGS },
diff --git a/libavfilter/af_asupercut.c b/libavfilter/af_asupercut.c
index 848388c520..f15ff27593 100644
--- a/libavfilter/af_asupercut.c
+++ b/libavfilter/af_asupercut.c
@@ -312,7 +312,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(ASuperCutContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption asupercut_options[] = {
     { "cutoff", "set cutoff frequency", OFFSET(cutoff), AV_OPT_TYPE_DOUBLE, {.dbl=20000}, 20000, 192000, FLAGS },
diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 3658348c45..024960e376 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -164,7 +164,7 @@ static const AVOption atempo_options[] = {
       OFFSET(tempo), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 },
       YAE_ATEMPO_MIN,
       YAE_ATEMPO_MAX,
-      AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM },
+      AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
     { NULL }
 };
 
diff --git a/libavfilter/af_atilt.c b/libavfilter/af_atilt.c
index 172e3259db..e2adf5d818 100644
--- a/libavfilter/af_atilt.c
+++ b/libavfilter/af_atilt.c
@@ -223,7 +223,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(ATiltContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption atilt_options[] = {
     { "freq",   "set central frequency",OFFSET(freq),   AV_OPT_TYPE_DOUBLE, {.dbl=10000},    20, 192000, FLAGS },
diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 21d3acf850..a9155924ee 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -1442,7 +1442,7 @@ static const AVFilterPad outputs[] = {
 };
 
 #define OFFSET(x) offsetof(BiquadsContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 #define DEFINE_BIQUAD_FILTER_2(name_, description_, priv_class_)        \
diff --git a/libavfilter/af_compensationdelay.c b/libavfilter/af_compensationdelay.c
index 924ccefe94..0308167c3c 100644
--- a/libavfilter/af_compensationdelay.c
+++ b/libavfilter/af_compensationdelay.c
@@ -40,7 +40,7 @@ typedef struct CompensationDelayContext {
 } CompensationDelayContext;
 
 #define OFFSET(x) offsetof(CompensationDelayContext, x)
-#define A (AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM)
+#define A (AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)
 
 static const AVOption compensationdelay_options[] = {
     { "mm",   "set mm distance",    OFFSET(distance_mm), AV_OPT_TYPE_INT,    {.i64=0},    0,  10, A },
diff --git a/libavfilter/af_crossfeed.c b/libavfilter/af_crossfeed.c
index 36f05cfd21..6c71095ffd 100644
--- a/libavfilter/af_crossfeed.c
+++ b/libavfilter/af_crossfeed.c
@@ -340,7 +340,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(CrossfeedContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption crossfeed_options[] = {
diff --git a/libavfilter/af_crystalizer.c b/libavfilter/af_crystalizer.c
index 01cdf8bd63..b593927c54 100644
--- a/libavfilter/af_crystalizer.c
+++ b/libavfilter/af_crystalizer.c
@@ -32,7 +32,7 @@ typedef struct CrystalizerContext {
 } CrystalizerContext;
 
 #define OFFSET(x) offsetof(CrystalizerContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption crystalizer_options[] = {
     { "i", "set intensity",    OFFSET(mult), AV_OPT_TYPE_FLOAT, {.dbl=2.0},-10, 10, A },
diff --git a/libavfilter/af_dialoguenhance.c b/libavfilter/af_dialoguenhance.c
index 76c9877238..0c4f936617 100644
--- a/libavfilter/af_dialoguenhance.c
+++ b/libavfilter/af_dialoguenhance.c
@@ -59,7 +59,7 @@ typedef struct AudioDialogueEnhancementContext {
 } AudioDialogueEnhanceContext;
 
 #define OFFSET(x) offsetof(AudioDialogueEnhanceContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption dialoguenhance_options[] = {
     { "original", "set original center factor", OFFSET(original), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index 846d62584b..999b397bba 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -125,7 +125,7 @@ typedef struct ThreadData {
 } ThreadData;
 
 #define OFFSET(x) offsetof(DynamicAudioNormalizerContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption dynaudnorm_options[] = {
     { "framelen",    "set the frame length in msec",     OFFSET(frame_len_msec),    AV_OPT_TYPE_INT,    {.i64 = 500},   10,  8000, FLAGS },
diff --git a/libavfilter/af_extrastereo.c b/libavfilter/af_extrastereo.c
index 2b1b09f9c2..aa86f8f297 100644
--- a/libavfilter/af_extrastereo.c
+++ b/libavfilter/af_extrastereo.c
@@ -31,7 +31,7 @@ typedef struct ExtraStereoContext {
 } ExtraStereoContext;
 
 #define OFFSET(x) offsetof(ExtraStereoContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption extrastereo_options[] = {
     { "m", "set the difference coefficient", OFFSET(mult), AV_OPT_TYPE_FLOAT, {.dbl=2.5}, -10, 10, A },
diff --git a/libavfilter/af_firequalizer.c b/libavfilter/af_firequalizer.c
index 5108edca48..057c283d0a 100644
--- a/libavfilter/af_firequalizer.c
+++ b/libavfilter/af_firequalizer.c
@@ -126,7 +126,7 @@ typedef struct FIREqualizerContext {
 
 #define OFFSET(x) offsetof(FIREqualizerContext, x)
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption firequalizer_options[] = {
     { "gain", "set gain curve", OFFSET(gain), AV_OPT_TYPE_STRING, { .str = "gain_interpolate(f)" }, 0, 0, TFLAGS },
diff --git a/libavfilter/af_rubberband.c b/libavfilter/af_rubberband.c
index a820ba7538..3af91b04a7 100644
--- a/libavfilter/af_rubberband.c
+++ b/libavfilter/af_rubberband.c
@@ -44,7 +44,7 @@ typedef struct RubberBandContext {
 
 #define OFFSET(x) offsetof(RubberBandContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption rubberband_options[] = {
     { "tempo",      "set tempo scale factor", OFFSET(tempo), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 100, AT },
diff --git a/libavfilter/af_sidechaincompress.c b/libavfilter/af_sidechaincompress.c
index d152a82953..2a373f811d 100644
--- a/libavfilter/af_sidechaincompress.c
+++ b/libavfilter/af_sidechaincompress.c
@@ -71,7 +71,7 @@ typedef struct SidechainCompressContext {
 #define OFFSET(x) offsetof(SidechainCompressContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
-#define R AV_OPT_FLAG_RUNTIME_PARAM
+#define R AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "level_in",  "set input gain",     OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1},        0.015625,   64, A|F|R },
diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
index eb23e78957..7c4d5b1a7c 100644
--- a/libavfilter/af_silenceremove.c
+++ b/libavfilter/af_silenceremove.c
@@ -125,7 +125,7 @@ typedef struct SilenceRemoveContext {
 
 #define OFFSET(x) offsetof(SilenceRemoveContext, x)
 #define AF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
-#define AFR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption silenceremove_options[] = {
     { "start_periods",   "set periods of silence parts to skip from start",    OFFSET(start_periods),       AV_OPT_TYPE_INT,      {.i64=0},     0,      9000, AF },
diff --git a/libavfilter/af_speechnorm.c b/libavfilter/af_speechnorm.c
index e6a8a95829..a3d7a4eeee 100644
--- a/libavfilter/af_speechnorm.c
+++ b/libavfilter/af_speechnorm.c
@@ -93,7 +93,7 @@ typedef struct SpeechNormalizerContext {
 } SpeechNormalizerContext;
 
 #define OFFSET(x) offsetof(SpeechNormalizerContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption speechnorm_options[] = {
     { "peak", "set the peak value", OFFSET(peak_value), AV_OPT_TYPE_DOUBLE, {.dbl=0.95}, 0.0, 1.0, FLAGS },
diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c
index 70d14ebe17..b490f353b0 100644
--- a/libavfilter/af_stereotools.c
+++ b/libavfilter/af_stereotools.c
@@ -58,7 +58,7 @@ typedef struct StereoToolsContext {
 } StereoToolsContext;
 
 #define OFFSET(x) offsetof(StereoToolsContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption stereotools_options[] = {
     { "level_in",    "set level in",     OFFSET(level_in),    AV_OPT_TYPE_DOUBLE, {.dbl=1},   0.015625,  64, A },
diff --git a/libavfilter/af_stereowiden.c b/libavfilter/af_stereowiden.c
index 96d77cd2ac..8eee687ed6 100644
--- a/libavfilter/af_stereowiden.c
+++ b/libavfilter/af_stereowiden.c
@@ -41,7 +41,7 @@ typedef struct StereoWidenContext {
 
 #define OFFSET(x) offsetof(StereoWidenContext, x)
 #define A  AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption stereowiden_options[] = {
     { "delay",     "set delay time",    OFFSET(delay),     AV_OPT_TYPE_FLOAT, {.dbl=20}, 1, 100, A },
diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c
index e37dddc361..c6da576b9f 100644
--- a/libavfilter/af_surround.c
+++ b/libavfilter/af_surround.c
@@ -1407,7 +1407,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(AudioSurroundContext, x)
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption surround_options[] = {
     { "chl_out",   "set output channel layout", OFFSET(out_ch_layout),          AV_OPT_TYPE_CHLAYOUT, {.str="5.1"}, 0,   0, FLAGS },
diff --git a/libavfilter/af_virtualbass.c b/libavfilter/af_virtualbass.c
index 9b9967c419..b7ee7b7c48 100644
--- a/libavfilter/af_virtualbass.c
+++ b/libavfilter/af_virtualbass.c
@@ -38,7 +38,7 @@ typedef struct AudioVirtualBassContext {
 } AudioVirtualBassContext;
 
 #define OFFSET(x) offsetof(AudioVirtualBassContext, x)
-#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption virtualbass_options[] = {
diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
index b3dd57c5e5..7b11fb1105 100644
--- a/libavfilter/af_volume.c
+++ b/libavfilter/af_volume.c
@@ -64,7 +64,7 @@ static const char *const var_names[] = {
 #define OFFSET(x) offsetof(VolumeContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
-#define T AV_OPT_FLAG_RUNTIME_PARAM
+#define T AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption volume_options[] = {
     { "volume", "set volume adjustment expression",
diff --git a/libavfilter/avf_a3dscope.c b/libavfilter/avf_a3dscope.c
index d7fe2dcb75..9bbfb78bf6 100644
--- a/libavfilter/avf_a3dscope.c
+++ b/libavfilter/avf_a3dscope.c
@@ -51,7 +51,7 @@ typedef struct Audio3dScopeContext {
 
 #define OFFSET(x) offsetof(Audio3dScopeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption a3dscope_options[] = {
     { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c
index 1b3461d91d..303e29917c 100644
--- a/libavfilter/avf_avectorscope.c
+++ b/libavfilter/avf_avectorscope.c
@@ -76,7 +76,7 @@ typedef struct AudioVectorScopeContext {
 
 #define OFFSET(x) offsetof(AudioVectorScopeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption avectorscope_options[] = {
     { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=LISSAJOUS}, 0, MODE_NB-1, TFLAGS, .unit = "mode" },
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 2dc8820184..9d5b7d7cf7 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -645,7 +645,7 @@ static const AVClass *filter_child_class_iterate(void **iter)
 
 #define OFFSET(x) offsetof(AVFilterContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption avfilter_options[] = {
     { "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS,
         { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, FLAGS, .unit = "thread_type" },
@@ -891,7 +891,7 @@ int ff_filter_process_command(AVFilterContext *ctx, const char *cmd,
 
     if (!ctx->filter->priv_class)
         return 0;
-    o = av_opt_find2(ctx->priv, cmd, NULL, AV_OPT_FLAG_RUNTIME_PARAM | AV_OPT_FLAG_FILTERING_PARAM, AV_OPT_SEARCH_CHILDREN, NULL);
+    o = av_opt_find2(ctx->priv, cmd, NULL, AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM | AV_OPT_FLAG_FILTERING_PARAM, AV_OPT_SEARCH_CHILDREN, NULL);
     if (!o)
         return AVERROR(ENOSYS);
     return av_opt_set(ctx->priv, cmd, arg, 0);
diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c
index 3996261318..6b4e4f0ba9 100644
--- a/libavfilter/f_graphmonitor.c
+++ b/libavfilter/f_graphmonitor.c
@@ -95,7 +95,7 @@ enum {
 
 #define OFFSET(x) offsetof(GraphMonitorContext, x)
 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define VFR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VFR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption graphmonitor_options[] = {
     { "size", "set monitor size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, VF },
diff --git a/libavfilter/f_perms.c b/libavfilter/f_perms.c
index 0e8c208272..576edc0648 100644
--- a/libavfilter/f_perms.c
+++ b/libavfilter/f_perms.c
@@ -45,7 +45,7 @@ typedef struct PermsContext {
 
 #define OFFSET(x) offsetof(PermsContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "mode", "select permissions mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_NONE}, MODE_NONE, NB_MODES-1, TFLAGS, .unit = "mode" },
diff --git a/libavfilter/f_realtime.c b/libavfilter/f_realtime.c
index 83793bbe15..e09dd11525 100644
--- a/libavfilter/f_realtime.c
+++ b/libavfilter/f_realtime.c
@@ -68,7 +68,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 }
 
 #define OFFSET(x) offsetof(RealtimeContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption options[] = {
     { "limit", "sleep time limit", OFFSET(limit), AV_OPT_TYPE_DURATION, { .i64 = 2000000 }, 0, INT64_MAX, FLAGS },
     { "speed", "speed factor", OFFSET(speed), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, DBL_MIN, DBL_MAX, FLAGS },
diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c
index c17b019969..f368041601 100644
--- a/libavfilter/f_streamselect.c
+++ b/libavfilter/f_streamselect.c
@@ -42,7 +42,7 @@ typedef struct StreamSelectContext {
 
 #define OFFSET(x) offsetof(StreamSelectContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption streamselect_options[] = {
     { "inputs",  "number of input streams",           OFFSET(nb_inputs),  AV_OPT_TYPE_INT,    {.i64=2},    2, INT_MAX,  .flags=FLAGS },
     { "map",     "input indexes to remap to outputs", OFFSET(map_str),    AV_OPT_TYPE_STRING, {.str=NULL},              .flags=TFLAGS },
diff --git a/libavfilter/qrencode.c b/libavfilter/qrencode.c
index 0b1f7bb50a..467aafa307 100644
--- a/libavfilter/qrencode.c
+++ b/libavfilter/qrencode.c
@@ -149,7 +149,7 @@ typedef struct QREncodeContext {
 
 #define OFFSET(x) offsetof(QREncodeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #define COMMON_OPTIONS                                                  \
     { "qrcode_width", "set rendered QR code width expression", OFFSET(rendered_qrcode_width_expr), AV_OPT_TYPE_STRING, {.str = "64"}, 0, INT_MAX, FLAGS }, \
diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c
index 60cf2b642e..bfe22c0c5e 100644
--- a/libavfilter/setpts.c
+++ b/libavfilter/setpts.c
@@ -312,7 +312,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 #define OFFSET(x) offsetof(SetPTSContext, x)
 #define V AV_OPT_FLAG_VIDEO_PARAM
 #define A AV_OPT_FLAG_AUDIO_PARAM
-#define R AV_OPT_FLAG_RUNTIME_PARAM
+#define R AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
 
 #if CONFIG_SETPTS_FILTER
diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c
index 9fd0b590c1..bed0246a1a 100644
--- a/libavfilter/src_avsynctest.c
+++ b/libavfilter/src_avsynctest.c
@@ -67,7 +67,7 @@ typedef struct AVSyncTestContext {
 #define OFFSET(x) offsetof(AVSyncTestContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 #define V AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define R AV_OPT_FLAG_RUNTIME_PARAM
+#define R AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption avsynctest_options[] = {
     {"size",       "set frame size",  OFFSET(w),            AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
diff --git a/libavfilter/vf_amplify.c b/libavfilter/vf_amplify.c
index 7f2cf81150..5eadfb4efa 100644
--- a/libavfilter/vf_amplify.c
+++ b/libavfilter/vf_amplify.c
@@ -240,7 +240,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 #define OFFSET(x) offsetof(AmplifyContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define VFT AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define VFT AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption amplify_options[] = {
     { "radius", "set radius", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=2}, 1, 63, .flags = FLAGS },
diff --git a/libavfilter/vf_atadenoise.c b/libavfilter/vf_atadenoise.c
index da132db1b6..591293edde 100644
--- a/libavfilter/vf_atadenoise.c
+++ b/libavfilter/vf_atadenoise.c
@@ -66,7 +66,7 @@ typedef struct ATADenoiseContext {
 } ATADenoiseContext;
 
 #define OFFSET(x) offsetof(ATADenoiseContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption atadenoise_options[] = {
diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c
index ced0a2ac28..a56634edc7 100644
--- a/libavfilter/vf_avgblur.c
+++ b/libavfilter/vf_avgblur.c
@@ -49,7 +49,7 @@ typedef struct AverageBlurContext {
 } AverageBlurContext;
 
 #define OFFSET(x) offsetof(AverageBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption avgblur_options[] = {
     { "sizeX",  "set horizontal size",  OFFSET(radius),  AV_OPT_TYPE_INT, {.i64=1},   1, 1024, FLAGS },
diff --git a/libavfilter/vf_backgroundkey.c b/libavfilter/vf_backgroundkey.c
index 54f7621a10..5295f77341 100644
--- a/libavfilter/vf_backgroundkey.c
+++ b/libavfilter/vf_backgroundkey.c
@@ -217,7 +217,7 @@ static const AVFilterPad backgroundkey_outputs[] = {
 };
 
 #define OFFSET(x) offsetof(BackgroundkeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption backgroundkey_options[] = {
     { "threshold",  "set the scene change threshold", OFFSET(threshold),  AV_OPT_TYPE_FLOAT, { .dbl = 0.08}, 0.0, 1.0, FLAGS },
diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c
index 02893d500d..0182c516e1 100644
--- a/libavfilter/vf_bbox.c
+++ b/libavfilter/vf_bbox.c
@@ -37,7 +37,7 @@ typedef struct BBoxContext {
 } BBoxContext;
 
 #define OFFSET(x) offsetof(BBoxContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption bbox_options[] = {
     { "min_val", "set minimum luminance value for bounding box", OFFSET(min_val), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, UINT16_MAX, FLAGS },
diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c
index 3fe7e69b9f..8b44364aba 100644
--- a/libavfilter/vf_bilateral.c
+++ b/libavfilter/vf_bilateral.c
@@ -56,7 +56,7 @@ typedef struct BilateralContext {
 } BilateralContext;
 
 #define OFFSET(x) offsetof(BilateralContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption bilateral_options[] = {
     { "sigmaS", "set spatial sigma",    OFFSET(sigmaS), AV_OPT_TYPE_FLOAT, {.dbl=0.1}, 0.0, 512, FLAGS },
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 5ea6df2e75..c6d78df1cd 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -63,7 +63,7 @@ typedef struct ThreadData {
 } ThreadData;
 
 #define OFFSET(x) offsetof(BlendContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption blend_options[] = {
     { "c0_mode", "set component #0 blend mode", OFFSET(params[0].mode), AV_OPT_TYPE_INT, {.i64=0}, 0, BLEND_NB-1, FLAGS, .unit = "mode" },
diff --git a/libavfilter/vf_cas.c b/libavfilter/vf_cas.c
index 5fa5055d76..03644c6559 100644
--- a/libavfilter/vf_cas.c
+++ b/libavfilter/vf_cas.c
@@ -255,7 +255,7 @@ static const AVFilterPad cas_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(CASContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption cas_options[] = {
     { "strength", "set the sharpening strength", OFFSET(strength), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0,  1, VF },
diff --git a/libavfilter/vf_chromakey.c b/libavfilter/vf_chromakey.c
index 9c0918bb4d..3f559b3d0f 100644
--- a/libavfilter/vf_chromakey.c
+++ b/libavfilter/vf_chromakey.c
@@ -342,7 +342,7 @@ static const AVFilterPad outputs[] = {
 };
 
 #define OFFSET(x) offsetof(ChromakeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption chromakey_options[] = {
     { "color", "set the chromakey key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS },
diff --git a/libavfilter/vf_chromanr.c b/libavfilter/vf_chromanr.c
index ff77313311..328edb3b35 100644
--- a/libavfilter/vf_chromanr.c
+++ b/libavfilter/vf_chromanr.c
@@ -261,7 +261,7 @@ static int config_input(AVFilterLink *inlink)
 }
 
 #define OFFSET(x) offsetof(ChromaNRContext, x)
-#define VF AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption chromanr_options[] = {
     { "thres", "set y+u+v threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, {.dbl=30}, 1,   200, VF },
diff --git a/libavfilter/vf_chromashift.c b/libavfilter/vf_chromashift.c
index 6c929472a7..828fa96786 100644
--- a/libavfilter/vf_chromashift.c
+++ b/libavfilter/vf_chromashift.c
@@ -356,7 +356,7 @@ static int config_input(AVFilterLink *inlink)
 }
 
 #define OFFSET(x) offsetof(ChromaShiftContext, x)
-#define VFR AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define VFR AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption chromashift_options[] = {
     { "cbh", "shift chroma-blue horizontally", OFFSET(cbh),  AV_OPT_TYPE_INT,   {.i64=0}, -255, 255, .flags = VFR },
diff --git a/libavfilter/vf_colorbalance.c b/libavfilter/vf_colorbalance.c
index 676e74c770..9c944fe702 100644
--- a/libavfilter/vf_colorbalance.c
+++ b/libavfilter/vf_colorbalance.c
@@ -56,7 +56,7 @@ typedef struct ColorBalanceContext {
 } ColorBalanceContext;
 
 #define OFFSET(x) offsetof(ColorBalanceContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption colorbalance_options[] = {
     { "rs", "set red shadows",      OFFSET(cyan_red.shadows),         AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, FLAGS },
     { "gs", "set green shadows",    OFFSET(magenta_green.shadows),    AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, FLAGS },
diff --git a/libavfilter/vf_colorchannelmixer.c b/libavfilter/vf_colorchannelmixer.c
index 006a8ee289..4cac387488 100644
--- a/libavfilter/vf_colorchannelmixer.c
+++ b/libavfilter/vf_colorchannelmixer.c
@@ -82,7 +82,7 @@ static void preservel(float *r, float *g, float *b, float lin, float lout, float
 #include "colorchannelmixer_template.c"
 
 #define OFFSET(x) offsetof(ColorChannelMixerContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colorchannelmixer_options[] = {
     { "rr", "set the red gain for the red channel",     OFFSET(rr), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -2, 2, FLAGS },
diff --git a/libavfilter/vf_colorcontrast.c b/libavfilter/vf_colorcontrast.c
index b086de71e5..8600e26790 100644
--- a/libavfilter/vf_colorcontrast.c
+++ b/libavfilter/vf_colorcontrast.c
@@ -359,7 +359,7 @@ static const AVFilterPad colorcontrast_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorContrastContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colorcontrast_options[] = {
     { "rc",  "set the red-cyan contrast",      OFFSET(rc),  AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
diff --git a/libavfilter/vf_colorcorrect.c b/libavfilter/vf_colorcorrect.c
index d86d9f1927..9025dc1c74 100644
--- a/libavfilter/vf_colorcorrect.c
+++ b/libavfilter/vf_colorcorrect.c
@@ -513,7 +513,7 @@ static const AVFilterPad colorcorrect_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorCorrectContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colorcorrect_options[] = {
     { "rl", "set the red shadow spot",              OFFSET(rl), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
diff --git a/libavfilter/vf_colorize.c b/libavfilter/vf_colorize.c
index e6c563e3e2..9267e0c431 100644
--- a/libavfilter/vf_colorize.c
+++ b/libavfilter/vf_colorize.c
@@ -260,7 +260,7 @@ static const AVFilterPad colorize_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorizeContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colorize_options[] = {
     { "hue",        "set the hue",                     OFFSET(hue),        AV_OPT_TYPE_FLOAT, {.dbl=0},  0, 360, VF },
diff --git a/libavfilter/vf_colorkey.c b/libavfilter/vf_colorkey.c
index 58dd513b31..d843c3ac7f 100644
--- a/libavfilter/vf_colorkey.c
+++ b/libavfilter/vf_colorkey.c
@@ -209,7 +209,7 @@ static const AVFilterPad colorkey_outputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorkeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #if CONFIG_COLORKEY_FILTER
 
diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index 6f54628ec5..89f95f9e94 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -54,7 +54,7 @@ typedef struct ColorLevelsContext {
 } ColorLevelsContext;
 
 #define OFFSET(x) offsetof(ColorLevelsContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption colorlevels_options[] = {
     { "rimin", "set input red black point",    OFFSET(range[R].in_min),  AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
     { "gimin", "set input green black point",  OFFSET(range[G].in_min),  AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
diff --git a/libavfilter/vf_colormap.c b/libavfilter/vf_colormap.c
index 31f33e7ebd..19f37e2ef1 100644
--- a/libavfilter/vf_colormap.c
+++ b/libavfilter/vf_colormap.c
@@ -65,7 +65,7 @@ typedef struct ColorMapContext {
 } ColorMapContext;
 
 #define OFFSET(x) offsetof(ColorMapContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colormap_options[] = {
     { "patch_size", "set patch size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "64x64"}, 0, 0, FLAGS },
diff --git a/libavfilter/vf_colortemperature.c b/libavfilter/vf_colortemperature.c
index b06b04e704..34a642b227 100644
--- a/libavfilter/vf_colortemperature.c
+++ b/libavfilter/vf_colortemperature.c
@@ -369,7 +369,7 @@ static const AVFilterPad inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorTemperatureContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colortemperature_options[] = {
     { "temperature", "set the temperature in Kelvin",          OFFSET(temperature), AV_OPT_TYPE_FLOAT, {.dbl=6500}, 1000,  40000, VF },
diff --git a/libavfilter/vf_convolution.c b/libavfilter/vf_convolution.c
index bb78e33d80..b91560c772 100644
--- a/libavfilter/vf_convolution.c
+++ b/libavfilter/vf_convolution.c
@@ -34,7 +34,7 @@
 #include "video.h"
 
 #define OFFSET(x) offsetof(ConvolutionContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption convolution_options[] = {
     { "0m", "set matrix for 1st plane", OFFSET(matrix_str[0]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 6361209941..de12e5a161 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -363,7 +363,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(CropContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption crop_options[] = {
     { "out_w",       "set the width crop area expression",   OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, 0, 0, TFLAGS },
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 486f723a4b..36834ed135 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -466,7 +466,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(CropDetectContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption cropdetect_options[] = {
     { "limit", "Threshold below which the pixel is considered black", OFFSET(limit),       AV_OPT_TYPE_FLOAT, { .dbl = 24.0/255 }, 0, 65535, TFLAGS },
diff --git a/libavfilter/vf_curves.c b/libavfilter/vf_curves.c
index 97f284db22..fa0def3715 100644
--- a/libavfilter/vf_curves.c
+++ b/libavfilter/vf_curves.c
@@ -90,7 +90,7 @@ typedef struct ThreadData {
 } ThreadData;
 
 #define OFFSET(x) offsetof(CurvesContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption curves_options[] = {
     { "preset", "select a color curves preset", OFFSET(preset), AV_OPT_TYPE_INT, {.i64=PRESET_NONE}, PRESET_NONE, NB_PRESETS-1, FLAGS, .unit = "preset_name" },
         { "none",               NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NONE},                 0, 0, FLAGS, .unit = "preset_name" },
diff --git a/libavfilter/vf_datascope.c b/libavfilter/vf_datascope.c
index 52b1939cd2..0a41ac24ee 100644
--- a/libavfilter/vf_datascope.c
+++ b/libavfilter/vf_datascope.c
@@ -55,7 +55,7 @@ typedef struct DatascopeContext {
 
 #define OFFSET(x) offsetof(DatascopeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define FLAGSR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGSR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption datascope_options[] = {
     { "size", "set output size", OFFSET(ow),   AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, FLAGS },
diff --git a/libavfilter/vf_dblur.c b/libavfilter/vf_dblur.c
index 5202c57489..5d7dba87aa 100644
--- a/libavfilter/vf_dblur.c
+++ b/libavfilter/vf_dblur.c
@@ -43,7 +43,7 @@ typedef struct DBlurContext {
 } DBlurContext;
 
 #define OFFSET(x) offsetof(DBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption dblur_options[] = {
     { "angle",  "set angle",            OFFSET(angle),  AV_OPT_TYPE_FLOAT, {.dbl=45},  0.0,  360, FLAGS },
diff --git a/libavfilter/vf_deband.c b/libavfilter/vf_deband.c
index 9888285586..e700be4b85 100644
--- a/libavfilter/vf_deband.c
+++ b/libavfilter/vf_deband.c
@@ -51,7 +51,7 @@ typedef struct DebandContext {
 } DebandContext;
 
 #define OFFSET(x) offsetof(DebandContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption deband_options[] = {
     { "1thr",      "set 1st plane threshold", OFFSET(threshold[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.02},  0.00003,     0.5, FLAGS },
diff --git a/libavfilter/vf_deblock.c b/libavfilter/vf_deblock.c
index 7e4b1799d3..6d734b3367 100644
--- a/libavfilter/vf_deblock.c
+++ b/libavfilter/vf_deblock.c
@@ -378,7 +378,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 }
 
 #define OFFSET(x) offsetof(DeblockContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption deblock_options[] = {
     { "filter",    "set type of filter",          OFFSET(filter),    AV_OPT_TYPE_INT,   {.i64=STRONG},0, 1,  FLAGS, .unit = "filter" },
diff --git a/libavfilter/vf_despill.c b/libavfilter/vf_despill.c
index 7e8ccf7fe8..e3d9d6c7df 100644
--- a/libavfilter/vf_despill.c
+++ b/libavfilter/vf_despill.c
@@ -138,7 +138,7 @@ static const AVFilterPad despill_outputs[] = {
 };
 
 #define OFFSET(x) offsetof(DespillContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption despill_options[] = {
     { "type",       "set the screen type",     OFFSET(type),        AV_OPT_TYPE_INT,     {.i64=0},     0,   1, FLAGS, .unit = "type" },
diff --git a/libavfilter/vf_displace.c b/libavfilter/vf_displace.c
index 93de62fb5c..b5a194b0ef 100644
--- a/libavfilter/vf_displace.c
+++ b/libavfilter/vf_displace.c
@@ -47,7 +47,7 @@ typedef struct DisplaceContext {
 } DisplaceContext;
 
 #define OFFSET(x) offsetof(DisplaceContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption displace_options[] = {
     { "edge", "set edge mode", OFFSET(edge), AV_OPT_TYPE_INT, {.i64=EDGE_SMEAR}, 0, EDGE_NB-1, FLAGS, .unit = "edge" },
diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
index 27739dc89f..2ad57e6972 100644
--- a/libavfilter/vf_drawbox.c
+++ b/libavfilter/vf_drawbox.c
@@ -438,7 +438,7 @@ end:
 }
 
 #define OFFSET(x) offsetof(DrawBoxContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #if CONFIG_DRAWBOX_FILTER
 
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 2b6a0d0839..f66445b340 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -331,7 +331,7 @@ typedef struct DrawTextContext {
 
 #define OFFSET(x) offsetof(DrawTextContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption drawtext_options[]= {
     {"fontfile",       "set font file",         OFFSET(fontfile),           AV_OPT_TYPE_STRING, {.str=NULL},  0, 0, FLAGS},
diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c
index 30ff976940..a20add848c 100644
--- a/libavfilter/vf_eq.c
+++ b/libavfilter/vf_eq.c
@@ -316,7 +316,7 @@ static const AVFilterPad eq_inputs[] = {
 
 #define OFFSET(x) offsetof(EQContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption eq_options[] = {
     { "contrast",     "set the contrast adjustment, negative values give a negative image",
         OFFSET(contrast_expr),     AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c
index b785c290ff..d5cb2cb10b 100644
--- a/libavfilter/vf_estdif.c
+++ b/libavfilter/vf_estdif.c
@@ -77,7 +77,7 @@ typedef struct ESTDIFContext {
 #define S     (MAX_R * 2 + 1)
 
 #define OFFSET(x) offsetof(ESTDIFContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define CONST(name, help, val, u) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, .unit = u }
 
 static const AVOption estdif_options[] = {
diff --git a/libavfilter/vf_exposure.c b/libavfilter/vf_exposure.c
index 926d784a81..7eb0f76699 100644
--- a/libavfilter/vf_exposure.c
+++ b/libavfilter/vf_exposure.c
@@ -132,7 +132,7 @@ static const AVFilterPad exposure_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ExposureContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption exposure_options[] = {
     { "exposure", "set the exposure correction",    OFFSET(exposure), AV_OPT_TYPE_FLOAT, {.dbl=0}, -3, 3, VF },
diff --git a/libavfilter/vf_feedback.c b/libavfilter/vf_feedback.c
index 2fb7d48057..4c145114ae 100644
--- a/libavfilter/vf_feedback.c
+++ b/libavfilter/vf_feedback.c
@@ -311,7 +311,7 @@ static const AVFilterPad outputs[] = {
 
 #define OFFSET(x) offsetof(FeedbackContext, x)
 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
-#define TFLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM)
+#define TFLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)
 
 static const AVOption feedback_options[] = {
     { "x", "set top left crop position", OFFSET(x), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, TFLAGS },
diff --git a/libavfilter/vf_fftdnoiz.c b/libavfilter/vf_fftdnoiz.c
index 93d068d046..406c1e54cc 100644
--- a/libavfilter/vf_fftdnoiz.c
+++ b/libavfilter/vf_fftdnoiz.c
@@ -85,7 +85,7 @@ typedef struct FFTdnoizContext {
 
 #define OFFSET(x) offsetof(FFTdnoizContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption fftdnoiz_options[] = {
     { "sigma",   "set denoise strength",
         OFFSET(sigma),      AV_OPT_TYPE_FLOAT, {.dbl=1},        0, 100, .flags = TFLAGS },
diff --git a/libavfilter/vf_fillborders.c b/libavfilter/vf_fillborders.c
index 2778cb486b..bfc6b3b3ae 100644
--- a/libavfilter/vf_fillborders.c
+++ b/libavfilter/vf_fillborders.c
@@ -675,7 +675,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 }
 
 #define OFFSET(x) offsetof(FillBordersContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption fillborders_options[] = {
     { "left",   "set the left fill border",   OFFSET(left),   AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX,    FLAGS },
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index 7dccd5946f..7940a5c8c2 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -405,7 +405,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(Frei0rContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption frei0r_options[] = {
     { "filter_name",   NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
     { "filter_params", NULL, OFFSET(params),  AV_OPT_TYPE_STRING, .flags = TFLAGS },
diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index 812fad72a3..ac38fc1348 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -38,7 +38,7 @@
 #include "video.h"
 
 #define OFFSET(x) offsetof(GBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption gblur_options[] = {
     { "sigma",  "set sigma",            OFFSET(sigma),  AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0.0, 1024, FLAGS },
diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c
index 68a1b97d1c..f9e885ee5a 100644
--- a/libavfilter/vf_guided.c
+++ b/libavfilter/vf_guided.c
@@ -77,7 +77,7 @@ typedef struct GuidedContext {
 } GuidedContext;
 
 #define OFFSET(x) offsetof(GuidedContext, x)
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption guided_options[] = {
diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c
index 9f32b943c9..6535cc7708 100644
--- a/libavfilter/vf_hqdn3d.c
+++ b/libavfilter/vf_hqdn3d.c
@@ -363,7 +363,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 }
 
 #define OFFSET(x) offsetof(HQDN3DContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption hqdn3d_options[] = {
     { "luma_spatial",   "spatial luma strength",    OFFSET(strength[LUMA_SPATIAL]),   AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0, DBL_MAX, FLAGS },
     { "chroma_spatial", "spatial chroma strength",  OFFSET(strength[CHROMA_SPATIAL]), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0, DBL_MAX, FLAGS },
diff --git a/libavfilter/vf_hsvkey.c b/libavfilter/vf_hsvkey.c
index 0bd8cace37..a499d8e15e 100644
--- a/libavfilter/vf_hsvkey.c
+++ b/libavfilter/vf_hsvkey.c
@@ -284,7 +284,7 @@ static const AVFilterPad outputs[] = {
 };
 
 #define OFFSET(x) offsetof(HSVKeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption hsvkey_options[] = {
     { "hue", "set the hue value", OFFSET(hue_opt), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, -360, 360, FLAGS },
diff --git a/libavfilter/vf_hue.c b/libavfilter/vf_hue.c
index bf390a03fc..a3417c25e3 100644
--- a/libavfilter/vf_hue.c
+++ b/libavfilter/vf_hue.c
@@ -86,7 +86,7 @@ typedef struct HueContext {
 } HueContext;
 
 #define OFFSET(x) offsetof(HueContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption hue_options[] = {
     { "h", "set the hue angle degrees expression", OFFSET(hue_deg_expr), AV_OPT_TYPE_STRING,
       { .str = NULL }, .flags = FLAGS },
diff --git a/libavfilter/vf_huesaturation.c b/libavfilter/vf_huesaturation.c
index bea13deca9..91b3662f70 100644
--- a/libavfilter/vf_huesaturation.c
+++ b/libavfilter/vf_huesaturation.c
@@ -434,7 +434,7 @@ static const AVFilterPad huesaturation_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(HueSaturationContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption huesaturation_options[] = {
     { "hue",        "set the hue shift",               OFFSET(hue),        AV_OPT_TYPE_FLOAT, {.dbl=0},-180, 180, VF },
diff --git a/libavfilter/vf_il.c b/libavfilter/vf_il.c
index 5eaa40a6f8..1a783f21a1 100644
--- a/libavfilter/vf_il.c
+++ b/libavfilter/vf_il.c
@@ -48,7 +48,7 @@ typedef struct IlContext {
 } IlContext;
 
 #define OFFSET(x) offsetof(IlContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption il_options[] = {
     {"luma_mode",   "select luma mode", OFFSET(luma_mode), AV_OPT_TYPE_INT, {.i64=MODE_NONE}, MODE_NONE, MODE_DEINTERLEAVE, FLAGS, .unit = "luma_mode"},
diff --git a/libavfilter/vf_lagfun.c b/libavfilter/vf_lagfun.c
index 4d7496c3eb..2d5fdc0cd9 100644
--- a/libavfilter/vf_lagfun.c
+++ b/libavfilter/vf_lagfun.c
@@ -192,7 +192,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(LagfunContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption lagfun_options[] = {
     { "decay",  "set decay",                 OFFSET(decay),  AV_OPT_TYPE_FLOAT, {.dbl=.95},  0,  1,  FLAGS },
diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c
index 06ab662b5f..d59bc5d6a3 100644
--- a/libavfilter/vf_lenscorrection.c
+++ b/libavfilter/vf_lenscorrection.c
@@ -53,7 +53,7 @@ typedef struct LenscorrectionCtx {
 } LenscorrectionCtx;
 
 #define OFFSET(x) offsetof(LenscorrectionCtx, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption lenscorrection_options[] = {
     { "cx", "set relative center x", OFFSET(cx), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 1, .flags=FLAGS },
     { "cy", "set relative center y", OFFSET(cy), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 1, .flags=FLAGS },
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index be9000aa8e..8c009e50f0 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -1265,7 +1265,7 @@ fail:
 
 #define OFFSET(x) offsetof(LibplaceboContext, x)
 #define STATIC (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
-#define DYNAMIC (STATIC | AV_OPT_FLAG_RUNTIME_PARAM)
+#define DYNAMIC (STATIC | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)
 
 static const AVOption libplacebo_options[] = {
     { "inputs", "Number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, .flags = STATIC },
diff --git a/libavfilter/vf_limitdiff.c b/libavfilter/vf_limitdiff.c
index 1e903d45a8..f8b430bfcd 100644
--- a/libavfilter/vf_limitdiff.c
+++ b/libavfilter/vf_limitdiff.c
@@ -52,7 +52,7 @@ typedef struct LimitDiffContext {
 } LimitDiffContext;
 
 #define OFFSET(x) offsetof(LimitDiffContext, x)
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
 static const AVOption limitdiff_options[] = {
diff --git a/libavfilter/vf_limiter.c b/libavfilter/vf_limiter.c
index f67f590d60..7a32600616 100644
--- a/libavfilter/vf_limiter.c
+++ b/libavfilter/vf_limiter.c
@@ -45,7 +45,7 @@ typedef struct LimiterContext {
 } LimiterContext;
 
 #define OFFSET(x) offsetof(LimiterContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption limiter_options[] = {
     { "min",    "set min value", OFFSET(min),    AV_OPT_TYPE_INT, {.i64=0},     0, 65535, .flags = FLAGS },
diff --git a/libavfilter/vf_lumakey.c b/libavfilter/vf_lumakey.c
index d426a5b67a..fc6c57056a 100644
--- a/libavfilter/vf_lumakey.c
+++ b/libavfilter/vf_lumakey.c
@@ -173,7 +173,7 @@ static const AVFilterPad lumakey_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(LumakeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption lumakey_options[] = {
     { "threshold", "set the threshold value", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl=0},    0, 1, FLAGS },
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index 01df8f287d..754b732c36 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -83,7 +83,7 @@ typedef struct LutContext {
 #define A 3
 
 #define OFFSET(x) offsetof(LutContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]),  AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS },
diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index 1f0661a0f5..93e6b39f0c 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -81,7 +81,7 @@ typedef struct ThreadData {
 
 #define OFFSET(x) offsetof(LUT2Context, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]),  AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS },
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index d8ceb2a424..c394a64aa4 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -46,7 +46,7 @@
 
 #define OFFSET(x) offsetof(LUT3DContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define COMMON_OPTIONS \
     { "interp", "select interpolation mode", OFFSET(interpolation), AV_OPT_TYPE_INT, {.i64=INTERPOLATE_TETRAHEDRAL}, 0, NB_INTERP_MODE-1, TFLAGS, .unit = "interp_mode" }, \
         { "nearest",     "use values from the nearest defined points",            0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_NEAREST},     0, 0, TFLAGS, .unit = "interp_mode" }, \
diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c
index e6fbb1a6d5..a1ab17d88c 100644
--- a/libavfilter/vf_maskedclamp.c
+++ b/libavfilter/vf_maskedclamp.c
@@ -28,7 +28,7 @@
 #include "maskedclamp.h"
 
 #define OFFSET(x) offsetof(MaskedClampContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 typedef struct ThreadData {
     AVFrame *b, *o, *m, *d;
diff --git a/libavfilter/vf_maskedmerge.c b/libavfilter/vf_maskedmerge.c
index 4ca0c571c8..18ea1dfe09 100644
--- a/libavfilter/vf_maskedmerge.c
+++ b/libavfilter/vf_maskedmerge.c
@@ -27,7 +27,7 @@
 #include "maskedmerge.h"
 
 #define OFFSET(x) offsetof(MaskedMergeContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption maskedmerge_options[] = {
     { "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
diff --git a/libavfilter/vf_maskedminmax.c b/libavfilter/vf_maskedminmax.c
index b1c309cc7d..639cc7d1e7 100644
--- a/libavfilter/vf_maskedminmax.c
+++ b/libavfilter/vf_maskedminmax.c
@@ -27,7 +27,7 @@
 #include "framesync.h"
 
 #define OFFSET(x) offsetof(MaskedMinMaxContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 typedef struct ThreadData {
     AVFrame *src, *f1, *f2, *dst;
diff --git a/libavfilter/vf_maskedthreshold.c b/libavfilter/vf_maskedthreshold.c
index e78e11810e..577183cb22 100644
--- a/libavfilter/vf_maskedthreshold.c
+++ b/libavfilter/vf_maskedthreshold.c
@@ -43,7 +43,7 @@ typedef struct MaskedThresholdContext {
 } MaskedThresholdContext;
 
 #define OFFSET(x) offsetof(MaskedThresholdContext, x)
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
 typedef struct ThreadData {
diff --git a/libavfilter/vf_maskfun.c b/libavfilter/vf_maskfun.c
index 1ac152fc8b..c770bcf805 100644
--- a/libavfilter/vf_maskfun.c
+++ b/libavfilter/vf_maskfun.c
@@ -48,7 +48,7 @@ typedef struct MaskFunContext {
 } MaskFunContext;
 
 #define OFFSET(x) offsetof(MaskFunContext, x)
-#define VFT AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VFT AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption maskfun_options[] = {
     { "low",    "set low threshold",  OFFSET(low),    AV_OPT_TYPE_INT, {.i64=10},  0, UINT16_MAX, VFT },
diff --git a/libavfilter/vf_median.c b/libavfilter/vf_median.c
index 5ed787af5e..f314741cde 100644
--- a/libavfilter/vf_median.c
+++ b/libavfilter/vf_median.c
@@ -53,7 +53,7 @@
 #include "median_template.c"
 
 #define OFFSET(x) offsetof(MedianContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption median_options[] = {
     { "radius", "set median radius",    OFFSET(radius), AV_OPT_TYPE_INT,   {.i64=1},     1,  127, FLAGS },
diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c
index bfbdc2c83e..2924639bb3 100644
--- a/libavfilter/vf_mix.c
+++ b/libavfilter/vf_mix.c
@@ -430,7 +430,7 @@ static int activate(AVFilterContext *ctx)
 
 #define OFFSET(x) offsetof(MixContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption mix_options[] = {
     { "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT16_MAX, .flags = FLAGS },
diff --git a/libavfilter/vf_monochrome.c b/libavfilter/vf_monochrome.c
index 05c001707a..11bc49fe26 100644
--- a/libavfilter/vf_monochrome.c
+++ b/libavfilter/vf_monochrome.c
@@ -268,7 +268,7 @@ static const AVFilterPad monochrome_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(MonochromeContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption monochrome_options[] = {
     { "cb",   "set the chroma blue spot",    OFFSET(b),    AV_OPT_TYPE_FLOAT, {.dbl=0},-1, 1, VF },
diff --git a/libavfilter/vf_morpho.c b/libavfilter/vf_morpho.c
index ce0f01c9c0..a38510feb7 100644
--- a/libavfilter/vf_morpho.c
+++ b/libavfilter/vf_morpho.c
@@ -126,7 +126,7 @@ typedef struct MorphoContext {
 } MorphoContext;
 
 #define OFFSET(x) offsetof(MorphoContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption morpho_options[] = {
     { "mode",  "set morphological transform",                 OFFSET(mode),       AV_OPT_TYPE_INT,   {.i64=0}, 0, NB_MODES-1, FLAGS, .unit = "mode" },
diff --git a/libavfilter/vf_multiply.c b/libavfilter/vf_multiply.c
index 54fbeff483..e0b5d64d45 100644
--- a/libavfilter/vf_multiply.c
+++ b/libavfilter/vf_multiply.c
@@ -40,7 +40,7 @@ typedef struct MultiplyContext {
 } MultiplyContext;
 
 #define OFFSET(x) offsetof(MultiplyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 typedef struct ThreadData {
     AVFrame *src, *ref, *dst;
diff --git a/libavfilter/vf_negate.c b/libavfilter/vf_negate.c
index 40c0c2608b..4a8cfad7c5 100644
--- a/libavfilter/vf_negate.c
+++ b/libavfilter/vf_negate.c
@@ -59,7 +59,7 @@ typedef struct NegateContext {
 } NegateContext;
 
 #define OFFSET(x) offsetof(NegateContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption negate_options[] = {
     { "components", "set components to negate",  OFFSET(requested_components), AV_OPT_TYPE_FLAGS, {.i64=0x77}, 1, 0xff, FLAGS, .unit = "flags"},
diff --git a/libavfilter/vf_neighbor.c b/libavfilter/vf_neighbor.c
index 915347d6ba..aed562e4ca 100644
--- a/libavfilter/vf_neighbor.c
+++ b/libavfilter/vf_neighbor.c
@@ -341,7 +341,7 @@ static const AVFilterPad neighbor_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(NContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #define DEFINE_NEIGHBOR_FILTER(name_, description_, priv_class_) \
 const AVFilter ff_vf_##name_ = {                                   \
diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c
index 2168c5dbc5..78703e9735 100644
--- a/libavfilter/vf_nnedi.c
+++ b/libavfilter/vf_nnedi.c
@@ -115,7 +115,7 @@ typedef struct NNEDIContext {
 } NNEDIContext;
 
 #define OFFSET(x) offsetof(NNEDIContext, x)
-#define RFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define RFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption nnedi_options[] = {
diff --git a/libavfilter/vf_normalize.c b/libavfilter/vf_normalize.c
index 337c37f0ab..c6ddeb0832 100644
--- a/libavfilter/vf_normalize.c
+++ b/libavfilter/vf_normalize.c
@@ -123,7 +123,7 @@ typedef struct NormalizeContext {
 
 #define OFFSET(x) offsetof(NormalizeContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define FLAGSR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGSR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption normalize_options[] = {
     { "blackpt",  "output color to which darkest input color is mapped",  OFFSET(blackpt), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGSR },
diff --git a/libavfilter/vf_phase.c b/libavfilter/vf_phase.c
index 4fd6d2b6e5..4a70a9ad31 100644
--- a/libavfilter/vf_phase.c
+++ b/libavfilter/vf_phase.c
@@ -73,7 +73,7 @@ typedef struct PhaseContext {
 } PhaseContext;
 
 #define OFFSET(x) offsetof(PhaseContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define CONST(name, help, val, u) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, .unit = u }
 
 static const AVOption phase_options[] = {
diff --git a/libavfilter/vf_pixelize.c b/libavfilter/vf_pixelize.c
index 4eb236f121..e968248b7b 100644
--- a/libavfilter/vf_pixelize.c
+++ b/libavfilter/vf_pixelize.c
@@ -303,7 +303,7 @@ fail:
 }
 
 #define OFFSET(x) offsetof(PixelizeContext, x)
-#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM)
+#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)
 
 static const AVOption pixelize_options[] = {
     { "width",  "set block width",  OFFSET(block_w[0]), AV_OPT_TYPE_INT, {.i64=16}, 1, 1024, FLAGS },
diff --git a/libavfilter/vf_pseudocolor.c b/libavfilter/vf_pseudocolor.c
index cfdfac7842..60bfff0ffe 100644
--- a/libavfilter/vf_pseudocolor.c
+++ b/libavfilter/vf_pseudocolor.c
@@ -334,7 +334,7 @@ typedef struct PseudoColorContext {
 } PseudoColorContext;
 
 #define OFFSET(x) offsetof(PseudoColorContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption pseudocolor_options[] = {
     { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, {.str="val"},   .flags = FLAGS },
diff --git a/libavfilter/vf_readeia608.c b/libavfilter/vf_readeia608.c
index 7fb143cde0..3a6c233916 100644
--- a/libavfilter/vf_readeia608.c
+++ b/libavfilter/vf_readeia608.c
@@ -86,7 +86,7 @@ typedef struct ReadEIA608Context {
 } ReadEIA608Context;
 
 #define OFFSET(x) offsetof(ReadEIA608Context, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption readeia608_options[] = {
     { "scan_min", "set from which line to scan for codes",               OFFSET(start), AV_OPT_TYPE_INT,   {.i64=0},     0, INT_MAX, FLAGS },
diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c
index 3e65f26552..c16215094d 100644
--- a/libavfilter/vf_rotate.c
+++ b/libavfilter/vf_rotate.c
@@ -94,7 +94,7 @@ typedef struct ThreadData {
 
 #define OFFSET(x) offsetof(RotContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption rotate_options[] = {
     { "angle",     "set angle (in radians)",       OFFSET(angle_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags=TFLAGS },
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 841075193e..5d4600bde3 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -1180,7 +1180,7 @@ static void *child_next(void *obj, void *prev)
 
 #define OFFSET(x) offsetof(ScaleContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption scale_options[] = {
     { "w",     "Output video width",          OFFSET(w_expr),    AV_OPT_TYPE_STRING,        .flags = TFLAGS },
diff --git a/libavfilter/vf_scroll.c b/libavfilter/vf_scroll.c
index eebf12e902..eefb02bbdd 100644
--- a/libavfilter/vf_scroll.c
+++ b/libavfilter/vf_scroll.c
@@ -171,7 +171,7 @@ static int config_input(AVFilterLink *inlink)
 
 #define OFFSET(x) offsetof(ScrollContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption scroll_options[] = {
     { "horizontal", "set the horizontal scrolling speed", OFFSET(h_speed), AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., VFT },
diff --git a/libavfilter/vf_shear.c b/libavfilter/vf_shear.c
index 5008db3f46..dc82b7a23e 100644
--- a/libavfilter/vf_shear.c
+++ b/libavfilter/vf_shear.c
@@ -57,7 +57,7 @@ typedef struct ThreadData {
 } ThreadData;
 
 #define OFFSET(x) offsetof(ShearContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption shear_options[] = {
     { "shx",       "set x shear factor",        OFFSET(shx),           AV_OPT_TYPE_FLOAT,  {.dbl=0.},     -2, 2, .flags=FLAGS },
diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c
index d6c7297985..e935336193 100644
--- a/libavfilter/vf_spp.c
+++ b/libavfilter/vf_spp.c
@@ -63,7 +63,7 @@ static void *child_next(void *obj, void *prev)
 
 #define OFFSET(x) offsetof(SPPContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption spp_options[] = {
     { "quality", "set quality", OFFSET(log2_count), AV_OPT_TYPE_INT, {.i64 = 3}, 0, MAX_LEVEL, TFLAGS },
     { "qp", "force a constant quantizer parameter", OFFSET(qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, FLAGS },
diff --git a/libavfilter/vf_swaprect.c b/libavfilter/vf_swaprect.c
index 54400f0304..1ff0d3f751 100644
--- a/libavfilter/vf_swaprect.c
+++ b/libavfilter/vf_swaprect.c
@@ -43,7 +43,7 @@ typedef struct SwapRectContext {
 } SwapRectContext;
 
 #define OFFSET(x) offsetof(SwapRectContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption swaprect_options[] = {
     { "w",  "set rect width",                     OFFSET(w),  AV_OPT_TYPE_STRING, {.str="w/2"}, 0, 0, .flags = FLAGS },
     { "h",  "set rect height",                    OFFSET(h),  AV_OPT_TYPE_STRING, {.str="h/2"}, 0, 0, .flags = FLAGS },
diff --git a/libavfilter/vf_threshold.c b/libavfilter/vf_threshold.c
index dc73c277d3..61e81dd7b9 100644
--- a/libavfilter/vf_threshold.c
+++ b/libavfilter/vf_threshold.c
@@ -35,7 +35,7 @@
 #include "vf_threshold_init.h"
 
 #define OFFSET(x) offsetof(ThresholdContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption threshold_options[] = {
     { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT,  {.i64=15}, 0, 15, FLAGS},
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 299dbe9ff5..dcf1f7d305 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -52,7 +52,7 @@ typedef struct ThreadData {
 
 #define OFFSET(x) offsetof(V360Context, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption v360_options[] = {
     {     "input", "set input projection",              OFFSET(in), AV_OPT_TYPE_INT,    {.i64=EQUIRECTANGULAR}, 0,    NB_PROJECTIONS-1, FLAGS, .unit = "in" },
diff --git a/libavfilter/vf_varblur.c b/libavfilter/vf_varblur.c
index 7a022099e9..a3b05c76f7 100644
--- a/libavfilter/vf_varblur.c
+++ b/libavfilter/vf_varblur.c
@@ -61,7 +61,7 @@ typedef struct VarBlurContext {
 } VarBlurContext;
 
 #define OFFSET(x) offsetof(VarBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption varblur_options[] = {
     { "min_r",  "set min blur radius",  OFFSET(min_radius), AV_OPT_TYPE_INT,   {.i64=0},     0, 254, FLAGS },
diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index a1f98ece68..9842544424 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -85,7 +85,7 @@ typedef struct VectorscopeContext {
 
 #define OFFSET(x) offsetof(VectorscopeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption vectorscope_options[] = {
     { "mode", "set vectorscope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, MODE_NB-1, FLAGS, .unit = "mode"},
diff --git a/libavfilter/vf_vibrance.c b/libavfilter/vf_vibrance.c
index e1d6e64aeb..41b4301d0e 100644
--- a/libavfilter/vf_vibrance.c
+++ b/libavfilter/vf_vibrance.c
@@ -416,7 +416,7 @@ static const AVFilterPad vibrance_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(VibranceContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption vibrance_options[] = {
     { "intensity", "set the intensity value",   OFFSET(intensity),  AV_OPT_TYPE_FLOAT, {.dbl=0},       -2,  2, VF },
diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index a5a9cdd5cb..a9ca0da3fe 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -51,7 +51,7 @@ typedef struct W3FDIFContext {
 } W3FDIFContext;
 
 #define OFFSET(x) offsetof(W3FDIFContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define CONST(name, help, val, u) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, .unit = u }
 
 static const AVOption w3fdif_options[] = {
diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
index f45b445443..395485120b 100644
--- a/libavfilter/vf_waveform.c
+++ b/libavfilter/vf_waveform.c
@@ -136,7 +136,7 @@ typedef struct WaveformContext {
 
 #define OFFSET(x) offsetof(WaveformContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption waveform_options[] = {
     { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, .unit = "mode" },
diff --git a/libavfilter/vf_xmedian.c b/libavfilter/vf_xmedian.c
index 4e83b48843..02a2d54912 100644
--- a/libavfilter/vf_xmedian.c
+++ b/libavfilter/vf_xmedian.c
@@ -62,7 +62,7 @@ typedef struct XMedianContext {
 
 #define OFFSET(x) offsetof(XMedianContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const enum AVPixelFormat pixel_fmts[] = {
     AV_PIX_FMT_GRAY8,
diff --git a/libavfilter/vf_yaepblur.c b/libavfilter/vf_yaepblur.c
index 9b5ec0348f..efa4bcf53f 100644
--- a/libavfilter/vf_yaepblur.c
+++ b/libavfilter/vf_yaepblur.c
@@ -312,7 +312,7 @@ static const AVFilterPad yaep_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(YAEPContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption yaepblur_options[] = {
     { "radius", "set window radius",    OFFSET(radius), AV_OPT_TYPE_INT, {.i64=3},   0, INT_MAX, .flags=FLAGS },
diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c
index 45f1bd25ce..ed5db283ed 100644
--- a/libavfilter/vf_zscale.c
+++ b/libavfilter/vf_zscale.c
@@ -984,7 +984,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(ZScaleContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption zscale_options[] = {
     { "w",      "Output video width",  OFFSET(w_expr),    AV_OPT_TYPE_STRING, .flags = TFLAGS },
diff --git a/libavfilter/vsrc_gradients.c b/libavfilter/vsrc_gradients.c
index 567a4a311d..ba7e2ca3f6 100644
--- a/libavfilter/vsrc_gradients.c
+++ b/libavfilter/vsrc_gradients.c
@@ -53,7 +53,7 @@ typedef struct GradientsContext {
 
 #define OFFSET(x) offsetof(GradientsContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption gradients_options[] = {
     {"size",      "set frame size", OFFSET(w),             AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"},  0, 0, FLAGS },
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 4dc12c8a01..2e46a5fcd5 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -99,7 +99,7 @@ typedef struct TestSourceContext {
 
 #define OFFSET(x) offsetof(TestSourceContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define FLAGSR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGSR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #define SIZE_OPTIONS \
     { "size",     "set video size",     OFFSET(w),        AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS },\
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 32a9e059e3..97286b95df 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1604,7 +1604,7 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
                (opt->flags & AV_OPT_FLAG_EXPORT)          ? 'X' : '.',
                (opt->flags & AV_OPT_FLAG_READONLY)        ? 'R' : '.',
                (opt->flags & AV_OPT_FLAG_BSF_PARAM)       ? 'B' : '.',
-               (opt->flags & AV_OPT_FLAG_RUNTIME_PARAM)   ? 'T' : '.',
+               (opt->flags & AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)   ? 'T' : '.',
                (opt->flags & AV_OPT_FLAG_DEPRECATED)      ? 'P' : '.');
 
         if (opt->help)
diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c
index 02b3ed6e90..a0c98e499c 100644
--- a/libavutil/tests/opt.c
+++ b/libavutil/tests/opt.c
@@ -115,9 +115,9 @@ static const AVOption test_options[]= {
     {"bool3",      "set boolean value",  OFFSET(bool3),          AV_OPT_TYPE_BOOL,           { .i64 = 0 },                      0,         1, 1 },
     {"dict1",      "set dictionary value", OFFSET(dict1),        AV_OPT_TYPE_DICT,           { .str = NULL},                    0,         0, 1 },
     {"dict2",      "set dictionary value", OFFSET(dict2),        AV_OPT_TYPE_DICT,           { .str = "happy=':-)'"},           0,         0, 1 },
-    {"array_int",  "array of ints",        OFFSET(array_int),    AV_OPT_TYPE_INT | AV_OPT_TYPE_FLAG_ARRAY, .max = INT_MAX,           .flags = AV_OPT_FLAG_RUNTIME_PARAM },
-    {"array_str",  "array of strings",     OFFSET(array_str),    AV_OPT_TYPE_STRING | AV_OPT_TYPE_FLAG_ARRAY, { .arr = &array_str }, .flags = AV_OPT_FLAG_RUNTIME_PARAM },
-    {"array_dict", "array of dicts",       OFFSET(array_dict),   AV_OPT_TYPE_DICT | AV_OPT_TYPE_FLAG_ARRAY, { .arr = &array_dict },  .flags = AV_OPT_FLAG_RUNTIME_PARAM },
+    {"array_int",  "array of ints",        OFFSET(array_int),    AV_OPT_TYPE_INT | AV_OPT_TYPE_FLAG_ARRAY, .max = INT_MAX,           .flags = AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
+    {"array_str",  "array of strings",     OFFSET(array_str),    AV_OPT_TYPE_STRING | AV_OPT_TYPE_FLAG_ARRAY, { .arr = &array_str }, .flags = AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
+    {"array_dict", "array of dicts",       OFFSET(array_dict),   AV_OPT_TYPE_DICT | AV_OPT_TYPE_FLAG_ARRAY, { .arr = &array_dict },  .flags = AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
     { NULL },
 };
 
-- 
2.45.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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-06-16 17:08           ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
                               ` (2 preceding siblings ...)
  2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 3/3] all: s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g Andrew Sayers
@ 2024-06-16 17:22             ` Paul B Mahol
  2024-07-01 22:26             ` Stefano Sabatini
  4 siblings, 0 replies; 38+ messages in thread
From: Paul B Mahol @ 2024-06-16 17:22 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Pointless. Commit log spam.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-06-16 17:08           ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
                               ` (3 preceding siblings ...)
  2024-06-16 17:22             ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Paul B Mahol
@ 2024-07-01 22:26             ` Stefano Sabatini
  4 siblings, 0 replies; 38+ messages in thread
From: Stefano Sabatini @ 2024-07-01 22:26 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On date Sunday 2024-06-16 18:08:28 +0100, Andrew Sayers wrote:

> AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM is fine by me, here's a patch.
> I've added a "@deprecated" comment for the old name, but would this
> need to be queued up for 8.0?  Technically this is a backwards-incompatible
> change to the existing API, even though it doesn't change the ABI or generate
> warnings when compiling code.

Correct, but we can deprecate and keep the old symbols until the next
major bump.

[...]
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM
  2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
@ 2024-07-01 22:33               ` Stefano Sabatini
  2024-07-02  3:58                 ` Zhao Zhili
  2024-07-02  9:08                 ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
  0 siblings, 2 replies; 38+ messages in thread
From: Stefano Sabatini @ 2024-07-01 22:33 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andrew Sayers

On date Sunday 2024-06-16 18:08:29 +0100, Andrew Sayers wrote:
> The old name could be misread as the opposite of "AV_OPT_FLAG_READONLY" -
> some things can be set at runtime, others are read-only.  Clarify that
> this refers to options that can be set after the struct is initialized.
> ---
>  libavutil/opt.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/opt.h b/libavutil/opt.h
> index 07e27a9208..e050d126ed 100644
> --- a/libavutil/opt.h
> +++ b/libavutil/opt.h
> @@ -53,6 +53,9 @@
>   * question is allowed to access the field. This allows us to extend the
>   * semantics of those fields without breaking API compatibility.
>   *
> + * Note: only options with the AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be
> + * modified after the struct is initialized.
> + *
>   * @section avoptions_scope Scope of AVOptions
>   *
>   * AVOptions is designed to support any set of multimedia configuration options
> @@ -300,7 +303,12 @@ enum AVOptionType{
>  #define AV_OPT_FLAG_BSF_PARAM       (1 << 8)
>  
>  /**
> - * A generic parameter which can be set by the user at runtime.
> + * A generic parameter which can be set by the user after the struct is initialized.
> + */
> +#define AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM   (1 << 15)

This needs to be dropped at the next bump.

1. define in libavutil/version.h

#define FF_API_OPT_FLAG_RUNTIME_PARAM  (LIBAVUTIL_VERSION_MAJOR < 60)

2. ifdef to automatically drop this at the next bump

#if FF_API_OPT_FLAG_RUNTIME_PARAM
/**
 * A generic parameter which can be set by the user after the struct is initialized.
 * @deprecated Renamed to AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM for clarity
  */
#define AV_OPT_FLAG_RUNTIME_PARAM   (1 << 15)
#endif

3. add a note to doc/APIchanges for the new symbol.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM
  2024-07-01 22:33               ` Stefano Sabatini
@ 2024-07-02  3:58                 ` Zhao Zhili
  2024-07-06  9:47                   ` Stefano Sabatini
  2024-07-02  9:08                 ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
  1 sibling, 1 reply; 38+ messages in thread
From: Zhao Zhili @ 2024-07-02  3:58 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


> 在 2024年7月2日,上午6:33,Stefano Sabatini <stefasab@gmail.com> 写道:
> 
> On date Sunday 2024-06-16 18:08:29 +0100, Andrew Sayers wrote:
>> The old name could be misread as the opposite of "AV_OPT_FLAG_READONLY" -
>> some things can be set at runtime, others are read-only.  Clarify that
>> this refers to options that can be set after the struct is initialized.

Let’s not bother the user again and again for little benefit. Add doc is fine, please don’t rename the flag.

>> ---
>> libavutil/opt.h | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/libavutil/opt.h b/libavutil/opt.h
>> index 07e27a9208..e050d126ed 100644
>> --- a/libavutil/opt.h
>> +++ b/libavutil/opt.h
>> @@ -53,6 +53,9 @@
>>  * question is allowed to access the field. This allows us to extend the
>>  * semantics of those fields without breaking API compatibility.
>>  *
>> + * Note: only options with the AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be
>> + * modified after the struct is initialized.
>> + *
>>  * @section avoptions_scope Scope of AVOptions
>>  *
>>  * AVOptions is designed to support any set of multimedia configuration options
>> @@ -300,7 +303,12 @@ enum AVOptionType{
>> #define AV_OPT_FLAG_BSF_PARAM       (1 << 8)
>> 
>> /**
>> - * A generic parameter which can be set by the user at runtime.
>> + * A generic parameter which can be set by the user after the struct is initialized.
>> + */
>> +#define AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM   (1 << 15)
> 
> This needs to be dropped at the next bump.
> 
> 1. define in libavutil/version.h
> 
> #define FF_API_OPT_FLAG_RUNTIME_PARAM  (LIBAVUTIL_VERSION_MAJOR < 60)
> 
> 2. ifdef to automatically drop this at the next bump
> 
> #if FF_API_OPT_FLAG_RUNTIME_PARAM
> /**
> * A generic parameter which can be set by the user after the struct is initialized.
> * @deprecated Renamed to AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM for clarity
>  */
> #define AV_OPT_FLAG_RUNTIME_PARAM   (1 << 15)
> #endif
> 
> 3. add a note to doc/APIchanges for the new symbol.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-07-01 22:33               ` Stefano Sabatini
  2024-07-02  3:58                 ` Zhao Zhili
@ 2024-07-02  9:08                 ` Andrew Sayers
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
                                     ` (3 more replies)
  1 sibling, 4 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-07-02  9:08 UTC (permalink / raw)
  To: ffmpeg-devel

Some notes about this version:

As previously mentioned, I think this is better with all three patches,
but can live without #2.
  
I think I've followed the deprecation instructions, but editing APIchanges
seems to imply needing a minor version bump?  This patch includes said bump.

Zhao Zhili argued this bothers users for too little benefit -
I'd argue it's beneficial to confirm they haven't misused this feature
in a way that causes bugs in their code, but the old deprecation message
didn't make that clear enough.  This version rephrases the @deprecated message
to speak directly to the maintainer.

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM
  2024-07-02  9:08                 ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
@ 2024-07-02  9:08                   ` Andrew Sayers
  2024-07-02  9:49                     ` Anton Khirnov
  2024-07-06  9:50                     ` Stefano Sabatini
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places Andrew Sayers
                                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-07-02  9:08 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

The old name could be misread as the opposite of "AV_OPT_FLAG_READONLY" -
some things can be set at runtime, others are read-only.  Clarify that
this refers to options that can be set after the struct is initialized.
---
 doc/APIchanges      |  4 ++++
 libavutil/opt.h     | 15 ++++++++++++++-
 libavutil/version.h |  3 ++-
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index f1828436e5..8217c391cb 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2024-03-07
 
 API changes, most recent first:
 
+2024-07-02 - xxxxxxxxxx - lavu 59.28.100 - opt.h
+  Deprecate AV_OPT_FLAG_RUNTIME_PARAM and replace it with
+  AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM.
+
 2024-06-28 - xxxxxxxxxx - lavu 59.27.100 - stereo3d.h
   Add AV_STEREO3D_UNSPEC and AV_STEREO3D_VIEW_UNSPEC.
 
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 07e27a9208..b78c3406fa 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -53,6 +53,9 @@
  * question is allowed to access the field. This allows us to extend the
  * semantics of those fields without breaking API compatibility.
  *
+ * Note: only options with the AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM flag can be
+ * modified after the struct is initialized.
+ *
  * @section avoptions_scope Scope of AVOptions
  *
  * AVOptions is designed to support any set of multimedia configuration options
@@ -300,9 +303,19 @@ enum AVOptionType{
 #define AV_OPT_FLAG_BSF_PARAM       (1 << 8)
 
 /**
- * A generic parameter which can be set by the user at runtime.
+ * A generic parameter which can be set by the user after the struct is initialized.
+ */
+#define AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM   (1 << 15)
+#if FF_API_OPT_FLAG_RUNTIME_PARAM
+/**
+ * A generic parameter which can be set by the user after the struct is initialized.
+ *
+ * @deprecated Renamed for clarity - to continue using this feature,
+ * please do s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g
+ * throughout your codebase
  */
 #define AV_OPT_FLAG_RUNTIME_PARAM   (1 << 15)
+#endif
 /**
  * A generic parameter which can be set by the user for filtering.
  */
diff --git a/libavutil/version.h b/libavutil/version.h
index a8962734e7..c03681f802 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  59
-#define LIBAVUTIL_VERSION_MINOR  27
+#define LIBAVUTIL_VERSION_MINOR  28
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -113,6 +113,7 @@
 #define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60)
 #define FF_API_H274_FILM_GRAIN_VCS      (LIBAVUTIL_VERSION_MAJOR < 60)
 #define FF_API_MOD_UINTP2               (LIBAVUTIL_VERSION_MAJOR < 60)
+#define FF_API_OPT_FLAG_RUNTIME_PARAM   (LIBAVUTIL_VERSION_MAJOR < 60)
 
 /**
  * @}
-- 
2.45.2

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places
  2024-07-02  9:08                 ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
@ 2024-07-02  9:08                   ` Andrew Sayers
  2024-07-02  9:52                     ` Anton Khirnov
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 3/3] all: s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g Andrew Sayers
  2024-07-06  9:37                   ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Stefano Sabatini
  3 siblings, 1 reply; 38+ messages in thread
From: Andrew Sayers @ 2024-07-02  9:08 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

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
-- 
2.45.2

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH v4 3/3] all: s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g
  2024-07-02  9:08                 ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places Andrew Sayers
@ 2024-07-02  9:08                   ` Andrew Sayers
  2024-07-06  9:37                   ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Stefano Sabatini
  3 siblings, 0 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-07-02  9:08 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

Use the new name for the macro throughout the codebase.

Patch generated with the following command:

sed -i -e 's/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g' \
    $( git grep -l AV_OPT_FLAG_RUNTIME_PARAM | grep -v '^libavutil/opt.h' | grep -v '^doc/APIchanges$' )
---
 libavfilter/af_aap.c               | 2 +-
 libavfilter/af_acrusher.c          | 2 +-
 libavfilter/af_adelay.c            | 2 +-
 libavfilter/af_adenorm.c           | 2 +-
 libavfilter/af_adrc.c              | 2 +-
 libavfilter/af_adynamicequalizer.c | 2 +-
 libavfilter/af_adynamicsmooth.c    | 2 +-
 libavfilter/af_aemphasis.c         | 2 +-
 libavfilter/af_aexciter.c          | 2 +-
 libavfilter/af_afade.c             | 2 +-
 libavfilter/af_afftdn.c            | 2 +-
 libavfilter/af_afir.c              | 2 +-
 libavfilter/af_afreqshift.c        | 2 +-
 libavfilter/af_afwtdn.c            | 2 +-
 libavfilter/af_agate.c             | 2 +-
 libavfilter/af_alimiter.c          | 2 +-
 libavfilter/af_amix.c              | 2 +-
 libavfilter/af_anlmdn.c            | 2 +-
 libavfilter/af_anlms.c             | 2 +-
 libavfilter/af_apsyclip.c          | 2 +-
 libavfilter/af_arls.c              | 2 +-
 libavfilter/af_arnndn.c            | 2 +-
 libavfilter/af_asetnsamples.c      | 2 +-
 libavfilter/af_asoftclip.c         | 2 +-
 libavfilter/af_asubboost.c         | 2 +-
 libavfilter/af_asupercut.c         | 2 +-
 libavfilter/af_atempo.c            | 2 +-
 libavfilter/af_atilt.c             | 2 +-
 libavfilter/af_biquads.c           | 2 +-
 libavfilter/af_compensationdelay.c | 2 +-
 libavfilter/af_crossfeed.c         | 2 +-
 libavfilter/af_crystalizer.c       | 2 +-
 libavfilter/af_dialoguenhance.c    | 2 +-
 libavfilter/af_dynaudnorm.c        | 2 +-
 libavfilter/af_extrastereo.c       | 2 +-
 libavfilter/af_firequalizer.c      | 2 +-
 libavfilter/af_rubberband.c        | 2 +-
 libavfilter/af_sidechaincompress.c | 2 +-
 libavfilter/af_silenceremove.c     | 2 +-
 libavfilter/af_speechnorm.c        | 2 +-
 libavfilter/af_stereotools.c       | 2 +-
 libavfilter/af_stereowiden.c       | 2 +-
 libavfilter/af_surround.c          | 2 +-
 libavfilter/af_virtualbass.c       | 2 +-
 libavfilter/af_volume.c            | 2 +-
 libavfilter/avf_a3dscope.c         | 2 +-
 libavfilter/avf_avectorscope.c     | 2 +-
 libavfilter/avfilter.c             | 4 ++--
 libavfilter/f_graphmonitor.c       | 2 +-
 libavfilter/f_perms.c              | 2 +-
 libavfilter/f_realtime.c           | 2 +-
 libavfilter/f_streamselect.c       | 2 +-
 libavfilter/qrencode.c             | 2 +-
 libavfilter/setpts.c               | 2 +-
 libavfilter/src_avsynctest.c       | 2 +-
 libavfilter/vf_amplify.c           | 2 +-
 libavfilter/vf_atadenoise.c        | 2 +-
 libavfilter/vf_avgblur.c           | 2 +-
 libavfilter/vf_backgroundkey.c     | 2 +-
 libavfilter/vf_bbox.c              | 2 +-
 libavfilter/vf_bilateral.c         | 2 +-
 libavfilter/vf_blend.c             | 2 +-
 libavfilter/vf_cas.c               | 2 +-
 libavfilter/vf_chromakey.c         | 2 +-
 libavfilter/vf_chromanr.c          | 2 +-
 libavfilter/vf_chromashift.c       | 2 +-
 libavfilter/vf_colorbalance.c      | 2 +-
 libavfilter/vf_colorchannelmixer.c | 2 +-
 libavfilter/vf_colorcontrast.c     | 2 +-
 libavfilter/vf_colorcorrect.c      | 2 +-
 libavfilter/vf_colorize.c          | 2 +-
 libavfilter/vf_colorkey.c          | 2 +-
 libavfilter/vf_colorlevels.c       | 2 +-
 libavfilter/vf_colormap.c          | 2 +-
 libavfilter/vf_colortemperature.c  | 2 +-
 libavfilter/vf_convolution.c       | 2 +-
 libavfilter/vf_crop.c              | 2 +-
 libavfilter/vf_cropdetect.c        | 2 +-
 libavfilter/vf_curves.c            | 2 +-
 libavfilter/vf_datascope.c         | 2 +-
 libavfilter/vf_dblur.c             | 2 +-
 libavfilter/vf_deband.c            | 2 +-
 libavfilter/vf_deblock.c           | 2 +-
 libavfilter/vf_despill.c           | 2 +-
 libavfilter/vf_displace.c          | 2 +-
 libavfilter/vf_drawbox.c           | 2 +-
 libavfilter/vf_drawtext.c          | 2 +-
 libavfilter/vf_eq.c                | 2 +-
 libavfilter/vf_estdif.c            | 2 +-
 libavfilter/vf_exposure.c          | 2 +-
 libavfilter/vf_feedback.c          | 2 +-
 libavfilter/vf_fftdnoiz.c          | 2 +-
 libavfilter/vf_fillborders.c       | 2 +-
 libavfilter/vf_frei0r.c            | 2 +-
 libavfilter/vf_gblur.c             | 2 +-
 libavfilter/vf_guided.c            | 2 +-
 libavfilter/vf_hqdn3d.c            | 2 +-
 libavfilter/vf_hsvkey.c            | 2 +-
 libavfilter/vf_hue.c               | 2 +-
 libavfilter/vf_huesaturation.c     | 2 +-
 libavfilter/vf_il.c                | 2 +-
 libavfilter/vf_lagfun.c            | 2 +-
 libavfilter/vf_lenscorrection.c    | 2 +-
 libavfilter/vf_libplacebo.c        | 2 +-
 libavfilter/vf_limitdiff.c         | 2 +-
 libavfilter/vf_limiter.c           | 2 +-
 libavfilter/vf_lumakey.c           | 2 +-
 libavfilter/vf_lut.c               | 2 +-
 libavfilter/vf_lut2.c              | 2 +-
 libavfilter/vf_lut3d.c             | 2 +-
 libavfilter/vf_maskedclamp.c       | 2 +-
 libavfilter/vf_maskedmerge.c       | 2 +-
 libavfilter/vf_maskedminmax.c      | 2 +-
 libavfilter/vf_maskedthreshold.c   | 2 +-
 libavfilter/vf_maskfun.c           | 2 +-
 libavfilter/vf_median.c            | 2 +-
 libavfilter/vf_mix.c               | 2 +-
 libavfilter/vf_monochrome.c        | 2 +-
 libavfilter/vf_morpho.c            | 2 +-
 libavfilter/vf_multiply.c          | 2 +-
 libavfilter/vf_negate.c            | 2 +-
 libavfilter/vf_neighbor.c          | 2 +-
 libavfilter/vf_nnedi.c             | 2 +-
 libavfilter/vf_normalize.c         | 2 +-
 libavfilter/vf_phase.c             | 2 +-
 libavfilter/vf_pixelize.c          | 2 +-
 libavfilter/vf_pseudocolor.c       | 2 +-
 libavfilter/vf_readeia608.c        | 2 +-
 libavfilter/vf_rotate.c            | 2 +-
 libavfilter/vf_scale.c             | 2 +-
 libavfilter/vf_scroll.c            | 2 +-
 libavfilter/vf_shear.c             | 2 +-
 libavfilter/vf_spp.c               | 2 +-
 libavfilter/vf_swaprect.c          | 2 +-
 libavfilter/vf_threshold.c         | 2 +-
 libavfilter/vf_v360.c              | 2 +-
 libavfilter/vf_varblur.c           | 2 +-
 libavfilter/vf_vectorscope.c       | 2 +-
 libavfilter/vf_vibrance.c          | 2 +-
 libavfilter/vf_w3fdif.c            | 2 +-
 libavfilter/vf_waveform.c          | 2 +-
 libavfilter/vf_xmedian.c           | 2 +-
 libavfilter/vf_yaepblur.c          | 2 +-
 libavfilter/vf_zscale.c            | 2 +-
 libavfilter/vsrc_gradients.c       | 2 +-
 libavfilter/vsrc_testsrc.c         | 2 +-
 libavutil/opt.c                    | 2 +-
 libavutil/tests/opt.c              | 6 +++---
 148 files changed, 151 insertions(+), 151 deletions(-)

diff --git a/libavfilter/af_aap.c b/libavfilter/af_aap.c
index e4cd6f8281..50e80be2a5 100644
--- a/libavfilter/af_aap.c
+++ b/libavfilter/af_aap.c
@@ -74,7 +74,7 @@ typedef struct AudioAPContext {
 
 #define OFFSET(x) offsetof(AudioAPContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption aap_options[] = {
     { "order",      "set the filter order",      OFFSET(order),       AV_OPT_TYPE_INT,   {.i64=16},   1, INT16_MAX, A },
diff --git a/libavfilter/af_acrusher.c b/libavfilter/af_acrusher.c
index 48d7029b05..6b4eef884d 100644
--- a/libavfilter/af_acrusher.c
+++ b/libavfilter/af_acrusher.c
@@ -69,7 +69,7 @@ typedef struct ACrusherContext {
 } ACrusherContext;
 
 #define OFFSET(x) offsetof(ACrusherContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption acrusher_options[] = {
     { "level_in", "set level in",         OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1},    0.015625, 64, A },
diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c
index 8c4d4db287..5082f34a83 100644
--- a/libavfilter/af_adelay.c
+++ b/libavfilter/af_adelay.c
@@ -59,7 +59,7 @@ typedef struct AudioDelayContext {
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption adelay_options[] = {
-    { "delays", "set list of delays for each channel", OFFSET(delays), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A | AV_OPT_FLAG_RUNTIME_PARAM },
+    { "delays", "set list of delays for each channel", OFFSET(delays), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
     { "all",    "use last available delay for remained channels", OFFSET(all), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
     { NULL }
 };
diff --git a/libavfilter/af_adenorm.c b/libavfilter/af_adenorm.c
index f5f9039172..ccd6a621b8 100644
--- a/libavfilter/af_adenorm.c
+++ b/libavfilter/af_adenorm.c
@@ -248,7 +248,7 @@ static const AVFilterPad adenorm_outputs[] = {
 };
 
 #define OFFSET(x) offsetof(ADenormContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption adenorm_options[] = {
     { "level", "set level", OFFSET(level_db), AV_OPT_TYPE_DOUBLE, {.dbl=-351},   -451,        -90, FLAGS },
diff --git a/libavfilter/af_adrc.c b/libavfilter/af_adrc.c
index 7a7d5e0370..6202b351d0 100644
--- a/libavfilter/af_adrc.c
+++ b/libavfilter/af_adrc.c
@@ -94,7 +94,7 @@ typedef struct AudioDRCContext {
 } AudioDRCContext;
 
 #define OFFSET(x) offsetof(AudioDRCContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption adrc_options[] = {
     { "transfer",    "set the transfer expression", OFFSET(expr_str),   AV_OPT_TYPE_STRING, {.str="p"},  0,    0, FLAGS },
diff --git a/libavfilter/af_adynamicequalizer.c b/libavfilter/af_adynamicequalizer.c
index 59fdaf99b7..941186351a 100644
--- a/libavfilter/af_adynamicequalizer.c
+++ b/libavfilter/af_adynamicequalizer.c
@@ -221,7 +221,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 
 #define OFFSET(x) offsetof(AudioDynamicEqualizerContext, x)
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption adynamicequalizer_options[] = {
     { "threshold",  "set detection threshold", OFFSET(threshold),  AV_OPT_TYPE_DOUBLE, {.dbl=0},        0, 100,     FLAGS },
diff --git a/libavfilter/af_adynamicsmooth.c b/libavfilter/af_adynamicsmooth.c
index 8afe592226..935fb79420 100644
--- a/libavfilter/af_adynamicsmooth.c
+++ b/libavfilter/af_adynamicsmooth.c
@@ -101,7 +101,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(AudioDynamicSmoothContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption adynamicsmooth_options[] = {
     { "sensitivity",  "set smooth sensitivity",  OFFSET(sensitivity),  AV_OPT_TYPE_DOUBLE, {.dbl=2},     0, 1000000, FLAGS },
diff --git a/libavfilter/af_aemphasis.c b/libavfilter/af_aemphasis.c
index d808eec1ca..5444befd9a 100644
--- a/libavfilter/af_aemphasis.c
+++ b/libavfilter/af_aemphasis.c
@@ -44,7 +44,7 @@ typedef struct AudioEmphasisContext {
 } AudioEmphasisContext;
 
 #define OFFSET(x) offsetof(AudioEmphasisContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption aemphasis_options[] = {
     { "level_in",      "set input gain", OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 64, FLAGS },
diff --git a/libavfilter/af_aexciter.c b/libavfilter/af_aexciter.c
index 1f1639d24c..017dce989c 100644
--- a/libavfilter/af_aexciter.c
+++ b/libavfilter/af_aexciter.c
@@ -50,7 +50,7 @@ typedef struct AExciterContext {
 } AExciterContext;
 
 #define OFFSET(x) offsetof(AExciterContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption aexciter_options[] = {
     { "level_in",  "set level in",    OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1},           0, 64, A },
diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index c79271ec92..10a9b532fa 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -62,7 +62,7 @@ enum CurveType { NONE = -1, TRI, QSIN, ESIN, HSIN, LOG, IPAR, QUA, CUB, SQU, CBR
 
 #define OFFSET(x) offsetof(AudioFadeContext, x)
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
     static const enum AVSampleFormat sample_fmts[] = {
         AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index 96c2246074..13bf669dbf 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -161,7 +161,7 @@ typedef struct AudioFFTDeNoiseContext {
 
 #define OFFSET(x) offsetof(AudioFFTDeNoiseContext, x)
 #define AF  AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption afftdn_options[] = {
     { "noise_reduction", "set the noise reduction",OFFSET(noise_reduction), AV_OPT_TYPE_FLOAT,{.dbl = 12},   .01, 97, AFR },
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index 24f8f8cbf1..27b4667ba6 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -726,7 +726,7 @@ static int process_command(AVFilterContext *ctx,
 }
 
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 #define OFFSET(x) offsetof(AudioFIRContext, x)
 
diff --git a/libavfilter/af_afreqshift.c b/libavfilter/af_afreqshift.c
index 9a6cfd2fc1..730aec9950 100644
--- a/libavfilter/af_afreqshift.c
+++ b/libavfilter/af_afreqshift.c
@@ -345,7 +345,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(AFreqShift, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption afreqshift_options[] = {
     { "shift", "set frequency shift", OFFSET(shift), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -INT_MAX, INT_MAX, FLAGS },
diff --git a/libavfilter/af_afwtdn.c b/libavfilter/af_afwtdn.c
index fb172f26cc..0432357619 100644
--- a/libavfilter/af_afwtdn.c
+++ b/libavfilter/af_afwtdn.c
@@ -438,7 +438,7 @@ typedef struct AudioFWTDNContext {
 
 #define OFFSET(x) offsetof(AudioFWTDNContext, x)
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption afwtdn_options[] = {
     { "sigma", "set noise sigma", OFFSET(sigma), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, AFR },
diff --git a/libavfilter/af_agate.c b/libavfilter/af_agate.c
index d725485950..fc43bbae03 100644
--- a/libavfilter/af_agate.c
+++ b/libavfilter/af_agate.c
@@ -64,7 +64,7 @@ typedef struct AudioGateContext {
 } AudioGateContext;
 
 #define OFFSET(x) offsetof(AudioGateContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "level_in",  "set input level",        OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1},           0.015625,   64, A },
diff --git a/libavfilter/af_alimiter.c b/libavfilter/af_alimiter.c
index 6ccce2d7de..49c053c490 100644
--- a/libavfilter/af_alimiter.c
+++ b/libavfilter/af_alimiter.c
@@ -76,7 +76,7 @@ typedef struct AudioLimiterContext {
 } AudioLimiterContext;
 
 #define OFFSET(x) offsetof(AudioLimiterContext, x)
-#define AF AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define AF AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption alimiter_options[] = {
     { "level_in",  "set input level",  OFFSET(level_in),     AV_OPT_TYPE_DOUBLE, {.dbl=1},.015625,   64, AF },
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index ade4ef76a8..e6cfcf5b17 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -182,7 +182,7 @@ typedef struct MixContext {
 #define OFFSET(x) offsetof(MixContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
-#define T AV_OPT_FLAG_RUNTIME_PARAM
+#define T AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption amix_options[] = {
     { "inputs", "Number of inputs.",
             OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT16_MAX, A|F },
diff --git a/libavfilter/af_anlmdn.c b/libavfilter/af_anlmdn.c
index f8e4f92c47..87ce714a2a 100644
--- a/libavfilter/af_anlmdn.c
+++ b/libavfilter/af_anlmdn.c
@@ -63,7 +63,7 @@ enum OutModes {
 };
 
 #define OFFSET(x) offsetof(AudioNLMeansContext, x)
-#define AFT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption anlmdn_options[] = {
     { "strength", "set denoising strength", OFFSET(a),  AV_OPT_TYPE_FLOAT,    {.dbl=0.00001},0.00001, 10000, AFT },
diff --git a/libavfilter/af_anlms.c b/libavfilter/af_anlms.c
index e1c85da053..9f0140baad 100644
--- a/libavfilter/af_anlms.c
+++ b/libavfilter/af_anlms.c
@@ -66,7 +66,7 @@ typedef struct AudioNLMSContext {
 
 #define OFFSET(x) offsetof(AudioNLMSContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption anlms_options[] = {
     { "order",   "set the filter order",   OFFSET(order),   AV_OPT_TYPE_INT,   {.i64=256},  1, INT16_MAX, A },
diff --git a/libavfilter/af_apsyclip.c b/libavfilter/af_apsyclip.c
index b542166b56..dbf377ca7c 100644
--- a/libavfilter/af_apsyclip.c
+++ b/libavfilter/af_apsyclip.c
@@ -66,7 +66,7 @@ typedef struct AudioPsyClipContext {
 } AudioPsyClipContext;
 
 #define OFFSET(x) offsetof(AudioPsyClipContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption apsyclip_options[] = {
     { "level_in",   "set input level",         OFFSET(level_in),   AV_OPT_TYPE_DOUBLE, {.dbl=1},.015625,   64, FLAGS },
diff --git a/libavfilter/af_arls.c b/libavfilter/af_arls.c
index aab0990409..334a194e14 100644
--- a/libavfilter/af_arls.c
+++ b/libavfilter/af_arls.c
@@ -64,7 +64,7 @@ typedef struct AudioRLSContext {
 
 #define OFFSET(x) offsetof(AudioRLSContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption arls_options[] = {
     { "order",    "set the filter order",  OFFSET(order),  AV_OPT_TYPE_INT,   {.i64=16}, 1, INT16_MAX, A },
diff --git a/libavfilter/af_arnndn.c b/libavfilter/af_arnndn.c
index b29af87df9..763974b73a 100644
--- a/libavfilter/af_arnndn.c
+++ b/libavfilter/af_arnndn.c
@@ -1587,7 +1587,7 @@ static const AVFilterPad inputs[] = {
 };
 
 #define OFFSET(x) offsetof(AudioRNNContext, x)
-#define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption arnndn_options[] = {
     { "model", "set model name", OFFSET(model_name), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, AF },
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index a12e6cadf9..e83414ba62 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -38,7 +38,7 @@ typedef struct ASNSContext {
 } ASNSContext;
 
 #define OFFSET(x) offsetof(ASNSContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption asetnsamples_options[] = {
     { "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
diff --git a/libavfilter/af_asoftclip.c b/libavfilter/af_asoftclip.c
index e6483c439c..3bda305aa2 100644
--- a/libavfilter/af_asoftclip.c
+++ b/libavfilter/af_asoftclip.c
@@ -65,7 +65,7 @@ typedef struct ASoftClipContext {
 } ASoftClipContext;
 
 #define OFFSET(x) offsetof(ASoftClipContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption asoftclip_options[] = {
     { "type", "set softclip type", OFFSET(type), AV_OPT_TYPE_INT,    {.i64=0},         -1, NB_TYPES-1, A, .unit = "types" },
diff --git a/libavfilter/af_asubboost.c b/libavfilter/af_asubboost.c
index f559895418..1c314f4f5a 100644
--- a/libavfilter/af_asubboost.c
+++ b/libavfilter/af_asubboost.c
@@ -211,7 +211,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 }
 
 #define OFFSET(x) offsetof(ASubBoostContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption asubboost_options[] = {
     { "dry",      "set dry gain", OFFSET(dry_gain), AV_OPT_TYPE_DOUBLE, {.dbl=1.0},      0,   1, FLAGS },
diff --git a/libavfilter/af_asupercut.c b/libavfilter/af_asupercut.c
index 848388c520..f15ff27593 100644
--- a/libavfilter/af_asupercut.c
+++ b/libavfilter/af_asupercut.c
@@ -312,7 +312,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(ASuperCutContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption asupercut_options[] = {
     { "cutoff", "set cutoff frequency", OFFSET(cutoff), AV_OPT_TYPE_DOUBLE, {.dbl=20000}, 20000, 192000, FLAGS },
diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 3658348c45..024960e376 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -164,7 +164,7 @@ static const AVOption atempo_options[] = {
       OFFSET(tempo), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 },
       YAE_ATEMPO_MIN,
       YAE_ATEMPO_MAX,
-      AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM },
+      AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
     { NULL }
 };
 
diff --git a/libavfilter/af_atilt.c b/libavfilter/af_atilt.c
index 172e3259db..e2adf5d818 100644
--- a/libavfilter/af_atilt.c
+++ b/libavfilter/af_atilt.c
@@ -223,7 +223,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(ATiltContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption atilt_options[] = {
     { "freq",   "set central frequency",OFFSET(freq),   AV_OPT_TYPE_DOUBLE, {.dbl=10000},    20, 192000, FLAGS },
diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 21d3acf850..a9155924ee 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -1442,7 +1442,7 @@ static const AVFilterPad outputs[] = {
 };
 
 #define OFFSET(x) offsetof(BiquadsContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 #define DEFINE_BIQUAD_FILTER_2(name_, description_, priv_class_)        \
diff --git a/libavfilter/af_compensationdelay.c b/libavfilter/af_compensationdelay.c
index 924ccefe94..0308167c3c 100644
--- a/libavfilter/af_compensationdelay.c
+++ b/libavfilter/af_compensationdelay.c
@@ -40,7 +40,7 @@ typedef struct CompensationDelayContext {
 } CompensationDelayContext;
 
 #define OFFSET(x) offsetof(CompensationDelayContext, x)
-#define A (AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM)
+#define A (AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)
 
 static const AVOption compensationdelay_options[] = {
     { "mm",   "set mm distance",    OFFSET(distance_mm), AV_OPT_TYPE_INT,    {.i64=0},    0,  10, A },
diff --git a/libavfilter/af_crossfeed.c b/libavfilter/af_crossfeed.c
index 36f05cfd21..6c71095ffd 100644
--- a/libavfilter/af_crossfeed.c
+++ b/libavfilter/af_crossfeed.c
@@ -340,7 +340,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(CrossfeedContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption crossfeed_options[] = {
diff --git a/libavfilter/af_crystalizer.c b/libavfilter/af_crystalizer.c
index 01cdf8bd63..b593927c54 100644
--- a/libavfilter/af_crystalizer.c
+++ b/libavfilter/af_crystalizer.c
@@ -32,7 +32,7 @@ typedef struct CrystalizerContext {
 } CrystalizerContext;
 
 #define OFFSET(x) offsetof(CrystalizerContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption crystalizer_options[] = {
     { "i", "set intensity",    OFFSET(mult), AV_OPT_TYPE_FLOAT, {.dbl=2.0},-10, 10, A },
diff --git a/libavfilter/af_dialoguenhance.c b/libavfilter/af_dialoguenhance.c
index 76c9877238..0c4f936617 100644
--- a/libavfilter/af_dialoguenhance.c
+++ b/libavfilter/af_dialoguenhance.c
@@ -59,7 +59,7 @@ typedef struct AudioDialogueEnhancementContext {
 } AudioDialogueEnhanceContext;
 
 #define OFFSET(x) offsetof(AudioDialogueEnhanceContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption dialoguenhance_options[] = {
     { "original", "set original center factor", OFFSET(original), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index 846d62584b..999b397bba 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -125,7 +125,7 @@ typedef struct ThreadData {
 } ThreadData;
 
 #define OFFSET(x) offsetof(DynamicAudioNormalizerContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption dynaudnorm_options[] = {
     { "framelen",    "set the frame length in msec",     OFFSET(frame_len_msec),    AV_OPT_TYPE_INT,    {.i64 = 500},   10,  8000, FLAGS },
diff --git a/libavfilter/af_extrastereo.c b/libavfilter/af_extrastereo.c
index 2b1b09f9c2..aa86f8f297 100644
--- a/libavfilter/af_extrastereo.c
+++ b/libavfilter/af_extrastereo.c
@@ -31,7 +31,7 @@ typedef struct ExtraStereoContext {
 } ExtraStereoContext;
 
 #define OFFSET(x) offsetof(ExtraStereoContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption extrastereo_options[] = {
     { "m", "set the difference coefficient", OFFSET(mult), AV_OPT_TYPE_FLOAT, {.dbl=2.5}, -10, 10, A },
diff --git a/libavfilter/af_firequalizer.c b/libavfilter/af_firequalizer.c
index 5108edca48..057c283d0a 100644
--- a/libavfilter/af_firequalizer.c
+++ b/libavfilter/af_firequalizer.c
@@ -126,7 +126,7 @@ typedef struct FIREqualizerContext {
 
 #define OFFSET(x) offsetof(FIREqualizerContext, x)
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption firequalizer_options[] = {
     { "gain", "set gain curve", OFFSET(gain), AV_OPT_TYPE_STRING, { .str = "gain_interpolate(f)" }, 0, 0, TFLAGS },
diff --git a/libavfilter/af_rubberband.c b/libavfilter/af_rubberband.c
index a820ba7538..3af91b04a7 100644
--- a/libavfilter/af_rubberband.c
+++ b/libavfilter/af_rubberband.c
@@ -44,7 +44,7 @@ typedef struct RubberBandContext {
 
 #define OFFSET(x) offsetof(RubberBandContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption rubberband_options[] = {
     { "tempo",      "set tempo scale factor", OFFSET(tempo), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 100, AT },
diff --git a/libavfilter/af_sidechaincompress.c b/libavfilter/af_sidechaincompress.c
index d152a82953..2a373f811d 100644
--- a/libavfilter/af_sidechaincompress.c
+++ b/libavfilter/af_sidechaincompress.c
@@ -71,7 +71,7 @@ typedef struct SidechainCompressContext {
 #define OFFSET(x) offsetof(SidechainCompressContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
-#define R AV_OPT_FLAG_RUNTIME_PARAM
+#define R AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "level_in",  "set input gain",     OFFSET(level_in),  AV_OPT_TYPE_DOUBLE, {.dbl=1},        0.015625,   64, A|F|R },
diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
index eb23e78957..7c4d5b1a7c 100644
--- a/libavfilter/af_silenceremove.c
+++ b/libavfilter/af_silenceremove.c
@@ -125,7 +125,7 @@ typedef struct SilenceRemoveContext {
 
 #define OFFSET(x) offsetof(SilenceRemoveContext, x)
 #define AF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM
-#define AFR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AFR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption silenceremove_options[] = {
     { "start_periods",   "set periods of silence parts to skip from start",    OFFSET(start_periods),       AV_OPT_TYPE_INT,      {.i64=0},     0,      9000, AF },
diff --git a/libavfilter/af_speechnorm.c b/libavfilter/af_speechnorm.c
index e6a8a95829..a3d7a4eeee 100644
--- a/libavfilter/af_speechnorm.c
+++ b/libavfilter/af_speechnorm.c
@@ -93,7 +93,7 @@ typedef struct SpeechNormalizerContext {
 } SpeechNormalizerContext;
 
 #define OFFSET(x) offsetof(SpeechNormalizerContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption speechnorm_options[] = {
     { "peak", "set the peak value", OFFSET(peak_value), AV_OPT_TYPE_DOUBLE, {.dbl=0.95}, 0.0, 1.0, FLAGS },
diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c
index 70d14ebe17..b490f353b0 100644
--- a/libavfilter/af_stereotools.c
+++ b/libavfilter/af_stereotools.c
@@ -58,7 +58,7 @@ typedef struct StereoToolsContext {
 } StereoToolsContext;
 
 #define OFFSET(x) offsetof(StereoToolsContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption stereotools_options[] = {
     { "level_in",    "set level in",     OFFSET(level_in),    AV_OPT_TYPE_DOUBLE, {.dbl=1},   0.015625,  64, A },
diff --git a/libavfilter/af_stereowiden.c b/libavfilter/af_stereowiden.c
index 96d77cd2ac..8eee687ed6 100644
--- a/libavfilter/af_stereowiden.c
+++ b/libavfilter/af_stereowiden.c
@@ -41,7 +41,7 @@ typedef struct StereoWidenContext {
 
 #define OFFSET(x) offsetof(StereoWidenContext, x)
 #define A  AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption stereowiden_options[] = {
     { "delay",     "set delay time",    OFFSET(delay),     AV_OPT_TYPE_FLOAT, {.dbl=20}, 1, 100, A },
diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c
index e37dddc361..c6da576b9f 100644
--- a/libavfilter/af_surround.c
+++ b/libavfilter/af_surround.c
@@ -1407,7 +1407,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(AudioSurroundContext, x)
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption surround_options[] = {
     { "chl_out",   "set output channel layout", OFFSET(out_ch_layout),          AV_OPT_TYPE_CHLAYOUT, {.str="5.1"}, 0,   0, FLAGS },
diff --git a/libavfilter/af_virtualbass.c b/libavfilter/af_virtualbass.c
index 9b9967c419..b7ee7b7c48 100644
--- a/libavfilter/af_virtualbass.c
+++ b/libavfilter/af_virtualbass.c
@@ -38,7 +38,7 @@ typedef struct AudioVirtualBassContext {
 } AudioVirtualBassContext;
 
 #define OFFSET(x) offsetof(AudioVirtualBassContext, x)
-#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption virtualbass_options[] = {
diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
index b3dd57c5e5..7b11fb1105 100644
--- a/libavfilter/af_volume.c
+++ b/libavfilter/af_volume.c
@@ -64,7 +64,7 @@ static const char *const var_names[] = {
 #define OFFSET(x) offsetof(VolumeContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
-#define T AV_OPT_FLAG_RUNTIME_PARAM
+#define T AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption volume_options[] = {
     { "volume", "set volume adjustment expression",
diff --git a/libavfilter/avf_a3dscope.c b/libavfilter/avf_a3dscope.c
index d7fe2dcb75..9bbfb78bf6 100644
--- a/libavfilter/avf_a3dscope.c
+++ b/libavfilter/avf_a3dscope.c
@@ -51,7 +51,7 @@ typedef struct Audio3dScopeContext {
 
 #define OFFSET(x) offsetof(Audio3dScopeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption a3dscope_options[] = {
     { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c
index 1b3461d91d..303e29917c 100644
--- a/libavfilter/avf_avectorscope.c
+++ b/libavfilter/avf_avectorscope.c
@@ -76,7 +76,7 @@ typedef struct AudioVectorScopeContext {
 
 #define OFFSET(x) offsetof(AudioVectorScopeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption avectorscope_options[] = {
     { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=LISSAJOUS}, 0, MODE_NB-1, TFLAGS, .unit = "mode" },
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 2dc8820184..9d5b7d7cf7 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -645,7 +645,7 @@ static const AVClass *filter_child_class_iterate(void **iter)
 
 #define OFFSET(x) offsetof(AVFilterContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption avfilter_options[] = {
     { "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS,
         { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, FLAGS, .unit = "thread_type" },
@@ -891,7 +891,7 @@ int ff_filter_process_command(AVFilterContext *ctx, const char *cmd,
 
     if (!ctx->filter->priv_class)
         return 0;
-    o = av_opt_find2(ctx->priv, cmd, NULL, AV_OPT_FLAG_RUNTIME_PARAM | AV_OPT_FLAG_FILTERING_PARAM, AV_OPT_SEARCH_CHILDREN, NULL);
+    o = av_opt_find2(ctx->priv, cmd, NULL, AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM | AV_OPT_FLAG_FILTERING_PARAM, AV_OPT_SEARCH_CHILDREN, NULL);
     if (!o)
         return AVERROR(ENOSYS);
     return av_opt_set(ctx->priv, cmd, arg, 0);
diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c
index 3996261318..6b4e4f0ba9 100644
--- a/libavfilter/f_graphmonitor.c
+++ b/libavfilter/f_graphmonitor.c
@@ -95,7 +95,7 @@ enum {
 
 #define OFFSET(x) offsetof(GraphMonitorContext, x)
 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define VFR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VFR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption graphmonitor_options[] = {
     { "size", "set monitor size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, VF },
diff --git a/libavfilter/f_perms.c b/libavfilter/f_perms.c
index 0e8c208272..576edc0648 100644
--- a/libavfilter/f_perms.c
+++ b/libavfilter/f_perms.c
@@ -45,7 +45,7 @@ typedef struct PermsContext {
 
 #define OFFSET(x) offsetof(PermsContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "mode", "select permissions mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_NONE}, MODE_NONE, NB_MODES-1, TFLAGS, .unit = "mode" },
diff --git a/libavfilter/f_realtime.c b/libavfilter/f_realtime.c
index 83793bbe15..e09dd11525 100644
--- a/libavfilter/f_realtime.c
+++ b/libavfilter/f_realtime.c
@@ -68,7 +68,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 }
 
 #define OFFSET(x) offsetof(RealtimeContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption options[] = {
     { "limit", "sleep time limit", OFFSET(limit), AV_OPT_TYPE_DURATION, { .i64 = 2000000 }, 0, INT64_MAX, FLAGS },
     { "speed", "speed factor", OFFSET(speed), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, DBL_MIN, DBL_MAX, FLAGS },
diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c
index c17b019969..f368041601 100644
--- a/libavfilter/f_streamselect.c
+++ b/libavfilter/f_streamselect.c
@@ -42,7 +42,7 @@ typedef struct StreamSelectContext {
 
 #define OFFSET(x) offsetof(StreamSelectContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption streamselect_options[] = {
     { "inputs",  "number of input streams",           OFFSET(nb_inputs),  AV_OPT_TYPE_INT,    {.i64=2},    2, INT_MAX,  .flags=FLAGS },
     { "map",     "input indexes to remap to outputs", OFFSET(map_str),    AV_OPT_TYPE_STRING, {.str=NULL},              .flags=TFLAGS },
diff --git a/libavfilter/qrencode.c b/libavfilter/qrencode.c
index 1c7ce23e6e..485c580719 100644
--- a/libavfilter/qrencode.c
+++ b/libavfilter/qrencode.c
@@ -149,7 +149,7 @@ typedef struct QREncodeContext {
 
 #define OFFSET(x) offsetof(QREncodeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #define COMMON_OPTIONS                                                  \
     { "qrcode_width", "set rendered QR code width expression", OFFSET(rendered_qrcode_width_expr), AV_OPT_TYPE_STRING, {.str = "64"}, 0, INT_MAX, FLAGS }, \
diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c
index 60cf2b642e..bfe22c0c5e 100644
--- a/libavfilter/setpts.c
+++ b/libavfilter/setpts.c
@@ -312,7 +312,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 #define OFFSET(x) offsetof(SetPTSContext, x)
 #define V AV_OPT_FLAG_VIDEO_PARAM
 #define A AV_OPT_FLAG_AUDIO_PARAM
-#define R AV_OPT_FLAG_RUNTIME_PARAM
+#define R AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
 
 #if CONFIG_SETPTS_FILTER
diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c
index 9fd0b590c1..bed0246a1a 100644
--- a/libavfilter/src_avsynctest.c
+++ b/libavfilter/src_avsynctest.c
@@ -67,7 +67,7 @@ typedef struct AVSyncTestContext {
 #define OFFSET(x) offsetof(AVSyncTestContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 #define V AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define R AV_OPT_FLAG_RUNTIME_PARAM
+#define R AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption avsynctest_options[] = {
     {"size",       "set frame size",  OFFSET(w),            AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"},   0,   0, V },
diff --git a/libavfilter/vf_amplify.c b/libavfilter/vf_amplify.c
index 7f2cf81150..5eadfb4efa 100644
--- a/libavfilter/vf_amplify.c
+++ b/libavfilter/vf_amplify.c
@@ -240,7 +240,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 #define OFFSET(x) offsetof(AmplifyContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define VFT AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define VFT AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption amplify_options[] = {
     { "radius", "set radius", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=2}, 1, 63, .flags = FLAGS },
diff --git a/libavfilter/vf_atadenoise.c b/libavfilter/vf_atadenoise.c
index da132db1b6..591293edde 100644
--- a/libavfilter/vf_atadenoise.c
+++ b/libavfilter/vf_atadenoise.c
@@ -66,7 +66,7 @@ typedef struct ATADenoiseContext {
 } ATADenoiseContext;
 
 #define OFFSET(x) offsetof(ATADenoiseContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption atadenoise_options[] = {
diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c
index ced0a2ac28..a56634edc7 100644
--- a/libavfilter/vf_avgblur.c
+++ b/libavfilter/vf_avgblur.c
@@ -49,7 +49,7 @@ typedef struct AverageBlurContext {
 } AverageBlurContext;
 
 #define OFFSET(x) offsetof(AverageBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption avgblur_options[] = {
     { "sizeX",  "set horizontal size",  OFFSET(radius),  AV_OPT_TYPE_INT, {.i64=1},   1, 1024, FLAGS },
diff --git a/libavfilter/vf_backgroundkey.c b/libavfilter/vf_backgroundkey.c
index 54f7621a10..5295f77341 100644
--- a/libavfilter/vf_backgroundkey.c
+++ b/libavfilter/vf_backgroundkey.c
@@ -217,7 +217,7 @@ static const AVFilterPad backgroundkey_outputs[] = {
 };
 
 #define OFFSET(x) offsetof(BackgroundkeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption backgroundkey_options[] = {
     { "threshold",  "set the scene change threshold", OFFSET(threshold),  AV_OPT_TYPE_FLOAT, { .dbl = 0.08}, 0.0, 1.0, FLAGS },
diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c
index 02893d500d..0182c516e1 100644
--- a/libavfilter/vf_bbox.c
+++ b/libavfilter/vf_bbox.c
@@ -37,7 +37,7 @@ typedef struct BBoxContext {
 } BBoxContext;
 
 #define OFFSET(x) offsetof(BBoxContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption bbox_options[] = {
     { "min_val", "set minimum luminance value for bounding box", OFFSET(min_val), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, UINT16_MAX, FLAGS },
diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c
index 3fe7e69b9f..8b44364aba 100644
--- a/libavfilter/vf_bilateral.c
+++ b/libavfilter/vf_bilateral.c
@@ -56,7 +56,7 @@ typedef struct BilateralContext {
 } BilateralContext;
 
 #define OFFSET(x) offsetof(BilateralContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption bilateral_options[] = {
     { "sigmaS", "set spatial sigma",    OFFSET(sigmaS), AV_OPT_TYPE_FLOAT, {.dbl=0.1}, 0.0, 512, FLAGS },
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 5ea6df2e75..c6d78df1cd 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -63,7 +63,7 @@ typedef struct ThreadData {
 } ThreadData;
 
 #define OFFSET(x) offsetof(BlendContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption blend_options[] = {
     { "c0_mode", "set component #0 blend mode", OFFSET(params[0].mode), AV_OPT_TYPE_INT, {.i64=0}, 0, BLEND_NB-1, FLAGS, .unit = "mode" },
diff --git a/libavfilter/vf_cas.c b/libavfilter/vf_cas.c
index 5fa5055d76..03644c6559 100644
--- a/libavfilter/vf_cas.c
+++ b/libavfilter/vf_cas.c
@@ -255,7 +255,7 @@ static const AVFilterPad cas_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(CASContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption cas_options[] = {
     { "strength", "set the sharpening strength", OFFSET(strength), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0,  1, VF },
diff --git a/libavfilter/vf_chromakey.c b/libavfilter/vf_chromakey.c
index 9c0918bb4d..3f559b3d0f 100644
--- a/libavfilter/vf_chromakey.c
+++ b/libavfilter/vf_chromakey.c
@@ -342,7 +342,7 @@ static const AVFilterPad outputs[] = {
 };
 
 #define OFFSET(x) offsetof(ChromakeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption chromakey_options[] = {
     { "color", "set the chromakey key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS },
diff --git a/libavfilter/vf_chromanr.c b/libavfilter/vf_chromanr.c
index ff77313311..328edb3b35 100644
--- a/libavfilter/vf_chromanr.c
+++ b/libavfilter/vf_chromanr.c
@@ -261,7 +261,7 @@ static int config_input(AVFilterLink *inlink)
 }
 
 #define OFFSET(x) offsetof(ChromaNRContext, x)
-#define VF AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption chromanr_options[] = {
     { "thres", "set y+u+v threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, {.dbl=30}, 1,   200, VF },
diff --git a/libavfilter/vf_chromashift.c b/libavfilter/vf_chromashift.c
index 6c929472a7..828fa96786 100644
--- a/libavfilter/vf_chromashift.c
+++ b/libavfilter/vf_chromashift.c
@@ -356,7 +356,7 @@ static int config_input(AVFilterLink *inlink)
 }
 
 #define OFFSET(x) offsetof(ChromaShiftContext, x)
-#define VFR AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define VFR AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption chromashift_options[] = {
     { "cbh", "shift chroma-blue horizontally", OFFSET(cbh),  AV_OPT_TYPE_INT,   {.i64=0}, -255, 255, .flags = VFR },
diff --git a/libavfilter/vf_colorbalance.c b/libavfilter/vf_colorbalance.c
index 676e74c770..9c944fe702 100644
--- a/libavfilter/vf_colorbalance.c
+++ b/libavfilter/vf_colorbalance.c
@@ -56,7 +56,7 @@ typedef struct ColorBalanceContext {
 } ColorBalanceContext;
 
 #define OFFSET(x) offsetof(ColorBalanceContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption colorbalance_options[] = {
     { "rs", "set red shadows",      OFFSET(cyan_red.shadows),         AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, FLAGS },
     { "gs", "set green shadows",    OFFSET(magenta_green.shadows),    AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, FLAGS },
diff --git a/libavfilter/vf_colorchannelmixer.c b/libavfilter/vf_colorchannelmixer.c
index 006a8ee289..4cac387488 100644
--- a/libavfilter/vf_colorchannelmixer.c
+++ b/libavfilter/vf_colorchannelmixer.c
@@ -82,7 +82,7 @@ static void preservel(float *r, float *g, float *b, float lin, float lout, float
 #include "colorchannelmixer_template.c"
 
 #define OFFSET(x) offsetof(ColorChannelMixerContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colorchannelmixer_options[] = {
     { "rr", "set the red gain for the red channel",     OFFSET(rr), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -2, 2, FLAGS },
diff --git a/libavfilter/vf_colorcontrast.c b/libavfilter/vf_colorcontrast.c
index b086de71e5..8600e26790 100644
--- a/libavfilter/vf_colorcontrast.c
+++ b/libavfilter/vf_colorcontrast.c
@@ -359,7 +359,7 @@ static const AVFilterPad colorcontrast_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorContrastContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colorcontrast_options[] = {
     { "rc",  "set the red-cyan contrast",      OFFSET(rc),  AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
diff --git a/libavfilter/vf_colorcorrect.c b/libavfilter/vf_colorcorrect.c
index d86d9f1927..9025dc1c74 100644
--- a/libavfilter/vf_colorcorrect.c
+++ b/libavfilter/vf_colorcorrect.c
@@ -513,7 +513,7 @@ static const AVFilterPad colorcorrect_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorCorrectContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colorcorrect_options[] = {
     { "rl", "set the red shadow spot",              OFFSET(rl), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
diff --git a/libavfilter/vf_colorize.c b/libavfilter/vf_colorize.c
index e6c563e3e2..9267e0c431 100644
--- a/libavfilter/vf_colorize.c
+++ b/libavfilter/vf_colorize.c
@@ -260,7 +260,7 @@ static const AVFilterPad colorize_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorizeContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colorize_options[] = {
     { "hue",        "set the hue",                     OFFSET(hue),        AV_OPT_TYPE_FLOAT, {.dbl=0},  0, 360, VF },
diff --git a/libavfilter/vf_colorkey.c b/libavfilter/vf_colorkey.c
index 58dd513b31..d843c3ac7f 100644
--- a/libavfilter/vf_colorkey.c
+++ b/libavfilter/vf_colorkey.c
@@ -209,7 +209,7 @@ static const AVFilterPad colorkey_outputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorkeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #if CONFIG_COLORKEY_FILTER
 
diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index 6f54628ec5..89f95f9e94 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -54,7 +54,7 @@ typedef struct ColorLevelsContext {
 } ColorLevelsContext;
 
 #define OFFSET(x) offsetof(ColorLevelsContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption colorlevels_options[] = {
     { "rimin", "set input red black point",    OFFSET(range[R].in_min),  AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
     { "gimin", "set input green black point",  OFFSET(range[G].in_min),  AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
diff --git a/libavfilter/vf_colormap.c b/libavfilter/vf_colormap.c
index 31f33e7ebd..19f37e2ef1 100644
--- a/libavfilter/vf_colormap.c
+++ b/libavfilter/vf_colormap.c
@@ -65,7 +65,7 @@ typedef struct ColorMapContext {
 } ColorMapContext;
 
 #define OFFSET(x) offsetof(ColorMapContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colormap_options[] = {
     { "patch_size", "set patch size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "64x64"}, 0, 0, FLAGS },
diff --git a/libavfilter/vf_colortemperature.c b/libavfilter/vf_colortemperature.c
index b06b04e704..34a642b227 100644
--- a/libavfilter/vf_colortemperature.c
+++ b/libavfilter/vf_colortemperature.c
@@ -369,7 +369,7 @@ static const AVFilterPad inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ColorTemperatureContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption colortemperature_options[] = {
     { "temperature", "set the temperature in Kelvin",          OFFSET(temperature), AV_OPT_TYPE_FLOAT, {.dbl=6500}, 1000,  40000, VF },
diff --git a/libavfilter/vf_convolution.c b/libavfilter/vf_convolution.c
index bb78e33d80..b91560c772 100644
--- a/libavfilter/vf_convolution.c
+++ b/libavfilter/vf_convolution.c
@@ -34,7 +34,7 @@
 #include "video.h"
 
 #define OFFSET(x) offsetof(ConvolutionContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption convolution_options[] = {
     { "0m", "set matrix for 1st plane", OFFSET(matrix_str[0]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 6361209941..de12e5a161 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -363,7 +363,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(CropContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption crop_options[] = {
     { "out_w",       "set the width crop area expression",   OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, 0, 0, TFLAGS },
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 486f723a4b..36834ed135 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -466,7 +466,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(CropDetectContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption cropdetect_options[] = {
     { "limit", "Threshold below which the pixel is considered black", OFFSET(limit),       AV_OPT_TYPE_FLOAT, { .dbl = 24.0/255 }, 0, 65535, TFLAGS },
diff --git a/libavfilter/vf_curves.c b/libavfilter/vf_curves.c
index 97f284db22..fa0def3715 100644
--- a/libavfilter/vf_curves.c
+++ b/libavfilter/vf_curves.c
@@ -90,7 +90,7 @@ typedef struct ThreadData {
 } ThreadData;
 
 #define OFFSET(x) offsetof(CurvesContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption curves_options[] = {
     { "preset", "select a color curves preset", OFFSET(preset), AV_OPT_TYPE_INT, {.i64=PRESET_NONE}, PRESET_NONE, NB_PRESETS-1, FLAGS, .unit = "preset_name" },
         { "none",               NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NONE},                 0, 0, FLAGS, .unit = "preset_name" },
diff --git a/libavfilter/vf_datascope.c b/libavfilter/vf_datascope.c
index 52b1939cd2..0a41ac24ee 100644
--- a/libavfilter/vf_datascope.c
+++ b/libavfilter/vf_datascope.c
@@ -55,7 +55,7 @@ typedef struct DatascopeContext {
 
 #define OFFSET(x) offsetof(DatascopeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define FLAGSR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGSR AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption datascope_options[] = {
     { "size", "set output size", OFFSET(ow),   AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, FLAGS },
diff --git a/libavfilter/vf_dblur.c b/libavfilter/vf_dblur.c
index 5202c57489..5d7dba87aa 100644
--- a/libavfilter/vf_dblur.c
+++ b/libavfilter/vf_dblur.c
@@ -43,7 +43,7 @@ typedef struct DBlurContext {
 } DBlurContext;
 
 #define OFFSET(x) offsetof(DBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption dblur_options[] = {
     { "angle",  "set angle",            OFFSET(angle),  AV_OPT_TYPE_FLOAT, {.dbl=45},  0.0,  360, FLAGS },
diff --git a/libavfilter/vf_deband.c b/libavfilter/vf_deband.c
index 9888285586..e700be4b85 100644
--- a/libavfilter/vf_deband.c
+++ b/libavfilter/vf_deband.c
@@ -51,7 +51,7 @@ typedef struct DebandContext {
 } DebandContext;
 
 #define OFFSET(x) offsetof(DebandContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption deband_options[] = {
     { "1thr",      "set 1st plane threshold", OFFSET(threshold[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.02},  0.00003,     0.5, FLAGS },
diff --git a/libavfilter/vf_deblock.c b/libavfilter/vf_deblock.c
index 7e4b1799d3..6d734b3367 100644
--- a/libavfilter/vf_deblock.c
+++ b/libavfilter/vf_deblock.c
@@ -378,7 +378,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 }
 
 #define OFFSET(x) offsetof(DeblockContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption deblock_options[] = {
     { "filter",    "set type of filter",          OFFSET(filter),    AV_OPT_TYPE_INT,   {.i64=STRONG},0, 1,  FLAGS, .unit = "filter" },
diff --git a/libavfilter/vf_despill.c b/libavfilter/vf_despill.c
index 7e8ccf7fe8..e3d9d6c7df 100644
--- a/libavfilter/vf_despill.c
+++ b/libavfilter/vf_despill.c
@@ -138,7 +138,7 @@ static const AVFilterPad despill_outputs[] = {
 };
 
 #define OFFSET(x) offsetof(DespillContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption despill_options[] = {
     { "type",       "set the screen type",     OFFSET(type),        AV_OPT_TYPE_INT,     {.i64=0},     0,   1, FLAGS, .unit = "type" },
diff --git a/libavfilter/vf_displace.c b/libavfilter/vf_displace.c
index 93de62fb5c..b5a194b0ef 100644
--- a/libavfilter/vf_displace.c
+++ b/libavfilter/vf_displace.c
@@ -47,7 +47,7 @@ typedef struct DisplaceContext {
 } DisplaceContext;
 
 #define OFFSET(x) offsetof(DisplaceContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption displace_options[] = {
     { "edge", "set edge mode", OFFSET(edge), AV_OPT_TYPE_INT, {.i64=EDGE_SMEAR}, 0, EDGE_NB-1, FLAGS, .unit = "edge" },
diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
index 27739dc89f..2ad57e6972 100644
--- a/libavfilter/vf_drawbox.c
+++ b/libavfilter/vf_drawbox.c
@@ -438,7 +438,7 @@ end:
 }
 
 #define OFFSET(x) offsetof(DrawBoxContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #if CONFIG_DRAWBOX_FILTER
 
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 0ac0a0721c..001e238577 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -331,7 +331,7 @@ typedef struct DrawTextContext {
 
 #define OFFSET(x) offsetof(DrawTextContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption drawtext_options[]= {
     {"fontfile",       "set font file",         OFFSET(fontfile),           AV_OPT_TYPE_STRING, {.str=NULL},  0, 0, FLAGS},
diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c
index 30ff976940..a20add848c 100644
--- a/libavfilter/vf_eq.c
+++ b/libavfilter/vf_eq.c
@@ -316,7 +316,7 @@ static const AVFilterPad eq_inputs[] = {
 
 #define OFFSET(x) offsetof(EQContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption eq_options[] = {
     { "contrast",     "set the contrast adjustment, negative values give a negative image",
         OFFSET(contrast_expr),     AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c
index b785c290ff..d5cb2cb10b 100644
--- a/libavfilter/vf_estdif.c
+++ b/libavfilter/vf_estdif.c
@@ -77,7 +77,7 @@ typedef struct ESTDIFContext {
 #define S     (MAX_R * 2 + 1)
 
 #define OFFSET(x) offsetof(ESTDIFContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define CONST(name, help, val, u) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, .unit = u }
 
 static const AVOption estdif_options[] = {
diff --git a/libavfilter/vf_exposure.c b/libavfilter/vf_exposure.c
index 926d784a81..7eb0f76699 100644
--- a/libavfilter/vf_exposure.c
+++ b/libavfilter/vf_exposure.c
@@ -132,7 +132,7 @@ static const AVFilterPad exposure_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(ExposureContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption exposure_options[] = {
     { "exposure", "set the exposure correction",    OFFSET(exposure), AV_OPT_TYPE_FLOAT, {.dbl=0}, -3, 3, VF },
diff --git a/libavfilter/vf_feedback.c b/libavfilter/vf_feedback.c
index 2fb7d48057..4c145114ae 100644
--- a/libavfilter/vf_feedback.c
+++ b/libavfilter/vf_feedback.c
@@ -311,7 +311,7 @@ static const AVFilterPad outputs[] = {
 
 #define OFFSET(x) offsetof(FeedbackContext, x)
 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
-#define TFLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM)
+#define TFLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)
 
 static const AVOption feedback_options[] = {
     { "x", "set top left crop position", OFFSET(x), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, TFLAGS },
diff --git a/libavfilter/vf_fftdnoiz.c b/libavfilter/vf_fftdnoiz.c
index 93d068d046..406c1e54cc 100644
--- a/libavfilter/vf_fftdnoiz.c
+++ b/libavfilter/vf_fftdnoiz.c
@@ -85,7 +85,7 @@ typedef struct FFTdnoizContext {
 
 #define OFFSET(x) offsetof(FFTdnoizContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption fftdnoiz_options[] = {
     { "sigma",   "set denoise strength",
         OFFSET(sigma),      AV_OPT_TYPE_FLOAT, {.dbl=1},        0, 100, .flags = TFLAGS },
diff --git a/libavfilter/vf_fillborders.c b/libavfilter/vf_fillborders.c
index 2778cb486b..bfc6b3b3ae 100644
--- a/libavfilter/vf_fillborders.c
+++ b/libavfilter/vf_fillborders.c
@@ -675,7 +675,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 }
 
 #define OFFSET(x) offsetof(FillBordersContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption fillborders_options[] = {
     { "left",   "set the left fill border",   OFFSET(left),   AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX,    FLAGS },
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index 7dccd5946f..7940a5c8c2 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -405,7 +405,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(Frei0rContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption frei0r_options[] = {
     { "filter_name",   NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
     { "filter_params", NULL, OFFSET(params),  AV_OPT_TYPE_STRING, .flags = TFLAGS },
diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index 812fad72a3..ac38fc1348 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -38,7 +38,7 @@
 #include "video.h"
 
 #define OFFSET(x) offsetof(GBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption gblur_options[] = {
     { "sigma",  "set sigma",            OFFSET(sigma),  AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0.0, 1024, FLAGS },
diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c
index 68a1b97d1c..f9e885ee5a 100644
--- a/libavfilter/vf_guided.c
+++ b/libavfilter/vf_guided.c
@@ -77,7 +77,7 @@ typedef struct GuidedContext {
 } GuidedContext;
 
 #define OFFSET(x) offsetof(GuidedContext, x)
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption guided_options[] = {
diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c
index 9f32b943c9..6535cc7708 100644
--- a/libavfilter/vf_hqdn3d.c
+++ b/libavfilter/vf_hqdn3d.c
@@ -363,7 +363,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 }
 
 #define OFFSET(x) offsetof(HQDN3DContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption hqdn3d_options[] = {
     { "luma_spatial",   "spatial luma strength",    OFFSET(strength[LUMA_SPATIAL]),   AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0, DBL_MAX, FLAGS },
     { "chroma_spatial", "spatial chroma strength",  OFFSET(strength[CHROMA_SPATIAL]), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0, DBL_MAX, FLAGS },
diff --git a/libavfilter/vf_hsvkey.c b/libavfilter/vf_hsvkey.c
index 0bd8cace37..a499d8e15e 100644
--- a/libavfilter/vf_hsvkey.c
+++ b/libavfilter/vf_hsvkey.c
@@ -284,7 +284,7 @@ static const AVFilterPad outputs[] = {
 };
 
 #define OFFSET(x) offsetof(HSVKeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption hsvkey_options[] = {
     { "hue", "set the hue value", OFFSET(hue_opt), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, -360, 360, FLAGS },
diff --git a/libavfilter/vf_hue.c b/libavfilter/vf_hue.c
index bf390a03fc..a3417c25e3 100644
--- a/libavfilter/vf_hue.c
+++ b/libavfilter/vf_hue.c
@@ -86,7 +86,7 @@ typedef struct HueContext {
 } HueContext;
 
 #define OFFSET(x) offsetof(HueContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption hue_options[] = {
     { "h", "set the hue angle degrees expression", OFFSET(hue_deg_expr), AV_OPT_TYPE_STRING,
       { .str = NULL }, .flags = FLAGS },
diff --git a/libavfilter/vf_huesaturation.c b/libavfilter/vf_huesaturation.c
index bea13deca9..91b3662f70 100644
--- a/libavfilter/vf_huesaturation.c
+++ b/libavfilter/vf_huesaturation.c
@@ -434,7 +434,7 @@ static const AVFilterPad huesaturation_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(HueSaturationContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption huesaturation_options[] = {
     { "hue",        "set the hue shift",               OFFSET(hue),        AV_OPT_TYPE_FLOAT, {.dbl=0},-180, 180, VF },
diff --git a/libavfilter/vf_il.c b/libavfilter/vf_il.c
index 5eaa40a6f8..1a783f21a1 100644
--- a/libavfilter/vf_il.c
+++ b/libavfilter/vf_il.c
@@ -48,7 +48,7 @@ typedef struct IlContext {
 } IlContext;
 
 #define OFFSET(x) offsetof(IlContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption il_options[] = {
     {"luma_mode",   "select luma mode", OFFSET(luma_mode), AV_OPT_TYPE_INT, {.i64=MODE_NONE}, MODE_NONE, MODE_DEINTERLEAVE, FLAGS, .unit = "luma_mode"},
diff --git a/libavfilter/vf_lagfun.c b/libavfilter/vf_lagfun.c
index 4d7496c3eb..2d5fdc0cd9 100644
--- a/libavfilter/vf_lagfun.c
+++ b/libavfilter/vf_lagfun.c
@@ -192,7 +192,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 
 #define OFFSET(x) offsetof(LagfunContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption lagfun_options[] = {
     { "decay",  "set decay",                 OFFSET(decay),  AV_OPT_TYPE_FLOAT, {.dbl=.95},  0,  1,  FLAGS },
diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c
index 06ab662b5f..d59bc5d6a3 100644
--- a/libavfilter/vf_lenscorrection.c
+++ b/libavfilter/vf_lenscorrection.c
@@ -53,7 +53,7 @@ typedef struct LenscorrectionCtx {
 } LenscorrectionCtx;
 
 #define OFFSET(x) offsetof(LenscorrectionCtx, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption lenscorrection_options[] = {
     { "cx", "set relative center x", OFFSET(cx), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 1, .flags=FLAGS },
     { "cy", "set relative center y", OFFSET(cy), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 1, .flags=FLAGS },
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index be9000aa8e..8c009e50f0 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -1265,7 +1265,7 @@ fail:
 
 #define OFFSET(x) offsetof(LibplaceboContext, x)
 #define STATIC (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
-#define DYNAMIC (STATIC | AV_OPT_FLAG_RUNTIME_PARAM)
+#define DYNAMIC (STATIC | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)
 
 static const AVOption libplacebo_options[] = {
     { "inputs", "Number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, .flags = STATIC },
diff --git a/libavfilter/vf_limitdiff.c b/libavfilter/vf_limitdiff.c
index 1e903d45a8..f8b430bfcd 100644
--- a/libavfilter/vf_limitdiff.c
+++ b/libavfilter/vf_limitdiff.c
@@ -52,7 +52,7 @@ typedef struct LimitDiffContext {
 } LimitDiffContext;
 
 #define OFFSET(x) offsetof(LimitDiffContext, x)
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
 static const AVOption limitdiff_options[] = {
diff --git a/libavfilter/vf_limiter.c b/libavfilter/vf_limiter.c
index f67f590d60..7a32600616 100644
--- a/libavfilter/vf_limiter.c
+++ b/libavfilter/vf_limiter.c
@@ -45,7 +45,7 @@ typedef struct LimiterContext {
 } LimiterContext;
 
 #define OFFSET(x) offsetof(LimiterContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption limiter_options[] = {
     { "min",    "set min value", OFFSET(min),    AV_OPT_TYPE_INT, {.i64=0},     0, 65535, .flags = FLAGS },
diff --git a/libavfilter/vf_lumakey.c b/libavfilter/vf_lumakey.c
index d426a5b67a..fc6c57056a 100644
--- a/libavfilter/vf_lumakey.c
+++ b/libavfilter/vf_lumakey.c
@@ -173,7 +173,7 @@ static const AVFilterPad lumakey_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(LumakeyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption lumakey_options[] = {
     { "threshold", "set the threshold value", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl=0},    0, 1, FLAGS },
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index 01df8f287d..754b732c36 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -83,7 +83,7 @@ typedef struct LutContext {
 #define A 3
 
 #define OFFSET(x) offsetof(LutContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]),  AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS },
diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index 1f0661a0f5..93e6b39f0c 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -81,7 +81,7 @@ typedef struct ThreadData {
 
 #define OFFSET(x) offsetof(LUT2Context, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption options[] = {
     { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]),  AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS },
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index d8ceb2a424..c394a64aa4 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -46,7 +46,7 @@
 
 #define OFFSET(x) offsetof(LUT3DContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define COMMON_OPTIONS \
     { "interp", "select interpolation mode", OFFSET(interpolation), AV_OPT_TYPE_INT, {.i64=INTERPOLATE_TETRAHEDRAL}, 0, NB_INTERP_MODE-1, TFLAGS, .unit = "interp_mode" }, \
         { "nearest",     "use values from the nearest defined points",            0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_NEAREST},     0, 0, TFLAGS, .unit = "interp_mode" }, \
diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c
index e6fbb1a6d5..a1ab17d88c 100644
--- a/libavfilter/vf_maskedclamp.c
+++ b/libavfilter/vf_maskedclamp.c
@@ -28,7 +28,7 @@
 #include "maskedclamp.h"
 
 #define OFFSET(x) offsetof(MaskedClampContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 typedef struct ThreadData {
     AVFrame *b, *o, *m, *d;
diff --git a/libavfilter/vf_maskedmerge.c b/libavfilter/vf_maskedmerge.c
index 4ca0c571c8..18ea1dfe09 100644
--- a/libavfilter/vf_maskedmerge.c
+++ b/libavfilter/vf_maskedmerge.c
@@ -27,7 +27,7 @@
 #include "maskedmerge.h"
 
 #define OFFSET(x) offsetof(MaskedMergeContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption maskedmerge_options[] = {
     { "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
diff --git a/libavfilter/vf_maskedminmax.c b/libavfilter/vf_maskedminmax.c
index b1c309cc7d..639cc7d1e7 100644
--- a/libavfilter/vf_maskedminmax.c
+++ b/libavfilter/vf_maskedminmax.c
@@ -27,7 +27,7 @@
 #include "framesync.h"
 
 #define OFFSET(x) offsetof(MaskedMinMaxContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 typedef struct ThreadData {
     AVFrame *src, *f1, *f2, *dst;
diff --git a/libavfilter/vf_maskedthreshold.c b/libavfilter/vf_maskedthreshold.c
index e78e11810e..577183cb22 100644
--- a/libavfilter/vf_maskedthreshold.c
+++ b/libavfilter/vf_maskedthreshold.c
@@ -43,7 +43,7 @@ typedef struct MaskedThresholdContext {
 } MaskedThresholdContext;
 
 #define OFFSET(x) offsetof(MaskedThresholdContext, x)
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
 typedef struct ThreadData {
diff --git a/libavfilter/vf_maskfun.c b/libavfilter/vf_maskfun.c
index 1ac152fc8b..c770bcf805 100644
--- a/libavfilter/vf_maskfun.c
+++ b/libavfilter/vf_maskfun.c
@@ -48,7 +48,7 @@ typedef struct MaskFunContext {
 } MaskFunContext;
 
 #define OFFSET(x) offsetof(MaskFunContext, x)
-#define VFT AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VFT AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption maskfun_options[] = {
     { "low",    "set low threshold",  OFFSET(low),    AV_OPT_TYPE_INT, {.i64=10},  0, UINT16_MAX, VFT },
diff --git a/libavfilter/vf_median.c b/libavfilter/vf_median.c
index 5ed787af5e..f314741cde 100644
--- a/libavfilter/vf_median.c
+++ b/libavfilter/vf_median.c
@@ -53,7 +53,7 @@
 #include "median_template.c"
 
 #define OFFSET(x) offsetof(MedianContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption median_options[] = {
     { "radius", "set median radius",    OFFSET(radius), AV_OPT_TYPE_INT,   {.i64=1},     1,  127, FLAGS },
diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c
index bfbdc2c83e..2924639bb3 100644
--- a/libavfilter/vf_mix.c
+++ b/libavfilter/vf_mix.c
@@ -430,7 +430,7 @@ static int activate(AVFilterContext *ctx)
 
 #define OFFSET(x) offsetof(MixContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption mix_options[] = {
     { "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT16_MAX, .flags = FLAGS },
diff --git a/libavfilter/vf_monochrome.c b/libavfilter/vf_monochrome.c
index 05c001707a..11bc49fe26 100644
--- a/libavfilter/vf_monochrome.c
+++ b/libavfilter/vf_monochrome.c
@@ -268,7 +268,7 @@ static const AVFilterPad monochrome_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(MonochromeContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption monochrome_options[] = {
     { "cb",   "set the chroma blue spot",    OFFSET(b),    AV_OPT_TYPE_FLOAT, {.dbl=0},-1, 1, VF },
diff --git a/libavfilter/vf_morpho.c b/libavfilter/vf_morpho.c
index ce0f01c9c0..a38510feb7 100644
--- a/libavfilter/vf_morpho.c
+++ b/libavfilter/vf_morpho.c
@@ -126,7 +126,7 @@ typedef struct MorphoContext {
 } MorphoContext;
 
 #define OFFSET(x) offsetof(MorphoContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption morpho_options[] = {
     { "mode",  "set morphological transform",                 OFFSET(mode),       AV_OPT_TYPE_INT,   {.i64=0}, 0, NB_MODES-1, FLAGS, .unit = "mode" },
diff --git a/libavfilter/vf_multiply.c b/libavfilter/vf_multiply.c
index 54fbeff483..e0b5d64d45 100644
--- a/libavfilter/vf_multiply.c
+++ b/libavfilter/vf_multiply.c
@@ -40,7 +40,7 @@ typedef struct MultiplyContext {
 } MultiplyContext;
 
 #define OFFSET(x) offsetof(MultiplyContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 typedef struct ThreadData {
     AVFrame *src, *ref, *dst;
diff --git a/libavfilter/vf_negate.c b/libavfilter/vf_negate.c
index 40c0c2608b..4a8cfad7c5 100644
--- a/libavfilter/vf_negate.c
+++ b/libavfilter/vf_negate.c
@@ -59,7 +59,7 @@ typedef struct NegateContext {
 } NegateContext;
 
 #define OFFSET(x) offsetof(NegateContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption negate_options[] = {
     { "components", "set components to negate",  OFFSET(requested_components), AV_OPT_TYPE_FLAGS, {.i64=0x77}, 1, 0xff, FLAGS, .unit = "flags"},
diff --git a/libavfilter/vf_neighbor.c b/libavfilter/vf_neighbor.c
index 915347d6ba..aed562e4ca 100644
--- a/libavfilter/vf_neighbor.c
+++ b/libavfilter/vf_neighbor.c
@@ -341,7 +341,7 @@ static const AVFilterPad neighbor_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(NContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #define DEFINE_NEIGHBOR_FILTER(name_, description_, priv_class_) \
 const AVFilter ff_vf_##name_ = {                                   \
diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c
index 2168c5dbc5..78703e9735 100644
--- a/libavfilter/vf_nnedi.c
+++ b/libavfilter/vf_nnedi.c
@@ -115,7 +115,7 @@ typedef struct NNEDIContext {
 } NNEDIContext;
 
 #define OFFSET(x) offsetof(NNEDIContext, x)
-#define RFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define RFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption nnedi_options[] = {
diff --git a/libavfilter/vf_normalize.c b/libavfilter/vf_normalize.c
index 337c37f0ab..c6ddeb0832 100644
--- a/libavfilter/vf_normalize.c
+++ b/libavfilter/vf_normalize.c
@@ -123,7 +123,7 @@ typedef struct NormalizeContext {
 
 #define OFFSET(x) offsetof(NormalizeContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define FLAGSR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGSR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption normalize_options[] = {
     { "blackpt",  "output color to which darkest input color is mapped",  OFFSET(blackpt), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGSR },
diff --git a/libavfilter/vf_phase.c b/libavfilter/vf_phase.c
index 4fd6d2b6e5..4a70a9ad31 100644
--- a/libavfilter/vf_phase.c
+++ b/libavfilter/vf_phase.c
@@ -73,7 +73,7 @@ typedef struct PhaseContext {
 } PhaseContext;
 
 #define OFFSET(x) offsetof(PhaseContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define CONST(name, help, val, u) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, .unit = u }
 
 static const AVOption phase_options[] = {
diff --git a/libavfilter/vf_pixelize.c b/libavfilter/vf_pixelize.c
index 4eb236f121..e968248b7b 100644
--- a/libavfilter/vf_pixelize.c
+++ b/libavfilter/vf_pixelize.c
@@ -303,7 +303,7 @@ fail:
 }
 
 #define OFFSET(x) offsetof(PixelizeContext, x)
-#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM)
+#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)
 
 static const AVOption pixelize_options[] = {
     { "width",  "set block width",  OFFSET(block_w[0]), AV_OPT_TYPE_INT, {.i64=16}, 1, 1024, FLAGS },
diff --git a/libavfilter/vf_pseudocolor.c b/libavfilter/vf_pseudocolor.c
index cfdfac7842..60bfff0ffe 100644
--- a/libavfilter/vf_pseudocolor.c
+++ b/libavfilter/vf_pseudocolor.c
@@ -334,7 +334,7 @@ typedef struct PseudoColorContext {
 } PseudoColorContext;
 
 #define OFFSET(x) offsetof(PseudoColorContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption pseudocolor_options[] = {
     { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, {.str="val"},   .flags = FLAGS },
diff --git a/libavfilter/vf_readeia608.c b/libavfilter/vf_readeia608.c
index 7fb143cde0..3a6c233916 100644
--- a/libavfilter/vf_readeia608.c
+++ b/libavfilter/vf_readeia608.c
@@ -86,7 +86,7 @@ typedef struct ReadEIA608Context {
 } ReadEIA608Context;
 
 #define OFFSET(x) offsetof(ReadEIA608Context, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption readeia608_options[] = {
     { "scan_min", "set from which line to scan for codes",               OFFSET(start), AV_OPT_TYPE_INT,   {.i64=0},     0, INT_MAX, FLAGS },
diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c
index 3e65f26552..c16215094d 100644
--- a/libavfilter/vf_rotate.c
+++ b/libavfilter/vf_rotate.c
@@ -94,7 +94,7 @@ typedef struct ThreadData {
 
 #define OFFSET(x) offsetof(RotContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption rotate_options[] = {
     { "angle",     "set angle (in radians)",       OFFSET(angle_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags=TFLAGS },
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 841075193e..5d4600bde3 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -1180,7 +1180,7 @@ static void *child_next(void *obj, void *prev)
 
 #define OFFSET(x) offsetof(ScaleContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption scale_options[] = {
     { "w",     "Output video width",          OFFSET(w_expr),    AV_OPT_TYPE_STRING,        .flags = TFLAGS },
diff --git a/libavfilter/vf_scroll.c b/libavfilter/vf_scroll.c
index eebf12e902..eefb02bbdd 100644
--- a/libavfilter/vf_scroll.c
+++ b/libavfilter/vf_scroll.c
@@ -171,7 +171,7 @@ static int config_input(AVFilterLink *inlink)
 
 #define OFFSET(x) offsetof(ScrollContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption scroll_options[] = {
     { "horizontal", "set the horizontal scrolling speed", OFFSET(h_speed), AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., VFT },
diff --git a/libavfilter/vf_shear.c b/libavfilter/vf_shear.c
index 5008db3f46..dc82b7a23e 100644
--- a/libavfilter/vf_shear.c
+++ b/libavfilter/vf_shear.c
@@ -57,7 +57,7 @@ typedef struct ThreadData {
 } ThreadData;
 
 #define OFFSET(x) offsetof(ShearContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption shear_options[] = {
     { "shx",       "set x shear factor",        OFFSET(shx),           AV_OPT_TYPE_FLOAT,  {.dbl=0.},     -2, 2, .flags=FLAGS },
diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c
index d6c7297985..e935336193 100644
--- a/libavfilter/vf_spp.c
+++ b/libavfilter/vf_spp.c
@@ -63,7 +63,7 @@ static void *child_next(void *obj, void *prev)
 
 #define OFFSET(x) offsetof(SPPContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption spp_options[] = {
     { "quality", "set quality", OFFSET(log2_count), AV_OPT_TYPE_INT, {.i64 = 3}, 0, MAX_LEVEL, TFLAGS },
     { "qp", "force a constant quantizer parameter", OFFSET(qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, FLAGS },
diff --git a/libavfilter/vf_swaprect.c b/libavfilter/vf_swaprect.c
index 54400f0304..1ff0d3f751 100644
--- a/libavfilter/vf_swaprect.c
+++ b/libavfilter/vf_swaprect.c
@@ -43,7 +43,7 @@ typedef struct SwapRectContext {
 } SwapRectContext;
 
 #define OFFSET(x) offsetof(SwapRectContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 static const AVOption swaprect_options[] = {
     { "w",  "set rect width",                     OFFSET(w),  AV_OPT_TYPE_STRING, {.str="w/2"}, 0, 0, .flags = FLAGS },
     { "h",  "set rect height",                    OFFSET(h),  AV_OPT_TYPE_STRING, {.str="h/2"}, 0, 0, .flags = FLAGS },
diff --git a/libavfilter/vf_threshold.c b/libavfilter/vf_threshold.c
index dc73c277d3..61e81dd7b9 100644
--- a/libavfilter/vf_threshold.c
+++ b/libavfilter/vf_threshold.c
@@ -35,7 +35,7 @@
 #include "vf_threshold_init.h"
 
 #define OFFSET(x) offsetof(ThresholdContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption threshold_options[] = {
     { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT,  {.i64=15}, 0, 15, FLAGS},
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 299dbe9ff5..dcf1f7d305 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -52,7 +52,7 @@ typedef struct ThreadData {
 
 #define OFFSET(x) offsetof(V360Context, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption v360_options[] = {
     {     "input", "set input projection",              OFFSET(in), AV_OPT_TYPE_INT,    {.i64=EQUIRECTANGULAR}, 0,    NB_PROJECTIONS-1, FLAGS, .unit = "in" },
diff --git a/libavfilter/vf_varblur.c b/libavfilter/vf_varblur.c
index 7a022099e9..a3b05c76f7 100644
--- a/libavfilter/vf_varblur.c
+++ b/libavfilter/vf_varblur.c
@@ -61,7 +61,7 @@ typedef struct VarBlurContext {
 } VarBlurContext;
 
 #define OFFSET(x) offsetof(VarBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption varblur_options[] = {
     { "min_r",  "set min blur radius",  OFFSET(min_radius), AV_OPT_TYPE_INT,   {.i64=0},     0, 254, FLAGS },
diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index a1f98ece68..9842544424 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -85,7 +85,7 @@ typedef struct VectorscopeContext {
 
 #define OFFSET(x) offsetof(VectorscopeContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption vectorscope_options[] = {
     { "mode", "set vectorscope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, MODE_NB-1, FLAGS, .unit = "mode"},
diff --git a/libavfilter/vf_vibrance.c b/libavfilter/vf_vibrance.c
index e1d6e64aeb..41b4301d0e 100644
--- a/libavfilter/vf_vibrance.c
+++ b/libavfilter/vf_vibrance.c
@@ -416,7 +416,7 @@ static const AVFilterPad vibrance_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(VibranceContext, x)
-#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption vibrance_options[] = {
     { "intensity", "set the intensity value",   OFFSET(intensity),  AV_OPT_TYPE_FLOAT, {.dbl=0},       -2,  2, VF },
diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index a5a9cdd5cb..a9ca0da3fe 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -51,7 +51,7 @@ typedef struct W3FDIFContext {
 } W3FDIFContext;
 
 #define OFFSET(x) offsetof(W3FDIFContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 #define CONST(name, help, val, u) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, .unit = u }
 
 static const AVOption w3fdif_options[] = {
diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
index f45b445443..395485120b 100644
--- a/libavfilter/vf_waveform.c
+++ b/libavfilter/vf_waveform.c
@@ -136,7 +136,7 @@ typedef struct WaveformContext {
 
 #define OFFSET(x) offsetof(WaveformContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption waveform_options[] = {
     { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, .unit = "mode" },
diff --git a/libavfilter/vf_xmedian.c b/libavfilter/vf_xmedian.c
index 4e83b48843..02a2d54912 100644
--- a/libavfilter/vf_xmedian.c
+++ b/libavfilter/vf_xmedian.c
@@ -62,7 +62,7 @@ typedef struct XMedianContext {
 
 #define OFFSET(x) offsetof(XMedianContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const enum AVPixelFormat pixel_fmts[] = {
     AV_PIX_FMT_GRAY8,
diff --git a/libavfilter/vf_yaepblur.c b/libavfilter/vf_yaepblur.c
index 9b5ec0348f..efa4bcf53f 100644
--- a/libavfilter/vf_yaepblur.c
+++ b/libavfilter/vf_yaepblur.c
@@ -312,7 +312,7 @@ static const AVFilterPad yaep_inputs[] = {
 };
 
 #define OFFSET(x) offsetof(YAEPContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption yaepblur_options[] = {
     { "radius", "set window radius",    OFFSET(radius), AV_OPT_TYPE_INT, {.i64=3},   0, INT_MAX, .flags=FLAGS },
diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c
index 45f1bd25ce..ed5db283ed 100644
--- a/libavfilter/vf_zscale.c
+++ b/libavfilter/vf_zscale.c
@@ -984,7 +984,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(ZScaleContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption zscale_options[] = {
     { "w",      "Output video width",  OFFSET(w_expr),    AV_OPT_TYPE_STRING, .flags = TFLAGS },
diff --git a/libavfilter/vsrc_gradients.c b/libavfilter/vsrc_gradients.c
index 567a4a311d..ba7e2ca3f6 100644
--- a/libavfilter/vsrc_gradients.c
+++ b/libavfilter/vsrc_gradients.c
@@ -53,7 +53,7 @@ typedef struct GradientsContext {
 
 #define OFFSET(x) offsetof(GradientsContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 static const AVOption gradients_options[] = {
     {"size",      "set frame size", OFFSET(w),             AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"},  0, 0, FLAGS },
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 4dc12c8a01..2e46a5fcd5 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -99,7 +99,7 @@ typedef struct TestSourceContext {
 
 #define OFFSET(x) offsetof(TestSourceContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-#define FLAGSR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+#define FLAGSR AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM
 
 #define SIZE_OPTIONS \
     { "size",     "set video size",     OFFSET(w),        AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS },\
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 32a9e059e3..97286b95df 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1604,7 +1604,7 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
                (opt->flags & AV_OPT_FLAG_EXPORT)          ? 'X' : '.',
                (opt->flags & AV_OPT_FLAG_READONLY)        ? 'R' : '.',
                (opt->flags & AV_OPT_FLAG_BSF_PARAM)       ? 'B' : '.',
-               (opt->flags & AV_OPT_FLAG_RUNTIME_PARAM)   ? 'T' : '.',
+               (opt->flags & AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM)   ? 'T' : '.',
                (opt->flags & AV_OPT_FLAG_DEPRECATED)      ? 'P' : '.');
 
         if (opt->help)
diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c
index 02b3ed6e90..a0c98e499c 100644
--- a/libavutil/tests/opt.c
+++ b/libavutil/tests/opt.c
@@ -115,9 +115,9 @@ static const AVOption test_options[]= {
     {"bool3",      "set boolean value",  OFFSET(bool3),          AV_OPT_TYPE_BOOL,           { .i64 = 0 },                      0,         1, 1 },
     {"dict1",      "set dictionary value", OFFSET(dict1),        AV_OPT_TYPE_DICT,           { .str = NULL},                    0,         0, 1 },
     {"dict2",      "set dictionary value", OFFSET(dict2),        AV_OPT_TYPE_DICT,           { .str = "happy=':-)'"},           0,         0, 1 },
-    {"array_int",  "array of ints",        OFFSET(array_int),    AV_OPT_TYPE_INT | AV_OPT_TYPE_FLAG_ARRAY, .max = INT_MAX,           .flags = AV_OPT_FLAG_RUNTIME_PARAM },
-    {"array_str",  "array of strings",     OFFSET(array_str),    AV_OPT_TYPE_STRING | AV_OPT_TYPE_FLAG_ARRAY, { .arr = &array_str }, .flags = AV_OPT_FLAG_RUNTIME_PARAM },
-    {"array_dict", "array of dicts",       OFFSET(array_dict),   AV_OPT_TYPE_DICT | AV_OPT_TYPE_FLAG_ARRAY, { .arr = &array_dict },  .flags = AV_OPT_FLAG_RUNTIME_PARAM },
+    {"array_int",  "array of ints",        OFFSET(array_int),    AV_OPT_TYPE_INT | AV_OPT_TYPE_FLAG_ARRAY, .max = INT_MAX,           .flags = AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
+    {"array_str",  "array of strings",     OFFSET(array_str),    AV_OPT_TYPE_STRING | AV_OPT_TYPE_FLAG_ARRAY, { .arr = &array_str }, .flags = AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
+    {"array_dict", "array of dicts",       OFFSET(array_dict),   AV_OPT_TYPE_DICT | AV_OPT_TYPE_FLAG_ARRAY, { .arr = &array_dict },  .flags = AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM },
     { NULL },
 };
 
-- 
2.45.2

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
@ 2024-07-02  9:49                     ` Anton Khirnov
  2024-07-06  9:50                     ` Stefano Sabatini
  1 sibling, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2024-07-02  9:49 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andrew Sayers

Quoting Andrew Sayers (2024-07-02 11:08:38)
> The old name could be misread as the opposite of "AV_OPT_FLAG_READONLY" -
> some things can be set at runtime, others are read-only.  Clarify that
> this refers to options that can be set after the struct is initialized.
> ---
>  doc/APIchanges      |  4 ++++
>  libavutil/opt.h     | 15 ++++++++++++++-
>  libavutil/version.h |  3 ++-
>  3 files changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index f1828436e5..8217c391cb 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -2,6 +2,10 @@ The last version increases of all libraries were on 2024-03-07
>  
>  API changes, most recent first:
>  
> +2024-07-02 - xxxxxxxxxx - lavu 59.28.100 - opt.h
> +  Deprecate AV_OPT_FLAG_RUNTIME_PARAM and replace it with
> +  AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM.

Unwarranted API churn

-- 
Anton Khirnov
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places Andrew Sayers
@ 2024-07-02  9:52                     ` Anton Khirnov
  2024-07-02 10:13                       ` Andrew Sayers
  0 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2024-07-02  9:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andrew Sayers

Quoting Andrew Sayers (2024-07-02 11:08:39)
> 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.

Duplication is bad, and the premise doesn't work anyway. Inattentive
users will happily ignore arbitrary amounts of text. In fact the more
text there is, the more of it they will ignore.
Meanwhile you make actual information harder to find for people who
actually bother to read.

-- 
Anton Khirnov
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places
  2024-07-02  9:52                     ` Anton Khirnov
@ 2024-07-02 10:13                       ` Andrew Sayers
  2024-07-02 10:16                         ` Anton Khirnov
  0 siblings, 1 reply; 38+ messages in thread
From: Andrew Sayers @ 2024-07-02 10:13 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Tue, Jul 02, 2024 at 11:52:29AM +0200, Anton Khirnov wrote:
> Quoting Andrew Sayers (2024-07-02 11:08:39)
> > 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.
> 
> Duplication is bad, and the premise doesn't work anyway. Inattentive
> users will happily ignore arbitrary amounts of text. In fact the more
> text there is, the more of it they will ignore.
> Meanwhile you make actual information harder to find for people who
> actually bother to read.

That's a reasonable argument, but incompatible with your other one[1].
If users are inattentive and will ignore arbitrary amounts of text,
the explanation needs to go in the one place they have to look (the
macro name).

[1] https://ffmpeg.org/pipermail/ffmpeg-devel/2024-July/330559.html
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places
  2024-07-02 10:13                       ` Andrew Sayers
@ 2024-07-02 10:16                         ` Anton Khirnov
  2024-07-02 10:49                           ` Andrew Sayers
  0 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2024-07-02 10:16 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Quoting Andrew Sayers (2024-07-02 12:13:16)
> On Tue, Jul 02, 2024 at 11:52:29AM +0200, Anton Khirnov wrote:
> > Quoting Andrew Sayers (2024-07-02 11:08:39)
> > > 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.
> > 
> > Duplication is bad, and the premise doesn't work anyway. Inattentive
> > users will happily ignore arbitrary amounts of text. In fact the more
> > text there is, the more of it they will ignore.
> > Meanwhile you make actual information harder to find for people who
> > actually bother to read.
> 
> That's a reasonable argument, but incompatible with your other one[1].
> If users are inattentive and will ignore arbitrary amounts of text,
> the explanation needs to go in the one place they have to look (the
> macro name).

I don't understand your point. In my other email I'm objecting to
breaking API for flimsy reasons, how is that related to documentation?

-- 
Anton Khirnov
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places
  2024-07-02 10:16                         ` Anton Khirnov
@ 2024-07-02 10:49                           ` Andrew Sayers
  0 siblings, 0 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-07-02 10:49 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Tue, Jul 02, 2024 at 12:16:24PM +0200, Anton Khirnov wrote:
> Quoting Andrew Sayers (2024-07-02 12:13:16)
> > On Tue, Jul 02, 2024 at 11:52:29AM +0200, Anton Khirnov wrote:
> > > Quoting Andrew Sayers (2024-07-02 11:08:39)
> > > > 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.
> > > 
> > > Duplication is bad, and the premise doesn't work anyway. Inattentive
> > > users will happily ignore arbitrary amounts of text. In fact the more
> > > text there is, the more of it they will ignore.
> > > Meanwhile you make actual information harder to find for people who
> > > actually bother to read.
> > 
> > That's a reasonable argument, but incompatible with your other one[1].
> > If users are inattentive and will ignore arbitrary amounts of text,
> > the explanation needs to go in the one place they have to look (the
> > macro name).
> 
> I don't understand your point. In my other email I'm objecting to
> breaking API for flimsy reasons, how is that related to documentation?

I could be wrong, but I think this points to a fundamental issue...

We normally talk about ABI (binary interface) and API (programming interface),
then say "documentation" as if that's some separate thing.  It would have been
better if programmers had used a term like "ADI" (developer interface) instead,
but the world didn't go that way.

API is as intermingled with documentation as it is with ABI, and drawing a
bright line between the two just causes problems.  In this case, spelling it
"AV_OPT_FLAG_RUNTIME_PARAM" isn't API, it's documentation. The compiler would
work just the same if it had been called e.g. "AV_OPT_FLAG_15", the name
is just there for us humans.

This patch is about fixing the documentation, so the primary justification is
that the old spelling mislead humans.  Breaking the API is a side-effect, and
I'd argue it's a net benefit, because it nudges external devs to fix their code.
You can make the opposite argument, but either way it's incidental to the main
goal of picking a spelling that unambiguously documents what the macro does.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-07-02  9:08                 ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
                                     ` (2 preceding siblings ...)
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 3/3] all: s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g Andrew Sayers
@ 2024-07-06  9:37                   ` Stefano Sabatini
  2024-07-06 10:40                     ` Paul B Mahol
  2024-07-06 10:41                     ` Andrew Sayers
  3 siblings, 2 replies; 38+ messages in thread
From: Stefano Sabatini @ 2024-07-06  9:37 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On date Tuesday 2024-07-02 10:08:37 +0100, Andrew Sayers wrote:
> Some notes about this version:
> 
> As previously mentioned, I think this is better with all three patches,
> but can live without #2.
>   
> I think I've followed the deprecation instructions, but editing APIchanges
> seems to imply needing a minor version bump?  This patch includes said bump.
> 

> Zhao Zhili argued this bothers users for too little benefit -
> I'd argue it's beneficial to confirm they haven't misused this feature
> in a way that causes bugs in their code, but the old deprecation message
> didn't make that clear enough.  This version rephrases the @deprecated message
> to speak directly to the maintainer.

I agree the rename is a net improvement in the long term, giving that
this will remove the developer cognitive load and possibly mistakes
due to the misleading name, while the effort required to make the
mechanical rename should be rather small - also there is no evidence
that users are really using this API in their application code so
probably the overall effort is close to zero in this case and it is
only benefits the developers.

While I agree with Anton that we should avoid duplication, for the
usual arguments that a reference should avoid duplication of content
as much as possible, which inevitably leads to inconsistent content
when it is updated partially, leading to inconsistent information.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM
  2024-07-02  3:58                 ` Zhao Zhili
@ 2024-07-06  9:47                   ` Stefano Sabatini
  0 siblings, 0 replies; 38+ messages in thread
From: Stefano Sabatini @ 2024-07-06  9:47 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On date Tuesday 2024-07-02 11:58:09 +0800, Zhao Zhili wrote:
> 
> > 在 2024年7月2日,上午6:33,Stefano Sabatini <stefasab@gmail.com> 写道:
> > 
> > On date Sunday 2024-06-16 18:08:29 +0100, Andrew Sayers wrote:
> >> The old name could be misread as the opposite of "AV_OPT_FLAG_READONLY" -
> >> some things can be set at runtime, others are read-only.  Clarify that
> >> this refers to options that can be set after the struct is initialized.
> 

> Let’s not bother the user again and again for little benefit. Add
> doc is fine, please don’t rename the flag.

The point is that name is the documentation, having a better flag name
guarantees simpler/better use of the API, as opposed to a once-time
mechanical name change for a flag which is probably never used in
external applications code.

Aslo, by following this rule, we should never rename flags for "little
benefit", sticking to misnamed constants (as this is the case) which
require much more effort to double check the API (since the name was
misleading, you need to double check with the API).

If you think in terms of developer time, it is easy to measure the
time required to check and replace the code (a few minutes?) while it
is much harder to assess the overall time spent
checking/writing/validating the code due to bad naming, but my suspect
is that even for a trivial change like this one, it is a much bigger
time that you are saving to the user.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM
  2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
  2024-07-02  9:49                     ` Anton Khirnov
@ 2024-07-06  9:50                     ` Stefano Sabatini
  1 sibling, 0 replies; 38+ messages in thread
From: Stefano Sabatini @ 2024-07-06  9:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andrew Sayers

On date Tuesday 2024-07-02 10:08:38 +0100, Andrew Sayers wrote:
> The old name could be misread as the opposite of "AV_OPT_FLAG_READONLY" -
> some things can be set at runtime, others are read-only.  Clarify that
> this refers to options that can be set after the struct is initialized.
> ---
>  doc/APIchanges      |  4 ++++
>  libavutil/opt.h     | 15 ++++++++++++++-
>  libavutil/version.h |  3 ++-
>  3 files changed, 20 insertions(+), 2 deletions(-)

Looks good to me, but will wait to let the discussion about the
"little benefit renaming" settle.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-07-06  9:37                   ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Stefano Sabatini
@ 2024-07-06 10:40                     ` Paul B Mahol
  2024-07-06 16:49                       ` Michael Niedermayer
  2024-07-06 10:41                     ` Andrew Sayers
  1 sibling, 1 reply; 38+ messages in thread
From: Paul B Mahol @ 2024-07-06 10:40 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sat, Jul 6, 2024 at 11:44 AM Stefano Sabatini <stefasab@gmail.com> wrote:

> On date Tuesday 2024-07-02 10:08:37 +0100, Andrew Sayers wrote:
> > Some notes about this version:
> >
> > As previously mentioned, I think this is better with all three patches,
> > but can live without #2.
> >
> > I think I've followed the deprecation instructions, but editing
> APIchanges
> > seems to imply needing a minor version bump?  This patch includes said
> bump.
> >
>
> > Zhao Zhili argued this bothers users for too little benefit -
> > I'd argue it's beneficial to confirm they haven't misused this feature
> > in a way that causes bugs in their code, but the old deprecation message
> > didn't make that clear enough.  This version rephrases the @deprecated
> message
> > to speak directly to the maintainer.
>
> I agree the rename is a net improvement in the long term, giving that
> this will remove the developer cognitive load and possibly mistakes
> due to the misleading name, while the effort required to make the
> mechanical rename should be rather small - also there is no evidence
> that users are really using this API in their application code so
> probably the overall effort is close to zero in this case and it is
> only benefits the developers.
>
> While I agree with Anton that we should avoid duplication, for the
> usual arguments that a reference should avoid duplication of content
> as much as possible, which inevitably leads to inconsistent content
> when it is updated partially, leading to inconsistent information.
>

Pointless and utterly stupid rename, its much more text to type too.


> _______________________________________________
> 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".
>
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-07-06  9:37                   ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Stefano Sabatini
  2024-07-06 10:40                     ` Paul B Mahol
@ 2024-07-06 10:41                     ` Andrew Sayers
  1 sibling, 0 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-07-06 10:41 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sat, Jul 06, 2024 at 11:37:19AM +0200, Stefano Sabatini wrote:
> On date Tuesday 2024-07-02 10:08:37 +0100, Andrew Sayers wrote:
[...]
> While I agree with Anton that we should avoid duplication, for the
> usual arguments that a reference should avoid duplication of content
> as much as possible, which inevitably leads to inconsistent content
> when it is updated partially, leading to inconsistent information.

I think we're mostly just bikeshedding about how to balance discoverability
with duplication, but feel obliged to point out a third option.  Our Doxygen
config has MACRO_EXPANSION enabled both in the repo and on the site,
so we can use macros to avoid duplicating documentation:

    #define BOILERPLATE \
      /** Lorem ipsum dolor sit amet, consectetur adipiscing elit */
    
    /**
     * @brief Main function
     *
     */
    BOILERPLATE
    int main() {}

I think that's too weird a hack, but happy to propose a patch if you disagree.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-07-06 10:40                     ` Paul B Mahol
@ 2024-07-06 16:49                       ` Michael Niedermayer
  2024-07-06 18:03                         ` Andrew Sayers
  0 siblings, 1 reply; 38+ messages in thread
From: Michael Niedermayer @ 2024-07-06 16:49 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 483 bytes --]

On Sat, Jul 06, 2024 at 12:40:07PM +0200, Paul B Mahol wrote:
[...]

> its much more text to type too.

shorter options:

AV_OPT_FLAG_ALTERABLE_PARAM

AV_OPT_FLAG_MUTABLE_PARAM

(just in case consensus ends on a rename, i am not sure a rename is a good idea here)

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/
  2024-07-06 16:49                       ` Michael Niedermayer
@ 2024-07-06 18:03                         ` Andrew Sayers
  0 siblings, 0 replies; 38+ messages in thread
From: Andrew Sayers @ 2024-07-06 18:03 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sat, Jul 06, 2024 at 06:49:51PM +0200, Michael Niedermayer wrote:
> On Sat, Jul 06, 2024 at 12:40:07PM +0200, Paul B Mahol wrote:
> [...]
> 
> > its much more text to type too.
> 
> shorter options:
> 
> AV_OPT_FLAG_ALTERABLE_PARAM
> 
> AV_OPT_FLAG_MUTABLE_PARAM
> 
> (just in case consensus ends on a rename, i am not sure a rename is a good idea here)

I'm fine with someone doing s/POST_INIT_SETTABLE/MUTABLE/g on the patch before
committing it if they feel that's better, but ALTERABLE seems like a bad idea.

I guess you could argue a sufficiently inattentive reader might read
"POST_INIT_SETTABLE" to mean "*only* settable after init", even though
the documentation says otherwise.  But such a reader might also read
"ALTERABLE" to somehow mean "data type can be altered" (like SQL's ALTER TABLE
statement), whereas "mutable" conventionally means "contents can be altered".

But this is just a nitpick - POST_INIT_SETTABLE is still fine by me.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2024-07-06 18:03 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-05 13:18 [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant Andrew Sayers
2024-06-05 13:34 ` Paul B Mahol
2024-06-05 13:43   ` Andrew Sayers
2024-06-05 13:46     ` Ronald S. Bultje
2024-06-05 14:22       ` Andrew Sayers
2024-06-05 23:17         ` Michael Niedermayer
2024-06-06  8:29           ` Andrew Sayers
2024-06-06 14:24             ` Michael Niedermayer
2024-06-06 15:16               ` Andrew Sayers
2024-06-06 15:21                 ` Andreas Rheinhardt
2024-06-06 15:43                   ` Andrew Sayers
2024-06-05 13:50     ` Paul B Mahol
2024-06-06 16:02       ` [FFmpeg-devel] [PATCH v2] lavu/opt: Discuss AV_OPT_FLAG_RUNTIME_PARAM more explicitly Andrew Sayers
2024-06-16 16:04         ` Stefano Sabatini
2024-06-16 17:08           ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
2024-07-01 22:33               ` Stefano Sabatini
2024-07-02  3:58                 ` Zhao Zhili
2024-07-06  9:47                   ` Stefano Sabatini
2024-07-02  9:08                 ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Andrew Sayers
2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 1/3] lavu/opt: Rename AV_OPT_FLAG_RUNTIME_PARAM to ...POST_INIT_SETTABLE_PARAM Andrew Sayers
2024-07-02  9:49                     ` Anton Khirnov
2024-07-06  9:50                     ` Stefano Sabatini
2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places Andrew Sayers
2024-07-02  9:52                     ` Anton Khirnov
2024-07-02 10:13                       ` Andrew Sayers
2024-07-02 10:16                         ` Anton Khirnov
2024-07-02 10:49                           ` Andrew Sayers
2024-07-02  9:08                   ` [FFmpeg-devel] [PATCH v4 3/3] all: s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g Andrew Sayers
2024-07-06  9:37                   ` [FFmpeg-devel] [PATCH v4 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Stefano Sabatini
2024-07-06 10:40                     ` Paul B Mahol
2024-07-06 16:49                       ` Michael Niedermayer
2024-07-06 18:03                         ` Andrew Sayers
2024-07-06 10:41                     ` Andrew Sayers
2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 2/3] lavu/opt: Mention AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM in more places Andrew Sayers
2024-06-16 17:08             ` [FFmpeg-devel] [PATCH v3 3/3] all: s/AV_OPT_FLAG_RUNTIME_PARAM/AV_OPT_FLAG_POST_INIT_SETTABLE_PARAM/g Andrew Sayers
2024-06-16 17:22             ` [FFmpeg-devel] [PATCH v3 0/3] s/RUNTIME/POST_INIT_SETTABLE/ Paul B Mahol
2024-07-01 22:26             ` Stefano Sabatini

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git