From 1c700b446719e066cd4a66eedbadaf93a97c046e Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 9 Nov 2010 16:19:21 +0000 Subject: fixes for compilation on mac os x git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2720 b956fd51-792f-4845-bead-9b4dfca2ff2c --- mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h | 40 +++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.h') 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 #include extern "C" { +#ifdef HAVE_FFMPEG_INCLUDE_DIR +#include +#include +#include +#include +#include +#include // used for av_rescale_q +#ifdef USE_SWSCALE +#include +#endif +#else #include #include #include #include #include #include // used for av_rescale_q +#ifdef USE_SWSCALE #include +#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 -- cgit v1.2.3