gl/cocoa: reduce custom main loop latency
authorJulien Isorce <j.isorce@samsung.com>
Sun, 22 Feb 2015 10:03:54 +0000 (10:03 +0000)
committerJulien Isorce <j.isorce@samsung.com>
Sun, 22 Feb 2015 10:37:39 +0000 (10:37 +0000)
commit4c4eec61e667359ff263ab73ae28ff9724c183a3
treea4e15bebdcd3f9e18198b655504aed7fbdd7a987
parent5fa05950464a0132769da54fceb508a32f8144a6
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
e10d2417e2fe7aa4733c076984339b0d61caa169:
"move to CGL and CAOpenGLLayer for rendering".

Then the commit 7d463576271e5a4cc1070780ba1a69c971e8be1d:
"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).
gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m