Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#4216 closed defect (fixed)

#define PixelFormat AVPixelFormat breaks user code

Reported by: kivalaatikko Owned by:
Priority: normal Component: avutil
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

In avutil/pixfmt.h

#define PixelFormat AVPixelFormat

prevents users from using the word "PixelFormat" anywhere in their own code, even if in namespaces.

Probably fixable by changing to typedef instead.

Change History (4)

comment:1 by Hendrik, 9 years ago

You can get rid of this with "#define FF_API_PIX_FMT 0" before including the ffmpeg headers.

comment:2 by gjdfgh, 9 years ago

If it were a typedef, it would break C code which uses "enum PixelFormat".

But yeah, all exported identifiers are supposed to be prefixed with AV, av_, or FF_, and this is just a compatibility hack for older software still using the old identifiers. Maybe it's time to drop them?

comment:3 by Elon Musk, 8 years ago

Resolution: fixed
Status: newclosed

comment:4 by Carl Eugen Hoyos, 8 years ago

Keywords: PixelFormat removed
Version: 2.5.2git-master
Note: See TracTickets for help on using tickets.