gstglwindow_cocoa: fix slow render rate
authorAlessandro Decina <alessandro.d@gmail.com>
Tue, 3 Feb 2015 00:07:58 +0000 (11:07 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:54 +0000 (19:31 +0000)
commit0c459222f8f592c0e0ea151c7bf1bb73cd5fcf6b
tree6f0beea95ea5f996f16d20b98192ea3d895c7e67
parentf3beaecfa076cf5ed02c5f619cd8d9fe4d20595b
gstglwindow_cocoa: fix slow render rate

In gst_gl_window_cocoa_draw we used to just call setNeedsDisplay:YES. That was
creating an implicit CA transaction which was getting committed at the next
runloop iteration. Since we don't know how often the main runloop is running,
and when we run it implicitly (from gst_gl_window_cocoa_nsapp_iteration) we only
do so every 200ms, use an explicit CA transaction instead and commit it
immediately. CA transactions nest and debounce automatically so this will never
result in extra work.
gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m