limelight-stream/limelight-pc — pull request #20 by spartango (2014-02-02 08:59:36+00:00)
Title: Fast OpenGL renderer

SwingCpuDecoderRenderer has been supplanted by a faster renderer that uses OpenGL (via JOGL).

SwingCpuDecoderRenderer used Java2D's software rendering to display images in StreamFrame, and thus was rather slow--particularly on platforms with limited CPU power (e.g. Core 2 Duo). Using the included DebugRenderer, I recorded rendering rates of <20fps on a 720p60 stream, where the majority of the time was spent in Graphics.drawImage(). The reason for these low speeds is the necessity for the renderer to modify the BufferedImage's pixels every decode, forcing software rendering.

GLDecoderRender uses cross-platform JOGL (Java bindings to OpenGL) to alleviate the software rendering bottleneck. It builds an OpenGL texture from the decoded image buffer and renders that in a hardware-accelerated manner. This acceleration reduces the rendering times from 30-50ms (on a C2D) to 2-5ms, enabling proper 60fps streaming (15ms decodes are average on a C2D) despite the limited CPU.

Note that this PR brings in JOGL with its prepackaged native bindings and gluegen dependency. Native bindings are included for all common platforms and automatically selected.