Commit b6da4355 authored by mcasas's avatar mcasas Committed by Commit bot

Image Capture: two small nits

Android Auto Exposure is always available, make the implementation
reflect that.

In blink, don't fill dictionary entries with empty arrays.

BUG=716636

Review-Url: https://codereview.chromium.org/2842103002
Cr-Commit-Position: refs/heads/master@{#468205}
parent 180f9985
...@@ -533,13 +533,10 @@ public class VideoCaptureCamera ...@@ -533,13 +533,10 @@ public class VideoCaptureCamera
} }
builder.setFocusMode(jniFocusMode); builder.setFocusMode(jniFocusMode);
// Auto Exposure is the usual capability and state, unless AE is not available at all, which // Auto Exposure is understood to be supported always; besides that, only "locked"
// is signalled by the absence of Metering Areas. Exposure Compensation can also support or // (equivalent to AndroidMeteringMode.FIXED) may be supported and/or configured.
// be locked, this is equivalent to AndroidMeteringMode.FIXED.
ArrayList<Integer> jniExposureModes = new ArrayList<Integer>(2); ArrayList<Integer> jniExposureModes = new ArrayList<Integer>(2);
if (parameters.getMaxNumMeteringAreas() > 0) {
jniExposureModes.add(AndroidMeteringMode.CONTINUOUS); jniExposureModes.add(AndroidMeteringMode.CONTINUOUS);
}
if (parameters.isAutoExposureLockSupported()) { if (parameters.isAutoExposureLockSupported()) {
jniExposureModes.add(AndroidMeteringMode.FIXED); jniExposureModes.add(AndroidMeteringMode.FIXED);
} }
......
...@@ -403,7 +403,7 @@ void ImageCapture::ClearMediaTrackConstraints(ScriptPromiseResolver* resolver) { ...@@ -403,7 +403,7 @@ void ImageCapture::ClearMediaTrackConstraints(ScriptPromiseResolver* resolver) {
} }
void ImageCapture::GetMediaTrackSettings(MediaTrackSettings& settings) const { void ImageCapture::GetMediaTrackSettings(MediaTrackSettings& settings) const {
// Merge any present |m_settings| members into |settings|. // Merge any present |settings_| members into |settings|.
if (settings_.hasWhiteBalanceMode()) if (settings_.hasWhiteBalanceMode())
settings.setWhiteBalanceMode(settings_.whiteBalanceMode()); settings.setWhiteBalanceMode(settings_.whiteBalanceMode());
...@@ -412,8 +412,10 @@ void ImageCapture::GetMediaTrackSettings(MediaTrackSettings& settings) const { ...@@ -412,8 +412,10 @@ void ImageCapture::GetMediaTrackSettings(MediaTrackSettings& settings) const {
if (settings_.hasFocusMode()) if (settings_.hasFocusMode())
settings.setFocusMode(settings_.focusMode()); settings.setFocusMode(settings_.focusMode());
if (settings_.hasPointsOfInterest()) if (settings_.hasPointsOfInterest() &&
!settings_.pointsOfInterest().IsEmpty()) {
settings.setPointsOfInterest(settings_.pointsOfInterest()); settings.setPointsOfInterest(settings_.pointsOfInterest());
}
if (settings_.hasExposureCompensation()) if (settings_.hasExposureCompensation())
settings.setExposureCompensation(settings_.exposureCompensation()); settings.setExposureCompensation(settings_.exposureCompensation());
...@@ -504,6 +506,8 @@ void ImageCapture::OnPhotoCapabilities( ...@@ -504,6 +506,8 @@ void ImageCapture::OnPhotoCapabilities(
caps->SetImageWidth( caps->SetImageWidth(
MediaSettingsRange::Create(std::move(capabilities->width))); MediaSettingsRange::Create(std::move(capabilities->width)));
} }
if (!capabilities->fill_light_mode.IsEmpty())
caps->SetFillLightMode(capabilities->fill_light_mode); caps->SetFillLightMode(capabilities->fill_light_mode);
resolver->Resolve(caps); resolver->Resolve(caps);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment