Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java

Issue 2798263003: Image Capture: add |supports_torch| field to mojom (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
diff --git a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
index a73751b5bdf94b7ab03606bc11e5f7e3efeb596c..d8c92d75fd51c1d677e5765e14f9a7456cf33268 100644
--- a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
+++ b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
@@ -797,12 +797,15 @@ public class VideoCaptureCamera2 extends VideoCapture {
builder.setStepColorTemperature(1);
if (!cameraCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE)) {
- builder.setTorch(false);
+ builder.setSupportsTorch(false);
builder.setRedEyeReduction(false);
} else {
// There's no way to query if torch and/or red eye reduction modes are available using
// Camera2 API but since there's a Flash unit, we assume so.
- builder.setTorch(true);
+ builder.setSupportsTorch(true);
+ builder.setTorch(mPreviewRequest.get(CaptureRequest.FLASH_MODE)
+ == CameraMetadata.FLASH_MODE_TORCH);
+
builder.setRedEyeReduction(true);
final int[] flashModes =

Powered by Google App Engine
This is Rietveld 408576698