From 5911b729b69b7fb327e441b33f22eb1ef31a03df Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 2 Apr 2012 08:36:38 +0200 Subject: Initial commit for AudioVideo (com.jogamp.opengl.av) rework, introducing Android API 14 MediaPlayer impl of GLMediaPlayer. Android API 14 MediaPlayer allows usage of OMX AL direct decode to texture via libstagefright (OMX AL usage included). Status: Untested, not working - Need to fix native OMX IL (stream detect and split) and/or GStreamer implementation. --- .../com/jogamp/opengl/av/GLMediaPlayer.java | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 src/jogl/classes/com/jogamp/opengl/av/GLMediaPlayer.java (limited to 'src/jogl/classes/com/jogamp/opengl/av/GLMediaPlayer.java') diff --git a/src/jogl/classes/com/jogamp/opengl/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/av/GLMediaPlayer.java new file mode 100644 index 000000000..71e0e16d9 --- /dev/null +++ b/src/jogl/classes/com/jogamp/opengl/av/GLMediaPlayer.java @@ -0,0 +1,90 @@ +package com.jogamp.opengl.av; + +import java.io.IOException; +import java.net.URL; + +import javax.media.opengl.GL; + +import com.jogamp.opengl.util.texture.Texture; + +/** + * Lifecycle of an GLMediaPlayer: + * + */ +public interface GLMediaPlayer { + + public static class TextureFrame { + public TextureFrame(Texture t) { + texture = t; + } + + public final Texture getTexture() { return texture; } + + public String toString() { + return "TextureFrame[" + texture + "]"; + } + protected final Texture texture; + } + + /** Sets the stream to be used. Initializes all stream related states and GL resources. */ + public void setStream(GL gl, URL url) throws IOException; + + /** Releases the GL and stream resources. */ + public void destroy(GL gl); + + public void setPlaySpeed(float rate); + + public float getPlaySpeed(); + + public void start(); + + public void pause(); + + public void stop(); + + /** + * @return time current position in milliseconds + **/ + public int getCurrentPosition(); + + /** + * @param msec absolute desired time position in milliseconds + * @return time current position in milliseconds, after seeking to the desired position + **/ + public int seek(int msec); + + public Texture getLastTextureID(); + + public Texture getNextTextureID(); + + public boolean isValid(); + + public URL getURL(); + + public String getVideoCodec(); + + public String getAudioCodec(); + + public long getTotalFrames(); + + public long getBitrate(); + + public int getFramerate(); + + public int getWidth(); + + public int getHeight(); + + public String toString(); + + public void addEventListener(GLMediaEventListener l); + + public void removeEventListener(GLMediaEventListener l); + + public GLMediaEventListener[] getEventListeners(); +} -- cgit v1.2.3