aboutsummaryrefslogtreecommitdiffstats
path: root/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h')
-rw-r--r--mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h b/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h
index e55b6a96..98d9664a 100644
--- a/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h
+++ b/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h
@@ -25,19 +25,40 @@
#ifndef _FFMPEG_CORE_H_
#define _FFMPEG_CORE_H_
+// TODO: check with configure
+#define HAVE_SWSCALE
+
+#ifdef HAVE_SWSCALE
+#define USE_SWSCALE
+#endif
+
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#include <inttypes.h>
#include <string>
extern "C" {
+#ifdef HAVE_FFMPEG_INCLUDE_DIR
+#include <ffmpeg/avcodec.h>
+#include <ffmpeg/avformat.h>
+#include <ffmpeg/avio.h>
+#include <ffmpeg/avutil.h>
+#include <ffmpeg/mathematics.h>
+#include <ffmpeg/rational.h> // used for av_rescale_q
+#ifdef USE_SWSCALE
+#include <ffmpeg/swscale.h>
+#endif
+#else
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/avutil.h>
#include <libavutil/mathematics.h>
#include <libavutil/rational.h> // used for av_rescale_q
+#ifdef USE_SWSCALE
#include <libswscale/swscale.h>
+#endif
+#endif
}
#include "core/util.h"
@@ -111,6 +132,20 @@ public:
// FFmpeg compatibility with older versions
+#ifndef AV_VERSION_INT
+#define AV_VERSION_INT(a,b,c) (((a)<<16)+((b)<<8)+(c))
+#endif
+
+#ifndef LIBAVFORMAT_VERSION_MAJOR
+#define LIBAVFORMAT_VERSION_MAJOR (LIBAVFORMAT_VERSION_INT>>16)
+#endif
+#ifndef LIBAVCODEC_VERSION_MAJOR
+#define LIBAVCODEC_VERSION_MAJOR (LIBAVCODEC_VERSION_INT>>16)
+#endif
+#ifndef LIBAVUTIL_VERSION_MAJOR
+#define LIBAVUTIL_VERSION_MAJOR (LIBAVUTIL_VERSION_INT>>16)
+#endif
+
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52,64,0)
#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
@@ -132,7 +167,10 @@ public:
(avpkt)->data, (avpkt)->size)
#endif
-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52,69,0)
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52,29,0)
+#define av_register_protocol2(prot, size) \
+ register_protocol(prot)
+#elif LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52,69,0)
#define av_register_protocol2(prot, size) \
av_register_protocol(prot)
#endif