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

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

Issue 258783007: Mac AVFoundation: Allow use of all camera's supported resolutions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed sessionPreset logic. Created 6 years, 8 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/video/capture/mac/avfoundation_glue.mm ('k') | media/video/capture/mac/video_capture_device_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..778d9a6169b9e3cd0364fcf69fe7f40c64db7135 100644
--- a/media/video/capture/mac/video_capture_device_avfoundation_mac.mm
+++ b/media/video/capture/mac/video_capture_device_avfoundation_mac.mm
@@ -175,39 +175,12 @@
frameHeight_ = height;
frameRate_ = frameRate;
- // Identify the sessionPreset that corresponds to the desired resolution.
- NSString* sessionPreset;
- if (width == 1280 && height == 720 && [captureSession_ canSetSessionPreset:
- AVFoundationGlue::AVCaptureSessionPreset1280x720()]) {
- sessionPreset = AVFoundationGlue::AVCaptureSessionPreset1280x720();
- } else if (width == 640 && height == 480 && [captureSession_
- canSetSessionPreset:
- AVFoundationGlue::AVCaptureSessionPreset640x480()]) {
- sessionPreset = AVFoundationGlue::AVCaptureSessionPreset640x480();
- } else if (width == 320 && height == 240 && [captureSession_
- canSetSessionPreset:
- AVFoundationGlue::AVCaptureSessionPreset320x240()]) {
- sessionPreset = AVFoundationGlue::AVCaptureSessionPreset320x240();
- } else {
- DLOG(ERROR) << "Unsupported resolution (" << width << "x" << height << ")";
- return NO;
- }
- [captureSession_ setSessionPreset:sessionPreset];
-
- // Check that our capture Device can be used with the current preset.
- if (![captureDevice_ supportsAVCaptureSessionPreset:
- [captureSession_ sessionPreset]]){
- DLOG(ERROR) << "Video capture device does not support current preset";
- return NO;
- }
-
- // Despite all Mac documentation detailing that setting the sessionPreset is
- // enough, that is not the case for, at least, the MacBook Air built-in
- // FaceTime HD Camera, and the capture output has to be configured as well.
- // The reason for this mismatch is probably because most of the AVFoundation
- // docs are written for iOS and not for MacOsX.
- // AVVideoScalingModeKey() refers to letterboxing yes/no and preserve aspect
- // ratio yes/no when scaling. Currently we set cropping and preservation.
+ // The capture output has to be configured, despite Mac documentation
+ // detailing that setting the sessionPreset is enough. The reason for this
bemasc 2014/04/28 19:18:03 Nit: "would be enough", to be clear that we don't
mcasas 2014/04/29 06:56:32 Done.
+ // mismatch is probably because most of the AVFoundation docs are written for
+ // iOS and not for MacOsX. AVVideoScalingModeKey() refers to letterboxing
+ // yes/no and preserve aspect ratio yes/no when scaling. Currently we set
+ // cropping and preservation.
NSDictionary* videoSettingsDictionary = @{
(id)kCVPixelBufferWidthKey : @(width),
(id)kCVPixelBufferHeightKey : @(height),
« no previous file with comments | « media/video/capture/mac/avfoundation_glue.mm ('k') | media/video/capture/mac/video_capture_device_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698