On 05/11/17 19:36, Diego Biurrun wrote:
> This is a general remark rather than a review comment, I just happened to 
> notice
> something in this patch that I have been wondering about for a long time.
> 
> On Sun, Nov 05, 2017 at 12:00:00AM +0000, Mark Thompson wrote:
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -2735,6 +2736,61 @@ typedef struct AVProfile {
>>  
>> +enum {
>> +    AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01,
>> +    AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = 0x02,
>> +    AV_CODEC_HW_CONFIG_METHOD_INTERNAL      = 0x04,
>> +    AV_CODEC_HW_CONFIG_METHOD_AD_HOC        = 0x08,
>> +};
> 
> Why create an anonymous, instead of a named, enum here (or really anywhere)?
> If it is named, it could be passed as a function parameter and similar
> things...

It contains flags - combinations of values are not members of the enum type.

(While the rules do imply that they are representable because it must be 
compatible with some implementation-chosen integer type, I would prefer that 
variables of enum type really do only contain members of the enumeration.)

- Mark
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to