Opened 6 years ago

Closed 4 years ago

Last modified 4 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


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 Changed 6 years ago by heleppkes

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

comment:2 Changed 6 years ago by gjdfgh

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 Changed 4 years ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 4 years ago by cehoyos

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