#include <SDL/SDL_syswm.h>
#include <sys/time.h>
+#ifdef __DARWIN__
+# include "consumer_sdl_osx_hack.h"
+# import <AppKit/NSApplication.h>
+# import <Foundation/Foundation.h>
+#endif
+
+
/** This classes definition.
*/
mlt_consumer consumer_sdl_init( char *arg )
{
+#ifdef __DARWIN__
+ // Initialize Cocoa
+ NSApplicationLoad();
+ [NSApplication sharedApplication];
+
+ // Spawn a fake thread so that cocoa knows to be multithreaded
+ DummyThread *dummy = [[DummyThread alloc] init];
+ [NSThread detachNewThreadSelector:@selector(startThread:) toTarget:dummy withObject:nil];
+#endif
+
// Create the consumer object
consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 );
// Identify the arg
consumer_sdl this = arg;
+#ifdef __DARWIN__
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+#endif
+
// Obtain time of thread start
struct timeval now;
int64_t start = 0;
mlt_consumer_stopped( &this->parent );
+#ifdef __DARWIN__
+ [pool release];
+#endif
+
return NULL;
}
// Identify the arg
consumer_sdl this = arg;
+#ifdef __DARWIN__
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+#endif
+
// Get the consumer
mlt_consumer consumer = &this->parent;
this->sdl_overlay = NULL;
this->audio_avail = 0;
+#ifdef __DARWIN__
+ [pool release];
+#endif
+
return NULL;
}
// Lock the display
sdl_lock_display();
+#ifndef __DARWIN__
// Get the wm structure
if ( SDL_GetWMInfo( &wm ) == 1 )
{
*height = attr.height;
}
}
+#endif
// Unlock the display
sdl_lock_display();