gl/cocoa: reduce custom main loop latency

This fix a very slow rendering rate regression that only
happens when using gst-launch, i.e. in the case where
the main thread does not run any NSApp loop.

Git bisect reported it has been introduced by the commit
e10d2417e2:
"move to CGL and CAOpenGLLayer for rendering".

Then the commit 7d46357627:
"gstglwindow_cocoa: fix slow render rate" attempted to fix
the slow rendering rate problem when using gst-launch.

At least for me it does not work. I tried several
combinations, for example to flush CA transactions in the
custom app loop, as mentioned in the doc, but the only solution
that fixes the slow rendering is by reducing the loop latency.
From what I tested, no need to put less than 60ms, even if the
framerate has an interval much lower (16.6ms for 60 fps).
This commit is contained in:
Julien Isorce 2015-02-22 10:03:54 +00:00
parent 5fa0595046
commit 4c4eec61e6

View file

@ -304,7 +304,7 @@ gst_gl_context_cocoa_create_context (GstGLContext *context, GstGLAPI gl_api,
pool = [[NSAutoreleasePool alloc] init];
#ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION
priv->source_id = g_timeout_add (200, gst_gl_window_cocoa_nsapp_iteration, NULL);
priv->source_id = g_timeout_add (60, gst_gl_window_cocoa_nsapp_iteration, NULL);
#endif
priv->gl_context = nil;