diff options
author | Sven Gothel <[email protected]> | 2012-04-09 04:49:41 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-09 04:49:41 +0200 |
commit | 3a26aa701b4a1a0991cd997a0d295a1b83cd12f3 (patch) | |
tree | 0bbf0c79127ab8329220e2766177c3073244277b /src/jogl/native/openmax/omx_tool.c | |
parent | 1e61021a062b1403f7eed948ac9d2ea0c04ea951 (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/omx_tool.c')
-rw-r--r-- | src/jogl/native/openmax/omx_tool.c | 15 |
1 files changed, 8 insertions, 7 deletions
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); |