diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-02-11 15:41:05 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-02-14 14:53:41 +0100 |
commit | 1e7d2007c3aca1cc1cd3b1ca409f4ded6c885f86 (patch) | |
tree | a8348cf24bf8e9209fc60e04ef2eaaf4c0351830 /libavcodec/vaapi_encode_av1.c | |
parent | 8a2c8687bdb03fd2da9734c1340046f157458ca4 (diff) | |
download | ffmpeg-1e7d2007c3aca1cc1cd3b1ca409f4ded6c885f86.tar.gz |
all: use designated initializers for AVOption.unit
Makes it robust against adding fields before it, which will be useful in
following commits.
Majority of the patch generated by the following Coccinelle script:
@@
typedef AVOption;
identifier arr_name;
initializer list il;
initializer list[8] il1;
expression tail;
@@
AVOption arr_name[] = { il, { il1,
- tail
+ .unit = tail
}, ... };
with some manual changes, as the script:
* has trouble with options defined inside macros
* sometimes does not handle options under an #else branch
* sometimes swallows whitespace
Diffstat (limited to 'libavcodec/vaapi_encode_av1.c')
-rw-r--r-- | libavcodec/vaapi_encode_av1.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/vaapi_encode_av1.c b/libavcodec/vaapi_encode_av1.c index 5a9ff0f798..a46b882ab9 100644 --- a/libavcodec/vaapi_encode_av1.c +++ b/libavcodec/vaapi_encode_av1.c @@ -866,27 +866,27 @@ static const AVOption vaapi_encode_av1_options[] = { VAAPI_ENCODE_RC_OPTIONS, { "profile", "Set profile (seq_profile)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, .unit = "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ - { .i64 = value }, 0, 0, FLAGS, "profile" + { .i64 = value }, 0, 0, FLAGS, .unit = "profile" { PROFILE("main", AV_PROFILE_AV1_MAIN) }, { PROFILE("high", AV_PROFILE_AV1_HIGH) }, { PROFILE("professional", AV_PROFILE_AV1_PROFESSIONAL) }, #undef PROFILE { "tier", "Set tier (seq_tier)", - OFFSET(tier), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "tier" }, + OFFSET(tier), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, .unit = "tier" }, { "main", NULL, 0, AV_OPT_TYPE_CONST, - { .i64 = 0 }, 0, 0, FLAGS, "tier" }, + { .i64 = 0 }, 0, 0, FLAGS, .unit = "tier" }, { "high", NULL, 0, AV_OPT_TYPE_CONST, - { .i64 = 1 }, 0, 0, FLAGS, "tier" }, + { .i64 = 1 }, 0, 0, FLAGS, .unit = "tier" }, { "level", "Set level (seq_level_idx)", OFFSET(level), AV_OPT_TYPE_INT, - { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0x1f, FLAGS, "level" }, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0x1f, FLAGS, .unit = "level" }, #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ - { .i64 = value }, 0, 0, FLAGS, "level" + { .i64 = value }, 0, 0, FLAGS, .unit = "level" { LEVEL("2.0", 0) }, { LEVEL("2.1", 1) }, { LEVEL("3.0", 4) }, |