diff options
author | Sven Gothel <[email protected]> | 2012-04-16 21:30:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-16 21:30:52 +0200 |
commit | 1e16a4cd123aafe41d51f01b41fad5a77c4ffbe3 (patch) | |
tree | 2e86fba5ccb97be3708ab44c8d950eff8d643c88 /make | |
parent | 35beeabffed61e1597aaffc0c5926ab5ef86d32e (diff) |
Adding initial Libav/FFMpeg GLMediaPlayer implementation
The Java classes already slipped through in
commit 10935e1ec0d8ed677bc3fddfaa8cd73898a3bcbf - oops.
Since we cannot provide a Libav binary (even though Google does in Android and Chrome)
due to legal uncertainities .. we dynamically link to an existing Libav / FFmpeg library
in a 'relaxed' manner. Ie. we allow certain recent functions to be absent to be able
to run on a wider range of Libav versions.
Currently tested on Debian Linux and Windows7 64bit/32bit
Binaries for Win/OSX:
- Windows http://ffmpeg.zeranoe.com/builds/
- OSX http://www.ffmpegx.com/
Features:
- Dynamic relaxed linking to Libav (see above)
- YUV420P texture lookup function shader stub (conversion to RGB)
- 1-copy only (decoder buffer to texture)
- simple
- uses libavformat's network streaming
- fixes some odd PTS values
TODO:
- Audio output (Should use OpenAL, duh)
- Seek works poorly
- Offthread multi-texture fetching for smoother animation
- Maybe more pixelformat conversions
Diffstat (limited to 'make')
-rw-r--r-- | make/build-jogl.xml | 33 | ||||
-rwxr-xr-x | make/scripts/java-win32-dbg.bat | 9 | ||||
-rwxr-xr-x | make/scripts/java-win64-dbg.bat | 8 |
3 files changed, 31 insertions, 19 deletions
diff --git a/make/build-jogl.xml b/make/build-jogl.xml index b723c211b..f80efdfc7 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -150,7 +150,7 @@ value="com/jogamp/opengl/**/swt/**"/> <property name="java.part.util" - value="com/jogamp/opengl/util/* com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/av/* com/jogamp/opengl/util/packrect/** jogamp/opengl/util/* jogamp/opengl/util/av/* jogamp/opengl/util/pngj/**"/> + value="com/jogamp/opengl/util/* com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/av/* com/jogamp/opengl/util/packrect/** jogamp/opengl/util/* jogamp/opengl/util/av/** jogamp/opengl/util/pngj/**"/> <property name="java.part.util.awt" value="com/jogamp/opengl/util/**/awt/** com/jogamp/opengl/util/AWTAnimatorImpl*"/> @@ -221,6 +221,7 @@ <property name="rootrel.src.java" value="src/jogl/classes" /> <property name="rootrel.src.c" value="src/jogl/native" /> <property name="rootrel.src.c.openmax" value="src/jogl/native/openmax" /> + <property name="rootrel.src.c.libav" value="src/jogl/native/libav" /> <property name="rootrel.src.generated" value="${rootrel.build}/jogl/gensrc" /> <property name="rootrel.generated.c.jogl" value="${rootrel.src.generated}/native/jogl" /> @@ -231,12 +232,13 @@ <property name="src.c" value="${project.root}/${rootrel.src.c}" /> <!-- The generated source directories. --> - <property name="src.generated" value="${build.jogl}/gensrc" /> - <property name="src.generated.java" value="${src.generated}/classes" /> - <property name="src.generated.java.cg" value="${src.generated.java}/com/jogamp/opengl/cg" /> - <property name="src.generated.c" value="${src.generated}/native/jogl" /> - <property name="src.generated.c.openmax" value="${src.generated}/native/openmax" /> - <property name="src.generated.c.cg" value="${src.generated}/native/jogl_cg" /> + <property name="src.generated" value="${build.jogl}/gensrc" /> + <property name="src.generated.java" value="${src.generated}/classes" /> + <property name="src.generated.java.cg" value="${src.generated.java}/com/jogamp/opengl/cg" /> + <property name="src.generated.c" value="${src.generated}/native/jogl" /> + <property name="src.generated.c.openmax" value="${src.generated}/native/openmax" /> + <property name="src.generated.c.libav" value="${src.generated}/native/libav" /> + <property name="src.generated.c.cg" value="${src.generated}/native/jogl_cg" /> <!-- The compiler output directories. --> <property name="classes" value="${build.jogl}/classes" /> @@ -341,6 +343,7 @@ <mkdir dir="${src.generated.c}/Windows" /> <mkdir dir="${src.generated.c}/X11" /> <mkdir dir="${src.generated.c.openmax}" /> + <mkdir dir="${src.generated.c.libav}" /> <mkdir dir="${classes}" /> <mkdir dir="${obj.jogl}" /> <mkdir dir="${obj.joglsub}" /> @@ -1384,8 +1387,9 @@ <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> <!-- FIXME: the Mixer should be moved to another library --> <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/--> + <include name="${rootrel.src.c.libav}/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c"/> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="setup.addNativeOpenMAX"/> - <include name="${rootrel.src.c.openmax}/jogamp_opengl_omx_OMXGLMediaPlayer.c" if="setup.addNativeOpenMAX"/> + <include name="${rootrel.src.c.openmax}/jogamp_opengl_util_av_impl_OMXGLMediaPlayer.c" if="setup.addNativeOpenMAX"/> <include name="${rootrel.generated.c.jogl}/gl4/GL4bcImpl_JNI.c"/> <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY --> @@ -1400,8 +1404,9 @@ <include name="${rootrel.src.c}/JoglCommon.c"/> <include name="${rootrel.src.c}/GLDebugMessageHandler.c"/> <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> + <include name="${rootrel.src.c.libav}/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c"/> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="setup.addNativeOpenMAX"/> - <include name="${rootrel.src.c.openmax}/jogamp_opengl_omx_OMXGLMediaPlayer.c" if="setup.addNativeOpenMAX"/> + <include name="${rootrel.src.c.openmax}/jogamp_opengl_util_av_impl_OMXGLMediaPlayer.c" if="setup.addNativeOpenMAX"/> <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/> <include name="${rootrel.generated.c.jogl}/egl/EGLExtImpl_JNI.c"/> @@ -1447,6 +1452,7 @@ <includepath path="stub_includes/khr"/> <includepath path="stub_includes/egl"/> <includepath path="stub_includes/opengl"/> + <includepath path="stub_includes/libav" /> <!-- headers required by our libav/ffmpeg MediaPlayer impl. --> <includepath path="stub_includes/openmax" if="setup.addNativeOpenMAX"/> <includepath path="stub_includes/cg" if="setup.addNativeNVidiaCG"/> @@ -1456,6 +1462,7 @@ <includepath path="${src.generated.c}/X11" if="isX11"/> <includepath path="${src.generated.c}/MacOSX" if="isOSX"/> <includepath path="${src.generated.c}/Windows" if="isWindows"/> + <includepath path="${src.generated.c.libav}" /> <includepath path="${src.generated.c.openmax}" if="setup.addNativeOpenMAX"/> <!-- This must come last to not override real include paths --> @@ -1494,13 +1501,11 @@ </sequential> </macrodef> - <target name="c.build.jogl.prepare.openMAX" if="setup.addNativeOpenMAX"> - <javah destdir="${src.generated.c.openmax}" classpath="${javah.classpath}" class="jogamp.opengl.omx.OMXGLMediaPlayer" /> - </target> - - <target name="c.build.jogl.prepare" depends="c.build.jogl.prepare.openMAX"> + <target name="c.build.jogl.prepare"> <javah destdir="${build.jogl}/gensrc/native/jogl" classpath="${javah.classpath}" class="jogamp.opengl.GLDebugMessageHandler" /> <javah destdir="${build.jogl}/gensrc/native/jogl" classpath="${javah.classpath}" class="jogamp.opengl.GLContextImpl" /> + <javah destdir="${src.generated.c.libav}" classpath="${javah.classpath}" class="jogamp.opengl.util.av.impl.FFMPEGMediaPlayer" /> + <javah destdir="${src.generated.c.openmax}" classpath="${javah.classpath}" class="jogamp.opengl.util.av.impl.OMXGLMediaPlayer" /> <!-- Generate the waveout Mixer header --> <!-- FIXME: this is temporary until we move this to another workspace --> <!--javah destdir="${build.jogl}/gensrc/native/jogl" classpath="${javah.classpath}" class="com.jogamp.audio.windows.waveout.Mixer" /--> diff --git a/make/scripts/java-win32-dbg.bat b/make/scripts/java-win32-dbg.bat index 512b8a5c6..9ad090a41 100755 --- a/make/scripts/java-win32-dbg.bat +++ b/make/scripts/java-win32-dbg.bat @@ -7,17 +7,20 @@ set ANT_PATH=C:\apache-ant-1.8.2 set PROJECT_ROOT=D:\projects\jogamp\jogl
set BLD_DIR=..\%BLD_SUB%
-REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PATH%
-set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PROJECT_ROOT%\make\lib\angle\win32;%PATH%
+set FFMPEG_LIB=%PROJECT_ROOT%\make\lib\ffmpeg\x32
+
+set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%FFMPEG_LIB%;%PATH%
+REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PROJECT_ROOT%\make\lib\angle\win32;%PATH%
REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PROJECT_ROOT%\make\lib\PVRVFrame\OGLES-2.0\Windows_x86_32;%PATH%
REM set LIB_DIR=%BLD_DIR%\lib;..\..\gluegen\%BLD_SUB%\obj
-set LIB_DIR=
+set LIB_DIR=%FFMPEG_LIB%
set CP_ALL=.;%BLD_DIR%\jar\jogl.all.jar;%BLD_DIR%\jar\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86\swt-debug.jar
echo CP_ALL %CP_ALL%
+set D_ARGS="-Djogamp.debug.IOUtil" "-Djogl.debug.GLSLCode" "-Djogl.debug.GLMediaPlayer"
REM set D_ARGS="-Djogl.debug.ExtensionAvailabilityCache" "-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.ProcAddressHelper=true" "-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true"
REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.NativeLibrary=true"
REM set D_ARGS="-Djogamp.debug.JNILibLoader=true" "-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true" "-Djogl.debug.GLProfile=true"
diff --git a/make/scripts/java-win64-dbg.bat b/make/scripts/java-win64-dbg.bat index 0c0d3ba6a..4b88116b4 100755 --- a/make/scripts/java-win64-dbg.bat +++ b/make/scripts/java-win64-dbg.bat @@ -7,14 +7,18 @@ set ANT_PATH=C:\apache-ant-1.8.2 set PROJECT_ROOT=D:\projects\jogamp\jogl
set BLD_DIR=..\%BLD_SUB%
-set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PATH%
+set FFMPEG_LIB=%PROJECT_ROOT%\make\lib\ffmpeg\x64
+
+set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%FFMPEG_LIB%;%PATH%
REM set LIB_DIR=%BLD_DIR%\lib;..\..\gluegen\%BLD_SUB%\obj
-set LIB_DIR=
+set LIB_DIR=%FFMPEG_LIB%
set CP_ALL=.;%BLD_DIR%\jar\jogl.all.jar;%BLD_DIR%\jar\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar
echo CP_ALL %CP_ALL%
+set D_ARGS="-Djogamp.debug.IOUtil" "-Djogl.debug.GLSLCode" "-Djogl.debug.GLMediaPlayer"
+REM set D_ARGS="-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true" "-Djogl.debug.GLSLCode"
REM set D_ARGS="-Djogl.debug.ExtensionAvailabilityCache" "-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.ProcAddressHelper=true" "-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true"
REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.NativeLibrary=true"
REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.ExtensionAvailabilityCache" "-Djogamp.debug.ProcAddressHelper=true"
|