summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLawrence Rust <lvr@softsystem.co.uk>2011-03-16 02:39:28 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-03-16 02:43:10 (GMT)
commite28fe982692d5578a047f7b9d1c92cfe50c97f5e (patch)
tree84f597f37bf6f816a919623042e4364df5fd9a85
parent7f15abd44c5f21c443a2f6820a1e3a2daf9a1be1 (diff)
OSX: Cross compilation fixes for libmythtv
Signed-off-by: Mark Kendall <mkendall@mythtv.org> (cherry picked from commit dd6e0efc485e83a7b57864a9cdb987cdd5e9328d)
-rw-r--r--mythtv/libs/libmythtv/bswap.h12
-rw-r--r--mythtv/libs/libmythtv/libmythtv.pro7
-rw-r--r--mythtv/libs/libmythtv/privatedecoder_vda.cpp8
-rw-r--r--mythtv/libs/libmythtv/privatedecoder_vda.h4
-rw-r--r--mythtv/libs/libmythtv/videoout_quartz.cpp4
5 files changed, 33 insertions, 2 deletions
diff --git a/mythtv/libs/libmythtv/bswap.h b/mythtv/libs/libmythtv/bswap.h
index 6683c46..4856de9 100644
--- a/mythtv/libs/libmythtv/bswap.h
+++ b/mythtv/libs/libmythtv/bswap.h
@@ -2,7 +2,17 @@
#define MYTHTV_BSWAP_H
#include <stdint.h> /* uint32_t */
-#include <byteswap.h> /* bswap_16|32|64 */
+
+#ifdef __linux__
+# include <byteswap.h> /* bswap_16|32|64 */
+#elif defined __APPLE__
+# include <libkern/OSByteOrder.h>
+# define bswap_16(x) OSSwapInt16(x)
+# define bswap_32(x) OSSwapInt32(x)
+# define bswap_64(x) OSSwapInt64(x)
+#else
+# error Byte swapping functions not defined for this platform
+#endif
static __inline__ double bswap_dbl(double x)
{
diff --git a/mythtv/libs/libmythtv/libmythtv.pro b/mythtv/libs/libmythtv/libmythtv.pro
index 9635faf..3d26e0a 100644
--- a/mythtv/libs/libmythtv/libmythtv.pro
+++ b/mythtv/libs/libmythtv/libmythtv.pro
@@ -87,7 +87,12 @@ QMAKE_LFLAGS_SHLIB += $${FREETYPE_LIBS}
macx {
# Mac OS X Frameworks
- FWKS = AGL ApplicationServices Carbon Cocoa CoreFoundation CoreVideo OpenGL QuickTime IOKit
+ FWKS = AGL ApplicationServices Carbon Cocoa CoreFoundation OpenGL QuickTime IOKit
+ using_quartz_video {
+ FWKS += QuartzCore
+ } else {
+ FWKS += CoreVideo
+ }
using_firewire:using_backend: FWKS += IOKit
diff --git a/mythtv/libs/libmythtv/privatedecoder_vda.cpp b/mythtv/libs/libmythtv/privatedecoder_vda.cpp
index be26f03..0414042 100644
--- a/mythtv/libs/libmythtv/privatedecoder_vda.cpp
+++ b/mythtv/libs/libmythtv/privatedecoder_vda.cpp
@@ -9,6 +9,10 @@
#include "myth_imgconvert.h"
#include "util-osx-cocoa.h"
#include "privatedecoder_vda.h"
+#ifdef USING_QUARTZ_VIDEO
+#undef CodecType
+#import "QuickTime/ImageCompression.h"
+#endif
extern "C" {
#include "libavformat/avformat.h"
@@ -191,7 +195,11 @@ bool PrivateDecoderVDA::Init(const QString &decoder,
CFDictionaryCreateMutable(kCFAllocatorDefault, 1,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
+#ifdef USING_QUARTZ_VIDEO
+ OSType cvPixelFormatType = k422YpCbCr8PixelFormat;
+#else
OSType cvPixelFormatType = kCVPixelFormatType_422YpCbCr8;
+#endif
CFNumberRef pixelFormat = CFNumberCreate(kCFAllocatorDefault,
kCFNumberSInt32Type,
&cvPixelFormatType);
diff --git a/mythtv/libs/libmythtv/privatedecoder_vda.h b/mythtv/libs/libmythtv/privatedecoder_vda.h
index cbb500b..eb79cc4 100644
--- a/mythtv/libs/libmythtv/privatedecoder_vda.h
+++ b/mythtv/libs/libmythtv/privatedecoder_vda.h
@@ -6,7 +6,11 @@
#include <QList>
#import "CoreFoundation/CoreFoundation.h"
+#ifdef USING_QUARTZ_VIDEO
+#import "QuartzCore/CoreVideo.h"
+#else
#import "CoreVideo/CoreVideo.h"
+#endif
#include "privatedecoder_vda_defs.h"
#include "privatedecoder.h"
diff --git a/mythtv/libs/libmythtv/videoout_quartz.cpp b/mythtv/libs/libmythtv/videoout_quartz.cpp
index 3485b26..710361f 100644
--- a/mythtv/libs/libmythtv/videoout_quartz.cpp
+++ b/mythtv/libs/libmythtv/videoout_quartz.cpp
@@ -51,9 +51,13 @@ using namespace std;
#include "util-osx.h"
+#ifdef USING_QUARTZ_VIDEO
+#import <QuartzCore/CoreVideo.h>
+#else
#import <CoreGraphics/CGBase.h>
#import <CoreGraphics/CGDisplayConfiguration.h>
#import <CoreGraphics/CGImage.h>
+#endif
#import <Carbon/Carbon.h>
#import <QuickTime/QuickTime.h>