From: abv Date: Fri, 15 Sep 2017 05:35:07 +0000 (+0300) Subject: 0029112: Visualization - compilation fails on Ubuntu with libavutil 54.x (FFmpeg... X-Git-Tag: V7_3_0_beta~250 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=746f3d7ab2ecfdc13c4c8bc1cd9f0cc2d44228da;p=occt.git 0029112: Visualization - compilation fails on Ubuntu with libavutil 54.x (FFmpeg 2.7.6) Offending macro is undefined to allow compilation with libavutil 54.x --- diff --git a/src/Image/Image_VideoRecorder.cxx b/src/Image/Image_VideoRecorder.cxx index 9af4c31583..ba00720bc7 100644 --- a/src/Image/Image_VideoRecorder.cxx +++ b/src/Image/Image_VideoRecorder.cxx @@ -51,6 +51,13 @@ extern "C" #endif }; +// Undefine macro that clashes with name used by field of Image_VideoParams; +// this macro is defined in headers of older versions of libavutil +// (see definition of macro FF_API_PIX_FMT in version.h) +#ifdef PixelFormat +#undef PixelFormat +#endif + #endif IMPLEMENT_STANDARD_RTTIEXT(Image_VideoRecorder, Standard_Transient) diff --git a/src/Image/Image_VideoRecorder.hxx b/src/Image/Image_VideoRecorder.hxx index 85ebd7f069..42c282c0c2 100644 --- a/src/Image/Image_VideoRecorder.hxx +++ b/src/Image/Image_VideoRecorder.hxx @@ -28,6 +28,13 @@ struct AVCodec; struct AVFrame; struct SwsContext; +// Undefine macro that clashes with name used by field of Image_VideoParams; +// this macro is defined in headers of older versions of libavutil +// (see definition of macro FF_API_PIX_FMT in version.h) +#ifdef PixelFormat +#undef PixelFormat +#endif + //! Auxiliary structure defining video parameters. //! Please refer to FFmpeg documentation for defining text values. struct Image_VideoParams