[FFmpeg-devel] WORDS_BIGENDIAN used in installed header avutil.h
Thu Jan 29 20:10:05 CET 2009
Michael Niedermayer wrote:
> On Thu, Jan 29, 2009 at 01:41:42PM +0100, Diego Biurrun wrote:
>> On Thu, Jan 29, 2009 at 12:21:52PM +0100, Michael Niedermayer wrote:
>>> On Wed, Jan 28, 2009 at 03:16:46PM -0800, Baptiste Coudurier wrote:
>>>> Diego Biurrun wrote:
>>>>> Houston, we have a problem. The installed header avutil.h uses
>>>>> WORDS_BIGENDIAN, which is #defined in config.h, which is not installed...
>>>> first, pix_fmt stuff should be moved to another header.
>>>> second, Im pretty sure, these redefines for RGBA/BGRA/32 whatever can be
>>>> avoided if dealt within libswscale when choosing func pointer.
>>> they are part of the public API and they are intentionally part of it.
>>> They are usefull and used, for example in codecs.
Used _internally_ in codecs.
>>> IMHO we shouldnt be butchering the API
>> Ummm, clearly only half of it is part of the API, since the
>> '#ifdef WORDS_BIGENDIAN' amounts to a '#if 0'...
> That may be the implementation but certainly not the API.
> Not every bug in the implementation is part of the API
You can add pixfmt.h and include it in avutil.h, this do not break API.
>> So the goal of the API - different semantics on big-endian systems - is
>> not achieved.
> something like
> grep WORDS_BIGENDIAN config.h && echo '#define WORDS_BIGENDIAN 1' > lib/avutil.h
> cat avutil.h >> lib/avutil.h
> would solve it
> of course that can be done cleaner its just to show it can be solved
> trivially without breaking the API
Well changing the documentation can be done, since behaviour was always
wrong, nobody complained so far ? This lightens that practically nobody
You remove the ifdef WORDS_BIGENDIAN case and keep:
#define PIX_FMT_RGBA PIX_FMT_BGR32
#define PIX_FMT_BGRA PIX_FMT_RGB32
#define PIX_FMT_ARGB PIX_FMT_BGR32_1
#define PIX_FMT_ABGR PIX_FMT_RGB32_1
Then you add checks in libswscale, considering both values since the
goal is to deprecate all _1 (horrible names)
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer http://www.ffmpeg.org
More information about the ffmpeg-devel