[FFmpeg-devel] [PATCH v2 29/36] h264_metadata: Add option to set the level of the stream

Mark Thompson sw at jkqxz.net
Sun Jun 17 17:20:04 EEST 2018


On 15/06/18 03:49, Xiang, Haihao wrote:
> On Fri, 2018-06-08 at 00:43 +0100, Mark Thompson wrote:
>> ---
>>  doc/bitstream_filters.texi     |  9 +++++
>>  libavcodec/h264_metadata_bsf.c | 90
>> ++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 99 insertions(+)
>>
>> ...
>> diff --git a/libavcodec/h264_metadata_bsf.c b/libavcodec/h264_metadata_bsf.c
>> index 90ad4aad98..cb1a835fb8 100644
>> --- a/libavcodec/h264_metadata_bsf.c
>> +++ b/libavcodec/h264_metadata_bsf.c
>> ...
>> @@ -683,6 +743,36 @@ static const AVOption h264_metadata_options[] = {
>>          0, AV_OPT_TYPE_CONST,
>>          { .i64 = FLIP_VERTICAL },   .flags = FLAGS, .unit = "flip" },
>>  
>> +    { "level", "Set level (table A-1)",
>> +        OFFSET(level), AV_OPT_TYPE_INT,
>> +        { .i64 = LEVEL_UNSET }, LEVEL_UNSET, 0xff, FLAGS, "level" },
>> +    { "auto", "Attempt to guess level from stream properties",
>> +        0, AV_OPT_TYPE_CONST,
>> +        { .i64 = LEVEL_AUTO }, 0, 0, FLAGS, "level" },
> 
> Could you please use the same code style for AV_OPT_TYPE_CONST ?
> 
>> +#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
>> +        { .i64 = value }, 0, 0, FLAGS, "level"
> 
> Also here.

Both changed to use the designated initialiser.

>> +    { LEVEL("1",   10) },
>> +    { LEVEL("1b",   9) },
>> +    { LEVEL("1.1", 11) },
>> +    { LEVEL("1.2", 12) },
>> +    { LEVEL("1.3", 13) },
>> +    { LEVEL("2",   20) },
>> +    { LEVEL("2.1", 21) },
>> +    { LEVEL("2.2", 22) },
>> +    { LEVEL("3",   30) },
>> +    { LEVEL("3.1", 31) },
>> +    { LEVEL("3.2", 32) },
>> +    { LEVEL("4",   40) },
>> +    { LEVEL("4.1", 41) },
>> +    { LEVEL("4.2", 42) },
>> +    { LEVEL("5",   50) },
>> +    { LEVEL("5.1", 51) },
>> +    { LEVEL("5.2", 52) },
>> +    { LEVEL("6",   60) },
>> +    { LEVEL("6.1", 61) },
>> +    { LEVEL("6.2", 62) },
>> +#undef LEVEL
>> +
>>      { NULL }
>>  };
>>  

Thanks,

- Mark


More information about the ffmpeg-devel mailing list