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

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Nov 24 14:06:26 EET 2017


2017-11-24 12:42 GMT+01:00 Mark Thompson <sw at jkqxz.net>:
> 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).

I thought that this is an issue, but I may misremember.

Carl Eugen


More information about the ffmpeg-devel mailing list