mirror of
https://github.com/opencv/opencv.git
synced 2025-07-31 01:47:12 +08:00
android(camera2): apply .disconnectCamera() patch from issue 13574
This commit is contained in:
parent
5d15c65e48
commit
9cd1d087c3
@ -230,7 +230,7 @@ public class JavaCamera2View extends CameraBridgeViewBase {
|
||||
|
||||
@Override
|
||||
protected void disconnectCamera() {
|
||||
Log.i(LOGTAG, "closeCamera");
|
||||
Log.i(LOGTAG, "close camera");
|
||||
try {
|
||||
CameraDevice c = mCameraDevice;
|
||||
mCameraDevice = null;
|
||||
@ -241,13 +241,14 @@ public class JavaCamera2View extends CameraBridgeViewBase {
|
||||
if (null != c) {
|
||||
c.close();
|
||||
}
|
||||
} finally {
|
||||
stopBackgroundThread();
|
||||
if (null != mImageReader) {
|
||||
mImageReader.close();
|
||||
mImageReader = null;
|
||||
}
|
||||
} finally {
|
||||
stopBackgroundThread();
|
||||
}
|
||||
Log.i(LOGTAG, "camera closed!");
|
||||
}
|
||||
|
||||
public static class JavaCameraSizeAccessor implements ListItemAccessor {
|
||||
|
Loading…
Reference in New Issue
Block a user