Skip to content

Commit 278b1aa

Browse files
オートフォーカスの待ち時間を5秒に短縮
写真撮影の終了処理時に、カメラの解放処理を追加
1 parent 67038b1 commit 278b1aa

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

  • dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/camera

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/camera/CameraWrapper.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,8 @@ private void resumeRepeatingRequest() {
634634
startRecording(mRecordingSurface, true);
635635
} else if (mIsPreview) {
636636
startPreview(mPreviewSurface, true);
637+
} else {
638+
close();
637639
}
638640
} catch (CameraWrapperException e) {
639641
if (DEBUG) {
@@ -698,7 +700,6 @@ private void prepareCapture(final CameraDevice cameraDevice) throws CameraWrappe
698700
}
699701
setDefaultCaptureRequest(request, true);
700702
mCaptureSession.setRepeatingRequest(request.build(), new CameraCaptureSession.CaptureCallback() {
701-
702703
@Override
703704
public void onCaptureProgressed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureResult partialResult) {
704705
onCaptureResult(partialResult, false);
@@ -748,11 +749,8 @@ private void onCaptureResult(final CaptureResult result, final boolean isComplet
748749
}
749750
}
750751
}, mBackgroundHandler);
751-
lock.await(10, TimeUnit.SECONDS);
752+
lock.await(5, TimeUnit.SECONDS);
752753
mCaptureSession.stopRepeating();
753-
if (resultRef.get() == null) {
754-
throw new CameraWrapperException("Failed auto focus.");
755-
}
756754
} catch (CameraAccessException e) {
757755
throw new CameraWrapperException(e);
758756
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)