mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
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
This commit is contained in:
parent
8a2c8687bd
commit
1e7d2007c3
338 changed files with 4656 additions and 4656 deletions
|
|
@ -644,20 +644,20 @@ static const AVOption vaapi_encode_mpeg2_options[] = {
|
|||
|
||||
{ "profile", "Set profile (in profile_and_level_indication)",
|
||||
OFFSET(profile), AV_OPT_TYPE_INT,
|
||||
{ .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 7, FLAGS, "profile" },
|
||||
{ .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 7, 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("simple", AV_PROFILE_MPEG2_SIMPLE) },
|
||||
{ PROFILE("main", AV_PROFILE_MPEG2_MAIN) },
|
||||
#undef PROFILE
|
||||
|
||||
{ "level", "Set level (in profile_and_level_indication)",
|
||||
OFFSET(level), AV_OPT_TYPE_INT,
|
||||
{ .i64 = 4 }, 0, 15, FLAGS, "level" },
|
||||
{ .i64 = 4 }, 0, 15, 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("low", 10) },
|
||||
{ LEVEL("main", 8) },
|
||||
{ LEVEL("high_1440", 6) },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue