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
}
builder.setFocusMode(jniFocusMode);
// Auto Exposure is the usual capability and state, unless AE is not available at all, which
// is signalled by the absence of Metering Areas. Exposure Compensation can also support or
// be locked, this is equivalent to AndroidMeteringMode.FIXED.
// Auto Exposure is understood to be supported always; besides that, only "locked"
// (equivalent to AndroidMeteringMode.FIXED) may be supported and/or configured.
ArrayList<Integer> jniExposureModes = new ArrayList<Integer>(2);
if (parameters.getMaxNumMeteringAreas() > 0) {
jniExposureModes.add(AndroidMeteringMode.CONTINUOUS);
}
jniExposureModes.add(AndroidMeteringMode.CONTINUOUS);
if (parameters.isAutoExposureLockSupported()) {
jniExposureModes.add(AndroidMeteringMode.FIXED);
}
......
......@@ -403,7 +403,7 @@ void ImageCapture::ClearMediaTrackConstraints(ScriptPromiseResolver* resolver) {
}
void ImageCapture::GetMediaTrackSettings(MediaTrackSettings& settings) const {
// Merge any present |m_settings| members into |settings|.
// Merge any present |settings_| members into |settings|.
if (settings_.hasWhiteBalanceMode())
settings.setWhiteBalanceMode(settings_.whiteBalanceMode());
......@@ -412,8 +412,10 @@ void ImageCapture::GetMediaTrackSettings(MediaTrackSettings& settings) const {
if (settings_.hasFocusMode())
settings.setFocusMode(settings_.focusMode());
if (settings_.hasPointsOfInterest())
if (settings_.hasPointsOfInterest() &&
!settings_.pointsOfInterest().IsEmpty()) {
settings.setPointsOfInterest(settings_.pointsOfInterest());
}
if (settings_.hasExposureCompensation())
settings.setExposureCompensation(settings_.exposureCompensation());
......@@ -504,7 +506,9 @@ void ImageCapture::OnPhotoCapabilities(
caps->SetImageWidth(
MediaSettingsRange::Create(std::move(capabilities->width)));
}
caps->SetFillLightMode(capabilities->fill_light_mode);
if (!capabilities->fill_light_mode.IsEmpty())
caps->SetFillLightMode(capabilities->fill_light_mode);
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