Skip to content

Commit

Permalink
Merge pull request opencv#13840 from jaewoosong:jaewoosong-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Feb 26, 2019
2 parents 865c29a + 225bdc2 commit 1bf1694
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ protected boolean initializeCamera() {
if (mCameraID != null) {
Log.i(LOGTAG, "Opening camera: " + mCameraID);
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;
} catch (CameraAccessException e) {
Expand Down

0 comments on commit 1bf1694

Please sign in to comment.