Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bc6eb30 authored by Grace Kloba's avatar Grace Kloba
Browse files

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
parent 87b7f805
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -649,6 +649,7 @@ static void android_view_GLES20Canvas_updateTextureLayer(JNIEnv* env, jobject cl
    float transform[16];
    sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, surface));

    while (surfaceTexture->getQueuedCount() > 0)
        surfaceTexture->updateTexImage();
    surfaceTexture->getTransformMatrix(transform);
    GLenum renderTarget = surfaceTexture->getCurrentTextureTarget();