Fix the issue where TextureView stuck if the producer side is too fast.

When SurfaceTexture is in sync mode, the consumer needs to pull the pending
frames. Otherwise the onFrameAvailable won't be called and no more update.

This simple fix is to skip frame to keep up with the producer side.

Change-Id: Ica833695dc0b0221d2543f46f0dd41aa55d1aa16
This commit is contained in:
Grace Kloba
2011-06-22 01:29:13 -07:00
parent 87b7f805b9
commit 0bc6eb30bc

View File

@@ -649,7 +649,8 @@ static void android_view_GLES20Canvas_updateTextureLayer(JNIEnv* env, jobject cl
float transform[16];
sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, surface));
surfaceTexture->updateTexImage();
while (surfaceTexture->getQueuedCount() > 0)
surfaceTexture->updateTexImage();
surfaceTexture->getTransformMatrix(transform);
GLenum renderTarget = surfaceTexture->getCurrentTextureTarget();