From 1152d3c3cb5d13b4e5543387bff7a73e78e27a71 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Wed, 18 Apr 2012 10:45:41 +0200
Subject: GLMediaPlayer: Add Class / Package API doc incl. detailed info in the
implementations.
---
.../com/jogamp/opengl/util/av/GLMediaPlayer.java | 9 +++++
.../classes/com/jogamp/opengl/util/av/package.html | 25 ++++++++++++
.../android/av/AndroidGLMediaPlayerAPI14.java | 13 ++++++-
.../jogamp/opengl/util/av/NullGLMediaPlayer.java | 3 +-
.../opengl/util/av/impl/FFMPEGMediaPlayer.java | 45 +++++++++++++++++++++-
.../opengl/util/av/impl/OMXGLMediaPlayer.java | 32 +++++++++++++++
6 files changed, 122 insertions(+), 5 deletions(-)
create mode 100644 src/jogl/classes/com/jogamp/opengl/util/av/package.html
(limited to 'src/jogl')
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 8430d6137..3eca01986 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -48,6 +48,15 @@ import com.jogamp.opengl.util.texture.TextureSequence;
* {@link #destroy(GL)} | ANY | Uninitialized |
*
*
+ * Current implementations (check each API doc link for details):
+ *
+ * - {@link jogamp.opengl.util.av.NullGLMediaPlayer}
+ * - {@link jogamp.opengl.util.av.impl.OMXGLMediaPlayer}
+ * - {@link jogamp.opengl.util.av.impl.FFMPEGMediaPlayer}
+ * - {@link jogamp.opengl.android.av.AndroidGLMediaPlayerAPI14}
+ *
+ *
+ *
* Variable type, value range and dimension has been chosen to suit embedded CPUs
* and characteristics of audio and video streaming.
* Milliseconds of type integer with a maximum value of {@link Integer#MAX_VALUE}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/package.html b/src/jogl/classes/com/jogamp/opengl/util/av/package.html
new file mode 100644
index 000000000..249db7d30
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/package.html
@@ -0,0 +1,25 @@
+
+
+
+ Public Audio/Video Utility Package
+
+
+
+Public Audio/Video Utility Package
+
+Disclaimer
+
+ We are currently refining and completing this new API and it's implementation.
+ Feel free to comment and help using our public channels.
+
+Revision History
+
+
+
+- Early Draft Review, April 17th 2012
+
+
+
+
+
+
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index f6189f03c..23f9161d4 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -44,8 +44,17 @@ import android.net.Uri;
import android.view.Surface;
/***
- * Android API Level 14: {@link MediaPlayer#setSurface(Surface)}
- * Android API Level 14: {@link Surface#Surface(android.graphics.SurfaceTexture)}
+ * Android implementation utilizes API level 14 (4.0.? ICS) features
+ * as listed below.
+ *
+ * We utilize the {@link MediaPlayer} with direct to texture streaming.
+ * The MediaPlayer uses libstagefright
to access the OpenMAX AL implementation
+ * for hardware decoding.
+ *
+ *
+ * - Android API Level 14: {@link MediaPlayer#setSurface(Surface)}
+ * - Android API Level 14: {@link Surface#Surface(android.graphics.SurfaceTexture)}
+ *
*/
public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
static final boolean available;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index fe2aeaf19..3d740d6b2 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -44,7 +44,8 @@ import com.jogamp.opengl.util.texture.TextureIO;
import com.jogamp.opengl.util.texture.TextureSequence;
/***
- * A dummy null media player implementation using a static test frame (if available).
+ * A dummy null media player implementation using a static test frame
+ * available on all platforms.
*/
public class NullGLMediaPlayer extends GLMediaPlayerImpl {
private TextureData texData = null;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
index d24961b68..7d10cff4d 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -49,15 +49,56 @@ import jogamp.opengl.gl4.GL4bcProcAddressTable;
import jogamp.opengl.util.av.EGLMediaPlayerImpl;
/***
- * Currently only YUV420P and the usual packed RGB formats are supported.
+ * Implementation utilizes Libav
+ * or FFmpeg which is ubiquitous
+ * available and usually pre-installed on Unix platforms. Due to legal
+ * reasons we cannot deploy binaries of it, which contains patented codecs.
+ * Besides the default BSD/Linux/.. repositories and installations,
+ * precompiled binaries can be found at the listed location below.
+ *
+ * Implements YUV420P to RGB fragment shader conversion
+ * and the usual packed RGB formats.
+ * The decoded video frame is written directly into an OpenGL texture
+ * on the GPU in it's native format. A custom fragment shader converts
+ * the native pixelformat to a usable RGB format if required.
+ * Hence only 1 copy is required before bloating the picture
+ * from YUV to RGB, for example.
+ *
+ *
+ * Utilizes a slim dynamic and native binding to the Lib_av
+ * libraries:
+ *
+ * - libavutil
+ * - libavformat
+ * - libavcodec
+ *
+ *
+ *
+ * http://libav.org/
+ *
*
* Check tag 'FIXME: Add more planar formats !'
* here and in the corresponding native code
* jogl/src/jogl/native/ffmpeg/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c
*
*
- * TODO: Audio Output
+ * TODO:
+ *
+ * - Audio Output
+ * - Off thread next frame processing using multiple target textures
+ * - better pts sync handling
+ * - fix seek
+ *
*
+ * Pre-compiled Libav / FFmpeg packages:
+ *
*/
public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
public static final VersionNumber avUtilVersion;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index 7c812ce1c..aef98fcde 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -1,3 +1,30 @@
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
package jogamp.opengl.util.av.impl;
@@ -13,6 +40,11 @@ import com.jogamp.opengl.util.texture.TextureSequence;
import jogamp.opengl.egl.EGL;
import jogamp.opengl.util.av.EGLMediaPlayerImpl;
+/**
+ * OpenMAX IL implementation. This implementation is currently not tested
+ * due to lack of an available device or working software implementation.
+ * It is kept alive through all changes in the hope of a later availability though.
+ */
public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
static final boolean available;
--
cgit v1.2.3