|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GLMediaPlayer
Lifecycle of an GLMediaPlayer:
action | state before | state after |
---|---|---|
initGLStream(GL, URLConnection) | Uninitialized | Stopped |
start() | Stopped, Paused | Playing |
stop() | Playing, Paused | Stopped |
pause() | Playing | Paused |
destroy(GL) | ANY | Uninitialized |
Current implementations (check each API doc link for details):
NullGLMediaPlayer
jogamp.opengl.util.av.impl.OMXGLMediaPlayer
jogamp.opengl.util.av.impl.FFMPEGMediaPlayer
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 Integer.MAX_VALUE
will allow tracking time up 2,147,483.647 seconds or
24 days 20 hours 31 minutes and 23 seconds.
Milliseconds granularity is also more than enough to deal with A-V synchronization,
where the threshold usually lies within 100ms.
Nested Class Summary | |
---|---|
static interface |
GLMediaPlayer.GLMediaEventListener
|
static class |
GLMediaPlayer.State
|
Nested classes/interfaces inherited from interface com.jogamp.opengl.util.texture.TextureSequence |
---|
TextureSequence.TexSeqEventListener<T extends TextureSequence>, TextureSequence.TextureFrame |
Field Summary | |
---|---|
static boolean |
DEBUG
|
Fields inherited from interface com.jogamp.opengl.util.texture.TextureSequence |
---|
GL_OES_EGL_image_external_Required_Prelude, sampler2D, samplerExternalOES |
Method Summary | |
---|---|
void |
addEventListener(GLMediaPlayer.GLMediaEventListener l)
|
GLMediaPlayer.State |
destroy(GL gl)
Releases the GL and stream resources. |
int |
getAudioBitrate()
Warning: Optional information, may not be supported by implementation. |
String |
getAudioCodec()
Warning: Optional information, may not be supported by implementation. |
int |
getCurrentPosition()
|
int |
getDuration()
|
GLMediaPlayer.GLMediaEventListener[] |
getEventListeners()
|
float |
getFramerate()
Warning: Optional information, may not be supported by implementation. |
int |
getHeight()
|
TextureSequence.TextureFrame |
getLastTexture()
Returns the last updated texture. |
TextureSequence.TextureFrame |
getNextTexture(GL gl,
boolean blocking)
Returns the next texture to be rendered. |
float |
getPlaySpeed()
|
GLMediaPlayer.State |
getState()
|
long |
getStreamBitrate()
Warning: Optional information, may not be supported by implementation. |
int |
getTextureCount()
|
long |
getTotalFrames()
Warning: Optional information, may not be supported by implementation. |
URLConnection |
getURLConnection()
|
int |
getVideoBitrate()
Warning: Optional information, may not be supported by implementation. |
String |
getVideoCodec()
Warning: Optional information, may not be supported by implementation. |
int |
getWidth()
|
GLMediaPlayer.State |
initGLStream(GL gl,
URLConnection urlConn)
Sets the stream to be used. |
GLMediaPlayer.State |
pause()
Playing -> Paused |
void |
removeEventListener(GLMediaPlayer.GLMediaEventListener l)
|
int |
seek(int msec)
Allowed in state Stopped, Playing and Paused, otherwise ignored. |
void |
setPlaySpeed(float rate)
|
void |
setTextureMinMagFilter(int[] minMagFilter)
Sets the texture min-mag filter, defaults to GL.GL_NEAREST . |
void |
setTextureUnit(int u)
Defaults to 0 |
void |
setTextureWrapST(int[] wrapST)
Sets the texture min-mag filter, defaults to GL.GL_CLAMP_TO_EDGE . |
GLMediaPlayer.State |
start()
Stopped/Paused -> Playing |
GLMediaPlayer.State |
stop()
Playing/Paused -> Stopped |
String |
toString()
|
Methods inherited from interface com.jogamp.opengl.util.texture.TextureSequence |
---|
getRequiredExtensionsShaderStub, getTextureLookupFragmentShaderImpl, getTextureLookupFunctionName, getTextureMinMagFilter, getTextureSampler2DType, getTextureUnit, getTextureWrapST |
Field Detail |
---|
static final boolean DEBUG
Method Detail |
---|
int getTextureCount()
void setTextureUnit(int u)
void setTextureMinMagFilter(int[] minMagFilter)
GL.GL_NEAREST
.
void setTextureWrapST(int[] wrapST)
GL.GL_CLAMP_TO_EDGE
.
GLMediaPlayer.State initGLStream(GL gl, URLConnection urlConn) throws IllegalStateException, GLException, IOException
gl
is not null.
Uninitialized -> Stopped
gl
- current GL object. If null, no video output and textures will be available.urlConn
- the stream connection
IllegalStateException
- if not invoked in state Uninitialized
IOException
- in case of difficulties to open or process the stream
GLException
- in case of difficulties to initialize the GL resourcesGLMediaPlayer.State destroy(GL gl)
ANY
-> Uninitialized
void setPlaySpeed(float rate)
float getPlaySpeed()
GLMediaPlayer.State start()
GLMediaPlayer.State pause()
GLMediaPlayer.State stop()
GLMediaPlayer.State getState()
int getCurrentPosition()
int seek(int msec)
msec
- absolute desired time position in milliseconds
TextureSequence.TextureFrame getLastTexture() throws IllegalStateException
In case the instance is just initialized, it shall return a TextureFrame
object with valid attributes. The texture content may be undefined
until the first call of TextureSequence.getNextTexture(GL, boolean)
.
getLastTexture
in interface TextureSequence
IllegalStateException
- if instance is not initializedTextureSequence.TextureFrame getNextTexture(GL gl, boolean blocking) throws IllegalStateException
Implementation shall block until next frame is available if blocking
is true
,
otherwise it shall return the last frame in case a new frame is not available.
Shall return null
in case no frame is available.
In case the current state is not GLMediaPlayer.State.Playing
, getLastTexture()
is returned.
getNextTexture
in interface TextureSequence
IllegalStateException
- if instance is not initializedaddEventListener(GLMediaEventListener)
,
GLMediaEventListener#newFrameAvailable(GLMediaPlayer, long)
URLConnection getURLConnection()
String getVideoCodec()
String getAudioCodec()
long getTotalFrames()
int getDuration()
long getStreamBitrate()
int getVideoBitrate()
int getAudioBitrate()
float getFramerate()
int getWidth()
int getHeight()
String toString()
toString
in class Object
void addEventListener(GLMediaPlayer.GLMediaEventListener l)
void removeEventListener(GLMediaPlayer.GLMediaEventListener l)
GLMediaPlayer.GLMediaEventListener[] getEventListeners()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |