[FFmpeg-devel] [PATCH 07/17] lavc: Mark all AVHWAccel structures as const

Mark Thompson sw at jkqxz.net
Fri Nov 24 13:42:17 EET 2017


On 24/11/17 11:29, Carl Eugen Hoyos wrote:
> 2017-11-24 1:51 GMT+01:00 Mark Thompson <sw at jkqxz.net>:
> 
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index 1ae0344bb2..0972df0bde 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -2635,7 +2635,7 @@ typedef struct AVCodecContext {
>>       * - encoding: unused.
>>       * - decoding: Set by libavcodec
>>       */
>> -    struct AVHWAccel *hwaccel;
>> +    const struct AVHWAccel *hwaccel;
> 
> Please bump minor (and perhaps add a note for api),

Sure.

"""
2017-xx-xx - xxxxxxx - lavc 58.x+1.100 - avcodec.h
  Add const to AVCodecContext.hwaccel.
"""

> iirc this has an impact for some toolchains, no?

I don't think so?  C requires that const-qualified and unqualified versions of a type have the same representation.  Adding const could affect C++ name mangling, but we don't support building directly with C++ ("extern \"C\"" is needed).

- Mark


More information about the ffmpeg-devel mailing list