diff --git a/src/zm_ffmpeg.h b/src/zm_ffmpeg.h index d88e560a1..5fd3fe5b6 100644 --- a/src/zm_ffmpeg.h +++ b/src/zm_ffmpeg.h @@ -20,48 +20,56 @@ #ifndef ZM_FFMPEG_H #define ZM_FFMPEG_H #include -#if HAVE_LIBAVCODEC #ifdef __cplusplus extern "C" { #endif + +// AVUTIL #if HAVE_LIBAVUTIL_AVUTIL_H #include #include +#include #elif HAVE_FFMPEG_AVUTIL_H #include #include -/*#else -#error "No location for avutils.h found"*/ +#include #endif + +// AVCODEC #if HAVE_LIBAVCODEC_AVCODEC_H #include #elif HAVE_FFMPEG_AVCODEC_H #include -/*#else -#error "No location for avcodec.h found"*/ #endif + +// AVFORMAT #if HAVE_LIBAVFORMAT_AVFORMAT_H #include #elif HAVE_FFMPEG_AVFORMAT_H #include -/*#else -#error "No location for avformat.h found"*/ #endif -#if HAVE_LIBSWSCALE + +// AVDEVICE +#if HAVE_LIBAVDEVICE_AVDEVICE_H +#include +#elif HAVE_FFMPEG_AVDEVICE_H +#include +#endif + +// SWSCALE #if HAVE_LIBSWSCALE_SWSCALE_H #include -#include // this is a fix for error: 'av_rescale_q' was not declared in this scope #elif HAVE_FFMPEG_SWSCALE_H #include -/*#else -#error "No location for swscale.h found"*/ #endif -#endif // HAVE_LIBSWSCALE + #ifdef __cplusplus } #endif +#if ( HAVE_LIBAVUTIL_AVUTIL_H || HAVE_LIBAVCODEC_AVCODEC_H || HAVE_LIBAVFORMAT_AVFORMAT_H || HAVE_LIBAVDEVICE_AVDEVICE_H ) + #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) #if defined(AVIO_WRONLY) #define AVIO_FLAG_WRITE AVIO_WRONLY @@ -87,7 +95,7 @@ extern "C" { #define SWS_CPU_CAPS_SSE2 0x02000000 #endif -#endif // HAVE_LIBAVCODEC +#endif // ( HAVE_LIBAVUTIL_AVUTIL_H || HAVE_LIBAVCODEC_AVCODEC_H || HAVE_LIBAVFORMAT_AVFORMAT_H || HAVE_LIBAVDEVICE_AVDEVICE_H ) #endif // ZM_FFMPEG_H