Skip to content

Commit

Permalink
ignore runtime error on updatetextimage
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Oct 26, 2023
1 parent 24e2add commit 54a9f1b
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.opengl.GLES20;
import android.opengl.Matrix;
import android.os.Build;
import android.util.Log;
import android.view.Surface;

import androidx.annotation.RequiresApi;
Expand All @@ -40,9 +41,11 @@
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
public class CameraRender extends BaseRenderOffScreen {

private int[] textureID = new int[1];
private float[] rotationMatrix = new float[16];
private float[] scaleMatrix = new float[16];
private final String TAG = "CameraRender";

private final int[] textureID = new int[1];
private final float[] rotationMatrix = new float[16];
private final float[] scaleMatrix = new float[16];

private int program = -1;
private int uMVPMatrixHandle = -1;
Expand Down Expand Up @@ -131,7 +134,12 @@ public void release() {
}

public void updateTexImage() {
surfaceTexture.updateTexImage();
try {
//runtime error could be ignored
surfaceTexture.updateTexImage();
} catch (RuntimeException e) {
Log.e(TAG, "error", e);
}
}

public SurfaceTexture getSurfaceTexture() {
Expand Down

0 comments on commit 54a9f1b

Please sign in to comment.