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

Unified Diff: media/capture/video/mac/video_capture_device_mac.mm

Issue 2895013003: Image Capture Mac: make setOptions() resolve the callback with true (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/capture/video/mac/video_capture_device_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/mac/video_capture_device_mac.mm
diff --git a/media/capture/video/mac/video_capture_device_mac.mm b/media/capture/video/mac/video_capture_device_mac.mm
index 27eb401eb708eabfc6fcf1e4a0e81aeb443ce0b3..38e1f1d0a198ccc3d4f33d85b2f98acf07394948 100644
--- a/media/capture/video/mac/video_capture_device_mac.mm
+++ b/media/capture/video/mac/video_capture_device_mac.mm
@@ -413,6 +413,21 @@ void VideoCaptureDeviceMac::GetPhotoCapabilities(
callback.Run(std::move(photo_capabilities));
}
+void VideoCaptureDeviceMac::SetPhotoOptions(mojom::PhotoSettingsPtr settings,
+ SetPhotoOptionsCallback callback) {
+ DCHECK(task_runner_->BelongsToCurrentThread());
+ // Drop |callback| and return if there are any unsupported |settings|.
+ // TODO(mcasas): centralise checks elsewhere, https://crbug.com/724285.
+ if ((settings->has_width &&
+ settings->width != capture_format_.frame_size.width()) ||
+ (settings->has_height &&
+ settings->height != capture_format_.frame_size.height()) ||
+ settings->has_fill_light_mode || settings->has_red_eye_reduction) {
+ return;
+ }
+ callback.Run(true);
+}
+
bool VideoCaptureDeviceMac::Init(VideoCaptureApi capture_api_type) {
DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK_EQ(state_, kNotInitialized);
« no previous file with comments | « media/capture/video/mac/video_capture_device_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698