sys/osxvideo/osxvideosink.m (gst_osx_video_sink_osxwindow_destroy)

Original commit message from CVS:
2008-03-18  Andy Wingo  <wingo@pobox.com>

* sys/osxvideo/osxvideosink.m
(gst_osx_video_sink_osxwindow_destroy)
(gst_osx_video_sink_osxwindow_new): Actually set a lock on the
task, whoopdee.
(cocoa_event_loop): Pacify the taymans by upping the usleepage to
2 ms.
This commit is contained in:
Andy Wingo 2008-03-18 15:03:06 +00:00
parent a6267f383e
commit f7edc0c690
3 changed files with 23 additions and 1 deletions

View file

@ -1,3 +1,21 @@
2008-03-18 Andy Wingo <wingo@pobox.com>
* sys/osxvideo/osxvideosink.m
(gst_osx_video_sink_osxwindow_destroy)
(gst_osx_video_sink_osxwindow_new): Actually set a lock on the
task, whoopdee.
(cocoa_event_loop): Pacify the taymans by upping the usleepage to
2 ms.
2008-03-18 Andy Wingo <wingo@pobox.com>
* sys/osxvideo/osxvideosink.m
(gst_osx_video_sink_osxwindow_destroy)
(gst_osx_video_sink_osxwindow_new): Actually set a lock on the
task, whoopdee.
(cocoa_event_loop): Pacify the taymans by upping the usleepage to
2 ms.
2008-03-17 Tim-Philipp Müller <tim at centricular dot net>
Patch by: William M. Brack <wbrack at mmm com hk>

View file

@ -77,6 +77,7 @@ struct _GstOSXVideoSink {
gint fps_d;
GstTask *event_task;
GStaticRecMutex event_task_lock;
/* Unused */
gint pixel_width, pixel_height;

View file

@ -125,7 +125,7 @@ cocoa_event_loop (GstOSXVideoSink * vsink)
untilDate:[NSDate distantPast]
inMode:NSDefaultRunLoopMode dequeue:YES ];
if ( event == nil ) {
g_usleep (100);
g_usleep (2000);
break;
} else {
switch ([event type]) {
@ -280,8 +280,10 @@ gst_osx_video_sink_osxwindow_new (GstOSXVideoSink * osxvideosink, gint width,
[NSApp setDelegate:[[GstAppDelegate alloc] init]];
[NSApp setRunning];
g_static_rec_mutex_init (&osxvideosink->event_task_lock);
osxvideosink->event_task = gst_task_create ((GstTaskFunction)cocoa_event_loop,
osxvideosink);
gst_task_set_lock (osxvideosink->event_task, &osxvideosink->event_task_lock);
gst_task_start (osxvideosink->event_task);
} else {
GstStructure *s;
@ -327,6 +329,7 @@ gst_osx_video_sink_osxwindow_destroy (GstOSXVideoSink * osxvideosink,
gst_task_join (osxvideosink->event_task);
gst_object_unref (osxvideosink->event_task);
osxvideosink->event_task = NULL;
g_static_rec_mutex_free (&osxvideosink->event_task_lock);
}
g_free (osxwindow);