]> OCCT Git - occt.git/commitdiff
0029112: Visualization - compilation fails on Ubuntu with libavutil 54.x (FFmpeg...
authorabv <abv@opencascade.com>
Fri, 15 Sep 2017 05:35:07 +0000 (08:35 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 28 Sep 2017 07:47:48 +0000 (10:47 +0300)
Offending macro is undefined to allow compilation with libavutil 54.x

src/Image/Image_VideoRecorder.cxx
src/Image/Image_VideoRecorder.hxx

index 9af4c31583804640d134af0185e75fbbae3f9a32..ba00720bc765622c98af0380265ffaaeb61ca1f9 100644 (file)
@@ -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)
index 85ebd7f0699bb75fde0ce534a876db4f52cdb965..42c282c0c2d71e0b85b24f0b687a77f43344df93 100644 (file)
@@ -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