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

Side by Side Diff: media/video/capture/mac/video_capture_device_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: bemasc@ nit Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/video/capture/mac/video_capture_device_avfoundation_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/video/capture/mac/video_capture_device_mac.h" 5 #include "media/video/capture/mac/video_capture_device_mac.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 if (state_ != kIdle) { 182 if (state_ != kIdle) {
183 return; 183 return;
184 } 184 }
185 int width = params.requested_format.frame_size.width(); 185 int width = params.requested_format.frame_size.width();
186 int height = params.requested_format.frame_size.height(); 186 int height = params.requested_format.frame_size.height();
187 int frame_rate = params.requested_format.frame_rate; 187 int frame_rate = params.requested_format.frame_rate;
188 188
189 // QTKit API can scale captured frame to any size requested, which would lead 189 // QTKit API can scale captured frame to any size requested, which would lead
190 // to undesired aspect ratio changes. Try to open the camera with a known 190 // to undesired aspect ratio changes. Try to open the camera with a known
191 // supported format and let the client crop/pad the captured frames. 191 // supported format and let the client crop/pad the captured frames.
192 GetBestMatchSupportedResolution(&width, &height); 192 if (!AVFoundationGlue::IsAVFoundationSupported())
193 GetBestMatchSupportedResolution(&width, &height);
193 194
194 client_ = client.Pass(); 195 client_ = client.Pass();
195 NSString* deviceId = 196 NSString* deviceId =
196 [NSString stringWithUTF8String:device_name_.id().c_str()]; 197 [NSString stringWithUTF8String:device_name_.id().c_str()];
197 198
198 [capture_device_ setFrameReceiver:this]; 199 [capture_device_ setFrameReceiver:this];
199 200
200 if (![capture_device_ setCaptureDevice:deviceId]) { 201 if (![capture_device_ setCaptureDevice:deviceId]) {
201 SetErrorState("Could not open capture device."); 202 SetErrorState("Could not open capture device.");
202 return; 203 return;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() 376 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height()
376 width:capture_format_.frame_size.width() 377 width:capture_format_.frame_size.width()
377 frameRate:capture_format_.frame_rate]) { 378 frameRate:capture_format_.frame_rate]) {
378 ReceiveError("Could not configure capture device."); 379 ReceiveError("Could not configure capture device.");
379 return false; 380 return false;
380 } 381 }
381 return true; 382 return true;
382 } 383 }
383 384
384 } // namespace media 385 } // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/mac/video_capture_device_avfoundation_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698