From: <bi...@ke...> - 2007-05-17 09:42:12
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: bilboed Date: Thu May 17 2007 09:42:01 UTC Log message: * sys/osxvideo/osxvideosink.h: * sys/osxvideo/osxvideosink.m: Fix a stupid #if vs #ifdef bug. Should use the proper colorspace now. Use a separate thread/task for the cocoa event_loop, else it wouldn't stop. Modified files: . : ChangeLog sys/osxvideo : osxvideosink.h osxvideosink.m Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.2552&r2=1.2553 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/sys/osxvideo/osxvideosink.h.diff?r1=1.4&r2=1.5 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/sys/osxvideo/osxvideosink.m.diff?r1=1.7&r2=1.8 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.2552 retrieving revision 1.2553 diff -u -d -r1.2552 -r1.2553 --- ChangeLog 16 May 2007 17:14:41 -0000 1.2552 +++ ChangeLog 17 May 2007 09:41:48 -0000 1.2553 @@ -1,3 +1,11 @@ +2007-05-17 Edward Hervey <ed...@fl...> + + * sys/osxvideo/osxvideosink.h: + * sys/osxvideo/osxvideosink.m: + Fix a stupid #if vs #ifdef bug. Should use the proper colorspace now. + Use a separate thread/task for the cocoa event_loop, else it wouldn't + stop. 2007-05-16 Tim-Philipp Müller <tim at centricular dot net> * gst/real/gstrealaudiodec.c: (gst_real_audio_dec_chain), Index: osxvideosink.h RCS file: /cvs/gstreamer/gst-plugins-bad/sys/osxvideo/osxvideosink.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- osxvideosink.h 14 Mar 2007 16:30:19 -0000 1.4 +++ osxvideosink.h 17 May 2007 09:41:48 -0000 1.5 @@ -84,6 +84,8 @@ gboolean embed; gboolean fullscreen; gboolean sw_scaling_failed; + GstTask *event_loop; + GStaticRecMutex loop_lock; }; struct _GstOSXVideoSinkClass { Index: osxvideosink.m RCS file: /cvs/gstreamer/gst-plugins-bad/sys/osxvideo/osxvideosink.m,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- osxvideosink.m 29 Apr 2007 13:56:18 -0000 1.7 +++ osxvideosink.m 17 May 2007 09:41:48 -0000 1.8 @@ -51,7 +51,7 @@ "framerate = (fraction) [ 0, MAX ], " "width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ], " -#ifdef G_BYTE_ORDER == G_BIG_ENDIAN +#if G_BYTE_ORDER == G_BIG_ENDIAN "format = (fourcc) YUY2") #else "format = (fourcc) UYVY") @@ -92,7 +92,10 @@ cocoa_event_loop (GstOSXVideoSink * vsink) { NSAutoreleasePool *pool; + gboolean ret = TRUE; + GST_DEBUG_OBJECT (vsink, "Entering event loop"); + pool = [[NSAutoreleasePool alloc] init]; if ([NSApp isRunning]) { @@ -110,7 +113,9 @@ [pool release]; - return TRUE; + GST_DEBUG_OBJECT (vsink, "Leaving event loop with ret : %d", ret); + return ret; } static NSString * @@ -254,7 +259,10 @@ [NSApp setRunning]; // insert event dispatch in the glib main loop - g_idle_add ((GSourceFunc) cocoa_event_loop, osxvideosink); + g_static_rec_mutex_init (&osxvideosink->loop_lock); + osxvideosink->event_loop = gst_task_create ((GstTaskFunction) cocoa_event_loop, osxvideosink); + gst_task_set_lock (osxvideosink->event_loop, &osxvideosink->loop_lock); + gst_task_start (osxvideosink->event_loop); } else { GstStructure *s; GstMessage *msg; @@ -294,6 +302,8 @@ g_return_if_fail (GST_IS_OSX_VIDEO_SINK (osxvideosink)); [osxwindow->pool release]; + if (osxvideosink->event_loop) + gst_task_stop (osxvideosink->event_loop); g_free (osxwindow); @@ -379,6 +389,10 @@ osxvideosink = GST_OSX_VIDEO_SINK (element); + GST_DEBUG_OBJECT (osxvideosink, "%s => %s", + gst_element_state_get_name(GST_STATE_TRANSITION_CURRENT (transition)), + gst_element_state_get_name(GST_STATE_TRANSITION_NEXT (transition))); switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: /* Creating our window and our image */ |