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

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

Issue 2827253004: Image Capture: set SENSOR_EXPOSURE_TIME when CONTROL_AE_MODE_OFF (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 // https://crbug.com/518807. 372 // https://crbug.com/518807.
373 } 373 }
374 374
375 // |mExposureMode|, |mFillLightMode| and |mTorch| interact to configure the AE and Flash 375 // |mExposureMode|, |mFillLightMode| and |mTorch| interact to configure the AE and Flash
376 // modes. In a nutshell, FLASH_MODE is only effective if the auto-exposu re is ON/OFF, 376 // modes. In a nutshell, FLASH_MODE is only effective if the auto-exposu re is ON/OFF,
377 // otherwise the auto-exposure related flash control (ON_{AUTO,ALWAYS}_F LASH{_REDEYE) takes 377 // otherwise the auto-exposure related flash control (ON_{AUTO,ALWAYS}_F LASH{_REDEYE) takes
378 // priority. |mTorch| mode overrides any previous |mFillLightMode| flas h control. 378 // priority. |mTorch| mode overrides any previous |mFillLightMode| flas h control.
379 if (mExposureMode == AndroidMeteringMode.NONE 379 if (mExposureMode == AndroidMeteringMode.NONE
380 || mExposureMode == AndroidMeteringMode.FIXED) { 380 || mExposureMode == AndroidMeteringMode.FIXED) {
381 requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CameraMetadata.CO NTROL_AE_MODE_OFF); 381 requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CameraMetadata.CO NTROL_AE_MODE_OFF);
382
383 // We need to configure by hand the exposure time when AE mode is of f. Set it to the
384 // middle of the allowed range. Further tuning will be done via |mIs o|.
385 final CameraCharacteristics cameraCharacteristics =
386 getCameraCharacteristics(mContext, mId);
387 Range<Long> range = cameraCharacteristics.get(
388 CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE);
389 requestBuilder.set(CaptureRequest.SENSOR_EXPOSURE_TIME,
390 range.getLower() + (range.getUpper() + range.getLower()) / 2 /* nanoseconds*/);
391
382 } else { 392 } else {
383 requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CameraMetadata.CO NTROL_AE_MODE_ON); 393 requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CameraMetadata.CO NTROL_AE_MODE_ON);
384 requestBuilder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, mAeFp sRange); 394 requestBuilder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, mAeFp sRange);
385 } 395 }
386 switch (mFillLightMode) { 396 switch (mFillLightMode) {
387 case AndroidFillLightMode.OFF: 397 case AndroidFillLightMode.OFF:
388 requestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLA SH_MODE_OFF); 398 requestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLA SH_MODE_OFF);
389 break; 399 break;
390 case AndroidFillLightMode.AUTO: 400 case AndroidFillLightMode.AUTO:
391 // Setting the AE to CONTROL_AE_MODE_ON_AUTO_FLASH[_REDEYE] over rides FLASH_MODE. 401 // Setting the AE to CONTROL_AE_MODE_ON_AUTO_FLASH[_REDEYE] over rides FLASH_MODE.
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 return false; 1030 return false;
1021 } 1031 }
1022 return true; 1032 return true;
1023 } 1033 }
1024 1034
1025 @Override 1035 @Override
1026 public void deallocate() { 1036 public void deallocate() {
1027 Log.d(TAG, "deallocate"); 1037 Log.d(TAG, "deallocate");
1028 } 1038 }
1029 } 1039 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698