Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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