GST_DEBUG_CATEGORY (gst_debug_osx_video_sink);
#define GST_CAT_DEFAULT gst_debug_osx_video_sink
+#ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION
#include <pthread.h>
extern void _CFRunLoopSetCurrent (CFRunLoopRef rl);
extern pthread_t _CFMainPThread;
-
-
+#endif
static GstStaticPadTemplate gst_osx_video_sink_sink_template_factory =
GST_STATIC_PAD_TEMPLATE ("sink",
};
static void gst_osx_video_sink_osxwindow_destroy (GstOSXVideoSink * osxvideosink);
+
+#ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION
static GMutex _run_loop_check_mutex;
static GMutex _run_loop_mutex;
static GCond _run_loop_cond;
+#endif
+
static GstOSXVideoSinkClass *sink_class = NULL;
static GstVideoSinkClass *parent_class = NULL;
[pool release];
}
+#ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION
/* Poll for cocoa events */
static void
run_ns_app_loop (void) {
gst_osx_video_sink_stop_cocoa_loop (GstOSXVideoSink * osxvideosink)
{
}
+#endif
/* This function handles osx window creation */
static gboolean
rect.size.height = (float) osxwindow->height;
osxwindow->gstview =[[GstGLView alloc] initWithFrame:rect];
-
+#ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION
gst_osx_video_sink_run_cocoa_loop (osxvideosink);
[osxwindow->gstview setMainThread:sink_class->ns_app_thread];
+#endif
if (osxvideosink->superview == NULL) {
GST_INFO_OBJECT (osxvideosink, "emitting prepare-xwindow-id");
osxvideosink->osxvideosinkobject,
@selector(destroy), (id) nil, YES);
GST_OBJECT_UNLOCK (osxvideosink);
+#ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION
gst_osx_video_sink_stop_cocoa_loop (osxvideosink);
+#endif
[pool release];
}
NSRect rect;
unsigned int mask;
+ [NSApplication sharedApplication];
+
osxwindow->internal = TRUE;
mask = NSTitledWindowMask |
[pool release];
}
+#ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION
-(void) nsAppThread
{
NSAutoreleasePool *pool;
g_cond_signal (&_run_loop_cond);
g_mutex_unlock (&_run_loop_mutex);
}
+#endif
@end