Commit 225bdc21 authored by Jaewoo Song's avatar Jaewoo Song Committed by Jaewoo Song

Making JavaCamera2View behaves in the same way as JavaCameraView

parent 4cf321f3
...@@ -110,6 +110,15 @@ public class JavaCamera2View extends CameraBridgeViewBase { ...@@ -110,6 +110,15 @@ public class JavaCamera2View extends CameraBridgeViewBase {
if (mCameraID != null) { if (mCameraID != null) {
Log.i(LOGTAG, "Opening camera: " + mCameraID); Log.i(LOGTAG, "Opening camera: " + mCameraID);
manager.openCamera(mCameraID, mStateCallback, mBackgroundHandler); manager.openCamera(mCameraID, mStateCallback, mBackgroundHandler);
} else { // make JavaCamera2View behaves in the same way as JavaCameraView
Log.i(LOGTAG, "Trying to open camera with the value (" + mCameraIndex + ")");
if (mCameraIndex < camList.length) {
mCameraID = camList[mCameraIndex];
manager.openCamera(mCameraID, mStateCallback, mBackgroundHandler);
} else {
// CAMERA_DISCONNECTED is used when the camera id is no longer valid
throw new CameraAccessException(CameraAccessException.CAMERA_DISCONNECTED);
}
} }
return true; return true;
} catch (CameraAccessException e) { } catch (CameraAccessException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment