1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

cmake: cleanup ffmpeg detection

This commit is contained in:
Alexander Alekhin
2016-11-27 23:31:04 +03:00
committed by Alexander Alekhin
parent b5b3a0474d
commit 39ff8a0d26
8 changed files with 109 additions and 142 deletions
+2 -42
View File
@@ -75,48 +75,8 @@ extern "C" {
#include <libavutil/imgutils.h>
#endif
#ifdef WIN32
#define HAVE_FFMPEG_SWSCALE 1
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#else
#ifndef HAVE_FFMPEG_SWSCALE
#error "libswscale is necessary to build the newer OpenCV ffmpeg wrapper"
#endif
// if the header path is not specified explicitly, let's deduce it
#if !defined HAVE_FFMPEG_AVCODEC_H && !defined HAVE_LIBAVCODEC_AVCODEC_H
#if defined(HAVE_GENTOO_FFMPEG)
#define HAVE_LIBAVCODEC_AVCODEC_H 1
#if defined(HAVE_FFMPEG_SWSCALE)
#define HAVE_LIBSWSCALE_SWSCALE_H 1
#endif
#elif defined HAVE_FFMPEG
#define HAVE_FFMPEG_AVCODEC_H 1
#if defined(HAVE_FFMPEG_SWSCALE)
#define HAVE_FFMPEG_SWSCALE_H 1
#endif
#endif
#endif
#if defined(HAVE_FFMPEG_AVCODEC_H)
#include <ffmpeg/avcodec.h>
#endif
#if defined(HAVE_FFMPEG_SWSCALE_H)
#include <ffmpeg/swscale.h>
#endif
#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
#include <libavcodec/avcodec.h>
#endif
#if defined(HAVE_LIBSWSCALE_SWSCALE_H)
#include <libswscale/swscale.h>
#endif
#endif
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#ifdef __cplusplus
}
+1 -18
View File
@@ -60,24 +60,7 @@ extern "C" {
#include <errno.h>
#endif
// if the header path is not specified explicitly, let's deduce it
#if !defined HAVE_FFMPEG_AVCODEC_H && !defined HAVE_LIBAVCODEC_AVCODEC_H
#if defined(HAVE_GENTOO_FFMPEG)
#define HAVE_LIBAVFORMAT_AVFORMAT_H 1
#elif defined HAVE_FFMPEG
#define HAVE_FFMPEG_AVFORMAT_H 1
#endif
#if defined(HAVE_FFMPEG_AVFORMAT_H)
#include <ffmpeg/avformat.h>
#endif
#if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(WIN32)
#include <libavformat/avformat.h>
#endif
#endif
#include <libavformat/avformat.h>
#ifdef __cplusplus
}