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

Side by Side Diff: media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.media; 5 package org.chromium.media;
6 6
7 import android.annotation.TargetApi; 7 import android.annotation.TargetApi;
8 import android.content.Context; 8 import android.content.Context;
9 import android.graphics.ImageFormat; 9 import android.graphics.ImageFormat;
10 import android.graphics.Rect; 10 import android.graphics.Rect;
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 builder.setMinColorTemperature(COLOR_TEMPERATURES_MAP.keyAt(0)); 535 builder.setMinColorTemperature(COLOR_TEMPERATURES_MAP.keyAt(0));
536 builder.setMaxColorTemperature( 536 builder.setMaxColorTemperature(
537 COLOR_TEMPERATURES_MAP.keyAt(COLOR_TEMPERATURES_MAP.size() - 1)) ; 537 COLOR_TEMPERATURES_MAP.keyAt(COLOR_TEMPERATURES_MAP.size() - 1)) ;
538 if (jniWhiteBalanceMode == AndroidMeteringMode.FIXED) { 538 if (jniWhiteBalanceMode == AndroidMeteringMode.FIXED) {
539 final int index = COLOR_TEMPERATURES_MAP.indexOfValue(parameters.get WhiteBalance()); 539 final int index = COLOR_TEMPERATURES_MAP.indexOfValue(parameters.get WhiteBalance());
540 if (index >= 0) builder.setCurrentColorTemperature(COLOR_TEMPERATURE S_MAP.keyAt(index)); 540 if (index >= 0) builder.setCurrentColorTemperature(COLOR_TEMPERATURE S_MAP.keyAt(index));
541 } 541 }
542 542
543 final List<String> flashModes = parameters.getSupportedFlashModes(); 543 final List<String> flashModes = parameters.getSupportedFlashModes();
544 if (flashModes != null) { 544 if (flashModes != null) {
545 builder.setTorch( 545 builder.setSupportsTorch(
546 flashModes.contains(android.hardware.Camera.Parameters.FLASH _MODE_TORCH)); 546 flashModes.contains(android.hardware.Camera.Parameters.FLASH _MODE_TORCH));
547 builder.setTorch(parameters.getFlashMode()
548 == android.hardware.Camera.Parameters.FLASH_MODE_TORCH);
549
547 builder.setRedEyeReduction( 550 builder.setRedEyeReduction(
548 flashModes.contains(android.hardware.Camera.Parameters.FLASH _MODE_RED_EYE)); 551 flashModes.contains(android.hardware.Camera.Parameters.FLASH _MODE_RED_EYE));
549 552
550 ArrayList<Integer> modes = new ArrayList<Integer>(0); 553 ArrayList<Integer> modes = new ArrayList<Integer>(0);
551 if (flashModes.contains(android.hardware.Camera.Parameters.FLASH_MOD E_OFF)) { 554 if (flashModes.contains(android.hardware.Camera.Parameters.FLASH_MOD E_OFF)) {
552 modes.add(Integer.valueOf(AndroidFillLightMode.OFF)); 555 modes.add(Integer.valueOf(AndroidFillLightMode.OFF));
553 } 556 }
554 if (flashModes.contains(android.hardware.Camera.Parameters.FLASH_MOD E_AUTO)) { 557 if (flashModes.contains(android.hardware.Camera.Parameters.FLASH_MOD E_AUTO)) {
555 modes.add(Integer.valueOf(AndroidFillLightMode.AUTO)); 558 modes.add(Integer.valueOf(AndroidFillLightMode.AUTO));
556 } 559 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 getCameraRotation()); 791 getCameraRotation());
789 } 792 }
790 } finally { 793 } finally {
791 mPreviewBufferLock.unlock(); 794 mPreviewBufferLock.unlock();
792 if (camera != null) { 795 if (camera != null) {
793 camera.addCallbackBuffer(data); 796 camera.addCallbackBuffer(data);
794 } 797 }
795 } 798 }
796 } 799 }
797 } 800 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698