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

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

Issue 468833002: Mac QTKit Video Capture: Force BlackMagic cameras to be opened in HD (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 side-by-side diff with in-line comments
Download patch
Index: media/video/capture/mac/video_capture_device_mac.mm
diff --git a/media/video/capture/mac/video_capture_device_mac.mm b/media/video/capture/mac/video_capture_device_mac.mm
index b13496c8058bb3602e52b9fded4f9d42aa69a824..cab8717bda1a081885dbc65008858b35a1dd7790 100644
--- a/media/video/capture/mac/video_capture_device_mac.mm
+++ b/media/video/capture/mac/video_capture_device_mac.mm
@@ -43,8 +43,8 @@
namespace media {
-const int kMinFrameRate = 1;
-const int kMaxFrameRate = 30;
+const float kMinFrameRate = 1.0f;
tommi (sloooow) - chröme 2014/08/13 12:42:29 can you add documentation for these constants? I'
mcasas 2014/08/13 14:04:52 Done.
+const float kMaxFrameRate = 30.0f;
// In device identifiers, the USB VID and PID are stored in 4 bytes each.
const size_t kVidPidSize = 4;
@@ -350,7 +350,9 @@ VideoCaptureDeviceMac::VideoCaptureDeviceMac(const Name& device_name)
state_(kNotInitialized),
capture_device_(nil),
weak_factory_(this) {
- final_resolution_selected_ = AVFoundationGlue::IsAVFoundationSupported();
+ // Avoid reconfiguring AVFoundation or blacklisted devices.
+ final_resolution_selected_ = AVFoundationGlue::IsAVFoundationSupported() ||
+ device_name.is_blacklisted();
}
VideoCaptureDeviceMac::~VideoCaptureDeviceMac() {
@@ -569,13 +571,13 @@ void VideoCaptureDeviceMac::LogMessage(const std::string& message) {
}
bool VideoCaptureDeviceMac::UpdateCaptureResolution() {
- if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height()
- width:capture_format_.frame_size.width()
- frameRate:capture_format_.frame_rate]) {
- ReceiveError("Could not configure capture device.");
- return false;
- }
- return true;
+ if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height()
+ width:capture_format_.frame_size.width()
+ frameRate:capture_format_.frame_rate]) {
+ ReceiveError("Could not configure capture device.");
+ return false;
+ }
+ return true;
}
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698