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

Side by Side Diff: media/video/capture/mac/video_capture_device_mac.mm

Issue 485103006: Mac Video Capture: correct float framerate wrongly casted to int (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | 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 <IOKit/IOCFPlugIn.h> 7 #include <IOKit/IOCFPlugIn.h>
8 #include <IOKit/usb/IOUSBLib.h> 8 #include <IOKit/usb/IOUSBLib.h>
9 #include <IOKit/usb/USBSpec.h> 9 #include <IOKit/usb/USBSpec.h>
10 10
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 void VideoCaptureDeviceMac::AllocateAndStart( 364 void VideoCaptureDeviceMac::AllocateAndStart(
365 const VideoCaptureParams& params, 365 const VideoCaptureParams& params,
366 scoped_ptr<VideoCaptureDevice::Client> client) { 366 scoped_ptr<VideoCaptureDevice::Client> client) {
367 DCHECK(task_runner_->BelongsToCurrentThread()); 367 DCHECK(task_runner_->BelongsToCurrentThread());
368 if (state_ != kIdle) { 368 if (state_ != kIdle) {
369 return; 369 return;
370 } 370 }
371 int width = params.requested_format.frame_size.width(); 371 int width = params.requested_format.frame_size.width();
372 int height = params.requested_format.frame_size.height(); 372 int height = params.requested_format.frame_size.height();
373 int frame_rate = params.requested_format.frame_rate; 373 float frame_rate = params.requested_format.frame_rate;
374 374
375 // QTKit API can scale captured frame to any size requested, which would lead 375 // QTKit API can scale captured frame to any size requested, which would lead
376 // to undesired aspect ratio changes. Try to open the camera with a known 376 // to undesired aspect ratio changes. Try to open the camera with a known
377 // supported format and let the client crop/pad the captured frames. 377 // supported format and let the client crop/pad the captured frames.
378 if (!AVFoundationGlue::IsAVFoundationSupported()) 378 if (!AVFoundationGlue::IsAVFoundationSupported())
379 GetBestMatchSupportedResolution(&width, &height); 379 GetBestMatchSupportedResolution(&width, &height);
380 380
381 client_ = client.Pass(); 381 client_ = client.Pass();
382 if (device_name_.capture_api_type() == Name::AVFOUNDATION) 382 if (device_name_.capture_api_type() == Name::AVFOUNDATION)
383 LogMessage("Using AVFoundation for device: " + device_name_.name()); 383 LogMessage("Using AVFoundation for device: " + device_name_.name());
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() 574 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height()
575 width:capture_format_.frame_size.width() 575 width:capture_format_.frame_size.width()
576 frameRate:capture_format_.frame_rate]) { 576 frameRate:capture_format_.frame_rate]) {
577 ReceiveError("Could not configure capture device."); 577 ReceiveError("Could not configure capture device.");
578 return false; 578 return false;
579 } 579 }
580 return true; 580 return true;
581 } 581 }
582 582
583 } // namespace media 583 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698