libgdx/libgdx — pull request #1796 by methius (2014-05-03 09:18:36+00:00)
Title: gdx-video 

Introduces a video rendering extension that works for desktop and android. It provides fullscreen Viewport driven rendering, as well as rendering to a custom Camera & Mesh.

The library currently does not yet support ios and gwt.

On android, all video formats that android supports are supported as the MediaPlayer implementation is used.
On desktop, ffmpeg is used, and to prevent licensing problems, we only compile with theora video support. However, this can be changed easily by changing the ffmpeg lib that is used.

During the move to a libgdx extension, we encountered several problems:

Our primary problem is that the current library loader expects a convention for naming (no version numbers, -x64). This coupled with the fact that Windows does not allow the renaming of files of compiled libraries produces some headaches when dealing with external libraries on which we have no control of the build file. To solve this problem, we introduced the SharedLibraryFinder. We place the natives jar inside the classpath (instead of the contents), and read its known location. We can iterate through the files, and regex match for the library.

If we use the build system that libgdx has, the contents of the natives jar are added directly to the classpath, which isn't iterable. A solution to this problem would be to allow iteration of (a specific part of) the classpath, as discussed in issue #1375.

Another question, is how to actually integrate the ffmpeg libs. To our understanding, there are 3 possible solutions:
- Building ffmpeg from (downloaded) source during a build.
- Building ffmpeg once on the server, and reusing it.
- Having precompiled binaries inside of the repo (bad solution).
Currently, we use the third internally. We are currently heading for the second option, since compiling ffmpeg from scratch every build, will add a significant amount of time to the compile.