summaryrefslogtreecommitdiffstats
path: root/chromium/media/capture/video/mac/video_capture_device_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/capture/video/mac/video_capture_device_mac.mm')
-rw-r--r--chromium/media/capture/video/mac/video_capture_device_mac.mm21
1 files changed, 16 insertions, 5 deletions
diff --git a/chromium/media/capture/video/mac/video_capture_device_mac.mm b/chromium/media/capture/video/mac/video_capture_device_mac.mm
index 74e310ed911..82eac2c7bfa 100644
--- a/chromium/media/capture/video/mac/video_capture_device_mac.mm
+++ b/chromium/media/capture/video/mac/video_capture_device_mac.mm
@@ -50,6 +50,10 @@ namespace media {
namespace {
+BASE_FEATURE(kExposeAllUvcControls,
+ "ExposeAllUvcControls",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
// Mac specific limits for minimum and maximum frame rate.
const float kMinFrameRate = 1.0f;
const float kMaxFrameRate = 60.0f;
@@ -242,7 +246,8 @@ void VideoCaptureDeviceMac::GetPhotoState(GetPhotoStateCallback callback) {
const std::string device_model = GetDeviceModelId(
device_descriptor_.device_id, device_descriptor_.capture_api,
device_descriptor_.transport_type);
- if (UvcControl uvc(device_model, uvc::kVcInputTerminal); uvc.Good()) {
+ if (UvcControl uvc(device_model, uvc::kVcInputTerminal);
+ uvc.Good() && base::FeatureList::IsEnabled(kExposeAllUvcControls)) {
photo_state->current_focus_mode = mojom::MeteringMode::NONE;
uvc.MaybeUpdateControlRange<uint16_t>(uvc::kCtFocusAbsoluteControl,
photo_state->focus_distance.get(),
@@ -282,14 +287,16 @@ void VideoCaptureDeviceMac::GetPhotoState(GetPhotoStateCallback callback) {
photo_state->supported_exposure_modes.push_back(
mojom::MeteringMode::CONTINUOUS);
}
-
+ }
+ if (UvcControl uvc(device_model, uvc::kVcInputTerminal); uvc.Good()) {
MaybeUpdatePanTiltControlRange(uvc, photo_state->pan.get(),
photo_state->tilt.get());
uvc.MaybeUpdateControlRange<uint16_t>(uvc::kCtZoomAbsoluteControl,
photo_state->zoom.get(), "zoom");
}
- if (UvcControl uvc(device_model, uvc::kVcProcessingUnit); uvc.Good()) {
+ if (UvcControl uvc(device_model, uvc::kVcProcessingUnit);
+ uvc.Good() && base::FeatureList::IsEnabled(kExposeAllUvcControls)) {
uvc.MaybeUpdateControlRange<int16_t>(uvc::kPuBrightnessAbsoluteControl,
photo_state->brightness.get(),
"brightness");
@@ -362,7 +369,8 @@ void VideoCaptureDeviceMac::SetPhotoOptions(mojom::PhotoSettingsPtr settings,
const std::string device_model = GetDeviceModelId(
device_descriptor_.device_id, device_descriptor_.capture_api,
device_descriptor_.transport_type);
- if (UvcControl uvc(device_model, uvc::kVcInputTerminal); uvc.Good()) {
+ if (UvcControl uvc(device_model, uvc::kVcInputTerminal);
+ uvc.Good() && base::FeatureList::IsEnabled(kExposeAllUvcControls)) {
if (settings->has_focus_mode &&
(settings->focus_mode == mojom::MeteringMode::CONTINUOUS ||
settings->focus_mode == mojom::MeteringMode::MANUAL)) {
@@ -389,6 +397,8 @@ void VideoCaptureDeviceMac::SetPhotoOptions(mojom::PhotoSettingsPtr settings,
uvc.SetControlCurrent<uint16_t>(uvc::kCtExposureTimeAbsoluteControl,
settings->exposure_time, "exposure time");
}
+ }
+ if (UvcControl uvc(device_model, uvc::kVcInputTerminal); uvc.Good()) {
if (settings->has_pan || settings->has_tilt) {
SetPanTiltCurrent(uvc,
settings->has_pan ? absl::make_optional(settings->pan)
@@ -401,7 +411,8 @@ void VideoCaptureDeviceMac::SetPhotoOptions(mojom::PhotoSettingsPtr settings,
settings->zoom, "zoom");
}
}
- if (UvcControl uvc(device_model, uvc::kVcProcessingUnit); uvc.Good()) {
+ if (UvcControl uvc(device_model, uvc::kVcProcessingUnit);
+ uvc.Good() && base::FeatureList::IsEnabled(kExposeAllUvcControls)) {
if (settings->has_brightness) {
uvc.SetControlCurrent<int16_t>(uvc::kPuBrightnessAbsoluteControl,
settings->brightness, "brightness");