summaryrefslogtreecommitdiffstats
path: root/src/jogl/native/openmax
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-04-09 04:49:41 +0200
committerSven Gothel <[email protected]>2012-04-09 04:49:41 +0200
commit3a26aa701b4a1a0991cd997a0d295a1b83cd12f3 (patch)
tree0bbf0c79127ab8329220e2766177c3073244277b /src/jogl/native/openmax
parent1e61021a062b1403f7eed948ac9d2ea0c04ea951 (diff)
GLMediaPlayer*: Revised - Working on buggy MediaPlayer impl. (Android ICS Tegra)
GLMediaPlayer: Merging 'initStream()' and 'initGL()' to 'initGLStream()' due to incompatible/buggy implementations (Android/Tegra) requiring the GL texture being setup before preparing the stream. This also implies that w/o an GL context we cannot fetch the stream information (size, ..) hence we need to evaluate this detail (FIXME). 'getNextTexture(GL gl, boolean blocking)' can request the impl. to block GLMediaEventListener: The TextureFrame not yet available, adding 'when'
Diffstat (limited to 'src/jogl/native/openmax')
-rw-r--r--src/jogl/native/openmax/jogamp_opengl_omx_OMXGLMediaPlayer.c4
-rw-r--r--src/jogl/native/openmax/omx_tool.c15
-rw-r--r--src/jogl/native/openmax/omx_tool.h2
3 files changed, 11 insertions, 10 deletions
diff --git a/src/jogl/native/openmax/jogamp_opengl_omx_OMXGLMediaPlayer.c b/src/jogl/native/openmax/jogamp_opengl_omx_OMXGLMediaPlayer.c
index 86307ae59..73687f305 100644
--- a/src/jogl/native/openmax/jogamp_opengl_omx_OMXGLMediaPlayer.c
+++ b/src/jogl/native/openmax/jogamp_opengl_omx_OMXGLMediaPlayer.c
@@ -222,12 +222,12 @@ JNIEXPORT jlong JNICALL Java_jogamp_opengl_omx_OMXGLMediaPlayer__1seek
}
JNIEXPORT jint JNICALL Java_jogamp_opengl_omx_OMXGLMediaPlayer__1getNextTextureID
- (JNIEnv *env, jobject instance, jlong ptr)
+ (JNIEnv *env, jobject instance, jlong ptr, jboolean blocking)
{
jint textureID = 0xffffffff;
OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
if (pOMXAV != NULL) {
- textureID = OMXToolBasicAV_GetNextTextureID(pOMXAV);
+ textureID = OMXToolBasicAV_GetNextTextureID(pOMXAV, blocking ? 1 : 0);
}
return textureID;
}
diff --git a/src/jogl/native/openmax/omx_tool.c b/src/jogl/native/openmax/omx_tool.c
index 784d6facf..5e168ad02 100644
--- a/src/jogl/native/openmax/omx_tool.c
+++ b/src/jogl/native/openmax/omx_tool.c
@@ -1411,9 +1411,9 @@ void OMXToolBasicAV_PlaySeek(OMXToolBasicAV_t * pOMXAV, KDint64 time)
kdThreadMutexUnlock(pOMXAV->mutex);
}
-GLuint OMXToolBasicAV_GetNextTextureID(OMXToolBasicAV_t * pOMXAV) {
+GLuint OMXToolBasicAV_GetNextTextureID(OMXToolBasicAV_t * pOMXAV, int blocking) {
GLuint texID = 0;
- int ret = pOMXAV->glPos;
+ int idx = pOMXAV->glPos;
kdThreadMutexLock(pOMXAV->mutex);
if(pOMXAV->status==OMXAV_PLAYING) {
@@ -1438,9 +1438,10 @@ GLuint OMXToolBasicAV_GetNextTextureID(OMXToolBasicAV_t * pOMXAV) {
pOMXAV->omxPos = next;
next = (pOMXAV->omxPos + 1) % pOMXAV->vBufferNum;
pOMXAV->filled++;
- }
- else
- {
+ if(!blocking) {
+ break;
+ }
+ } else {
DBG_PRINT2( "GetNextTexture p2.3\n");
break;
}
@@ -1462,11 +1463,11 @@ GLuint OMXToolBasicAV_GetNextTextureID(OMXToolBasicAV_t * pOMXAV) {
pOMXAV->available--;
pOMXAV->filled--;
pOMXAV->glPos = (pOMXAV->glPos + 1) % pOMXAV->vBufferNum;
- ret = pOMXAV->glPos;
+ idx = pOMXAV->glPos;
}
}
- texID = pOMXAV->available ? pOMXAV->buffers[ret].tex : 0;
+ texID = pOMXAV->available ? pOMXAV->buffers[idx].tex : 0;
DBG_PRINT2( "GetNextTexture B avail %d, filled %d, pos o:%d g:%d t:%d\n",
pOMXAV->available, pOMXAV->filled, pOMXAV->omxPos, pOMXAV->glPos, texID);
diff --git a/src/jogl/native/openmax/omx_tool.h b/src/jogl/native/openmax/omx_tool.h
index be5b8f175..1ade60e4f 100644
--- a/src/jogl/native/openmax/omx_tool.h
+++ b/src/jogl/native/openmax/omx_tool.h
@@ -139,7 +139,7 @@ void OMXToolBasicAV_PlayStart(OMXToolBasicAV_t * pOMXAV); // #5
void OMXToolBasicAV_PlayPause(OMXToolBasicAV_t * pOMXAV);
void OMXToolBasicAV_PlayStop(OMXToolBasicAV_t * pOMXAV);
void OMXToolBasicAV_PlaySeek(OMXToolBasicAV_t * pOMXAV, KDint64 time);
-GLuint OMXToolBasicAV_GetNextTextureID(OMXToolBasicAV_t * pOMXAV);
+GLuint OMXToolBasicAV_GetNextTextureID(OMXToolBasicAV_t * pOMXAV, int blocking);
KDint64 OMXToolBasicAV_GetCurrentPosition(OMXToolBasicAV_t * pOMXAV);