Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

OSX: Cross compilation fixes for libmythtv

Signed-off-by: Mark Kendall <mkendall@mythtv.org>
  • Loading branch information...
commit dd6e0efc485e83a7b57864a9cdb987cdd5e9328d 1 parent cf64c8b
Lawrence Rust authored Mark Kendall committed
View
12 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)
{
View
7 mythtv/libs/libmythtv/libmythtv.pro
@@ -84,7 +84,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
View
8 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);
View
4 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"
View
4 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>
Please sign in to comment.
Something went wrong with that request. Please try again.