diff options
author | Julien Isorce <julien.isorce@gmail.com> | 2012-04-20 12:39:01 +0200 |
---|---|---|
committer | Julien Isorce <julien.isorce@gmail.com> | 2012-04-20 12:39:01 +0200 |
commit | 421ad67fb2194cf66867e39b2fef8f6946717b8a (patch) | |
tree | 0c8a0c7b5a40796b8edd5c241a7a34fcc23e7036 | |
parent | 872dc318fb7b724d4389e065ce847ad649588748 (diff) |
cocoa example: remove white spaces
-rwxr-xr-x | tests/examples/cocoa/videoxoverlay/main.m | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/tests/examples/cocoa/videoxoverlay/main.m b/tests/examples/cocoa/videoxoverlay/main.m index e0dc384..396a6d4 100755 --- a/tests/examples/cocoa/videoxoverlay/main.m +++ b/tests/examples/cocoa/videoxoverlay/main.m @@ -26,11 +26,11 @@ m_loop = loop; m_pipeline = pipeline; m_isClosed = FALSE; - + self = [super initWithContentRect: contentRect styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask) backing: NSBackingStoreBuffered defer: NO screen: nil]; - + [self setReleasedWhenClosed:NO]; [NSApp setDelegate:self]; @@ -40,15 +40,15 @@ } - (GMainLoop*) loop { - return m_loop; + return m_loop; } - (GstElement*) pipeline { - return m_pipeline; + return m_pipeline; } - (gboolean) isClosed { - return m_isClosed; + return m_isClosed; } - (void) customClose { @@ -102,13 +102,13 @@ static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, MainWind static void end_stream_cb(GstBus* bus, GstMessage* message, MainWindow* window) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - + gst_element_set_state ([window pipeline], GST_STATE_NULL); - g_object_unref ([window pipeline]); + g_object_unref ([window pipeline]); g_main_loop_quit ([window loop]); - + [window performSelectorOnMainThread:@selector(customClose) withObject:nil waitUntilDone:YES]; - + [pool release]; } @@ -117,7 +117,7 @@ static gpointer thread_func (MainWindow* window) #ifdef GNUSTEP GSRegisterCurrentThread(); #endif - + g_main_loop_run ([window loop]); #ifdef GNUSTEP @@ -137,10 +137,10 @@ int main(int argc, char **argv) { int width = 640; int height = 480; - + GMainLoop *loop = NULL; GstElement *pipeline = NULL; - + GstElement *videosrc = NULL; GstElement *videosink = NULL; GstCaps *caps=NULL; @@ -152,31 +152,31 @@ int main(int argc, char **argv) MainWindow *window=nil; g_print("app created\n"); - + gst_init (&argc, &argv); loop = g_main_loop_new (NULL, FALSE); pipeline = gst_pipeline_new ("pipeline"); - + videosrc = gst_element_factory_make ("videotestsrc", "videotestsrc"); videosink = gst_element_factory_make ("glimagesink", "glimagesink"); - + g_object_set(G_OBJECT(videosrc), "num-buffers", 500, NULL); gst_bin_add_many (GST_BIN (pipeline), videosrc, videosink, NULL); - + caps = gst_caps_new_simple("video/x-raw-yuv", "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, "framerate", GST_TYPE_FRACTION, 25, 1, - "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), NULL); ok = gst_element_link_filtered(videosrc, videosink, caps); gst_caps_unref(caps); if (!ok) g_warning("could not link videosrc to videosink\n"); - + #ifdef GNUSTEP gst_element_set_state (pipeline, GST_STATE_PAUSED); GstState state = GST_STATE_PAUSED; @@ -184,15 +184,15 @@ int main(int argc, char **argv) g_print("pipeline paused\n"); GSRegisterCurrentThread(); #endif - + pool = [[NSAutoreleasePool alloc] init]; #ifndef GNUSTEP [NSApplication sharedApplication]; #endif - + rect.origin.x = 0; rect.origin.y = 0; rect.size.width = width; rect.size.height = height; - + window = [[MainWindow alloc] initWithContentRect:rect Loop:loop Pipeline:pipeline]; bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); @@ -202,35 +202,35 @@ int main(int argc, char **argv) g_signal_connect(bus, "message::eos", G_CALLBACK(end_stream_cb), window); gst_bus_set_sync_handler (bus, (GstBusSyncHandler) create_window, window); gst_object_unref (bus); - + loop_thread = g_thread_create ( (GThreadFunc) thread_func, window, TRUE, NULL); - + gst_element_set_state (pipeline, GST_STATE_PLAYING); - - [window orderFront:window]; - + + [window orderFront:window]; + #ifndef GNUSTEP while (![window isClosed]) { - NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate dateWithTimeIntervalSinceNow:1] + NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate dateWithTimeIntervalSinceNow:1] inMode:NSDefaultRunLoopMode dequeue:YES]; if (event) [NSApp sendEvent:event]; } #endif - + g_thread_join (loop_thread); - - [window release]; - + + [window release]; + [pool release]; - + gst_element_set_state (pipeline, GST_STATE_NULL); - + #ifdef GNUSTEP GSUnregisterCurrentThread(); #endif - + return 0; } |