cats-oss / android-gpuimage

Android filters based on OpenGL (idea from GPUImage for iOS)
9k stars 2.27k forks source link

Camera is being used after Camera.release() was called #367

Open dhagz opened 7 years ago

dhagz commented 7 years ago

Any idea to minimize this issue?

java.lang.RuntimeException: Camera is being used after Camera.release() was called
    at android.hardware.Camera.setPreviewTexture(Native Method)
    at jp.co.cyberagent.android.gpuimage.GPUImageRenderer$2.run(GPUImageRenderer.java:181)
    at jp.co.cyberagent.android.gpuimage.GPUImageRenderer.runAll(GPUImageRenderer.java:143)
    at jp.co.cyberagent.android.gpuimage.GPUImageRenderer.onDrawFrame(GPUImageRenderer.java:119)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java)
dhagz commented 6 years ago

I got this issue when I released the camera during onPause and set-up again during onResume. Now, I only set-up the camera during onCreate and released during onDestroy which minimized this issue but gave birth to this issue: https://github.com/CyberAgent/android-gpuimage/issues/319