Index: media/video/capture/mac/video_capture_device_avfoundation_mac.mm |
diff --git a/media/video/capture/mac/video_capture_device_avfoundation_mac.mm b/media/video/capture/mac/video_capture_device_avfoundation_mac.mm |
index 1fb3b5ce175a46b7faae2f405bff23f81abd1475..872c61f3b1c0f035df61025162cff5c1fc570fdd 100644 |
--- a/media/video/capture/mac/video_capture_device_avfoundation_mac.mm |
+++ b/media/video/capture/mac/video_capture_device_avfoundation_mac.mm |
@@ -177,19 +177,17 @@ |
// Identify the sessionPreset that corresponds to the desired resolution. |
bemasc
2014/04/28 17:17:33
This comment should probably be updated, since the
mcasas
2014/04/28 19:01:36
Seems that you're right, despite the line you copy
|
NSString* sessionPreset; |
- if (width == 1280 && height == 720 && [captureSession_ canSetSessionPreset: |
+ if (width >= 1280 && height >= 720 && [captureSession_ canSetSessionPreset: |
AVFoundationGlue::AVCaptureSessionPreset1280x720()]) { |
sessionPreset = AVFoundationGlue::AVCaptureSessionPreset1280x720(); |
- } else if (width == 640 && height == 480 && [captureSession_ |
- canSetSessionPreset: |
- AVFoundationGlue::AVCaptureSessionPreset640x480()]) { |
+ } else if (width >= 640 && height >= 480 && [captureSession_ |
+ canSetSessionPreset:AVFoundationGlue::AVCaptureSessionPreset640x480()]) { |
sessionPreset = AVFoundationGlue::AVCaptureSessionPreset640x480(); |
- } else if (width == 320 && height == 240 && [captureSession_ |
- canSetSessionPreset: |
- AVFoundationGlue::AVCaptureSessionPreset320x240()]) { |
+ } else if ([captureSession_ |
+ canSetSessionPreset:AVFoundationGlue::AVCaptureSessionPreset320x240()]) { |
bemasc
2014/04/28 17:17:33
Does such a preset even exist? It isn't documente
mcasas
2014/04/28 19:01:36
Not in iOS but in Mac:
https://developer.apple.co
|
sessionPreset = AVFoundationGlue::AVCaptureSessionPreset320x240(); |
} else { |
- DLOG(ERROR) << "Unsupported resolution (" << width << "x" << height << ")"; |
+ DLOG(ERROR) << "Preset not found for requested frame size"; |
return NO; |
} |
[captureSession_ setSessionPreset:sessionPreset]; |