Skip to content

Commit

Permalink
OSX: Cross compilation fixes for libmythtv
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Kendall <mkendall@mythtv.org>
(cherry picked from commit dd6e0ef)
  • Loading branch information
Lawrence Rust authored and Mark Kendall committed Mar 16, 2011
1 parent 7f15abd commit e28fe98
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
12 changes: 11 additions & 1 deletion mythtv/libs/libmythtv/bswap.h
Expand Up @@ -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)
{
Expand Down
7 changes: 6 additions & 1 deletion mythtv/libs/libmythtv/libmythtv.pro
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions mythtv/libs/libmythtv/privatedecoder_vda.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions mythtv/libs/libmythtv/privatedecoder_vda.h
Expand Up @@ -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"

Expand Down
4 changes: 4 additions & 0 deletions mythtv/libs/libmythtv/videoout_quartz.cpp
Expand Up @@ -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>

Expand Down

0 comments on commit e28fe98

Please sign in to comment.