OLD | NEW |
---|---|
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" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #import "media/video/capture/mac/avfoundation_glue.h" | 12 #import "media/video/capture/mac/avfoundation_glue.h" |
13 #import "media/video/capture/mac/platform_video_capturing_mac.h" | 13 #import "media/video/capture/mac/platform_video_capturing_mac.h" |
14 #import "media/video/capture/mac/video_capture_device_avfoundation_mac.h" | 14 #import "media/video/capture/mac/video_capture_device_avfoundation_mac.h" |
15 #import "media/video/capture/mac/video_capture_device_qtkit_mac.h" | 15 #import "media/video/capture/mac/video_capture_device_qtkit_mac.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 const int kMinFrameRate = 1; | 19 const int kMinFrameRate = 1; |
20 const int kMaxFrameRate = 30; | 20 const int kMaxFrameRate = 30; |
21 | 21 |
22 // In device identifiers, the USB VID and PID are stored in 4 bytes each. | 22 // In device identifiers, the USB VID and PID are stored in 4 bytes each. |
23 const size_t kVidPidSize = 4; | 23 const size_t kVidPidSize = 4; |
24 | 24 |
25 // Some devices are not correctly supported in AVFoundation, f.i. Blackmagic, | 25 // Some devices are not correctly supported in AVFoundation, f.i. Blackmagic, |
26 // see http://crbug.com/347371. The devices are identified by USB Vendor ID and | 26 // see http://crbug.com/347371. The devices are identified by USB Vendor ID and |
27 // by a characteristic substring of the name, usually the vendor's name. | 27 // by a characteristic substring of the name, usually the vendor's name. USB VID |
28 // is written uppercase. | |
tommi (sloooow) - chröme
2014/04/28 08:17:10
nit: written in uppercase
Btw, would it make sens
mcasas
2014/04/28 08:31:20
Yeah I doubted between that and forcing uppercase
| |
28 const struct NameAndVid { | 29 const struct NameAndVid { |
29 const char* vid; | 30 const char* vid; |
30 const char* name; | 31 const char* name; |
31 } kBlacklistedCameras[] = { { "a82c", "Blackmagic" } }; | 32 } kBlacklistedCameras[] = { { "A82C", "Blackmagic" } }; |
32 | 33 |
33 const struct Resolution { | 34 const struct Resolution { |
34 const int width; | 35 const int width; |
35 const int height; | 36 const int height; |
36 } kQVGA = { 320, 240 }, | 37 } kQVGA = { 320, 240 }, |
37 kVGA = { 640, 480 }, | 38 kVGA = { 640, 480 }, |
38 kHD = { 1280, 720 }; | 39 kHD = { 1280, 720 }; |
39 | 40 |
40 const struct Resolution* const kWellSupportedResolutions[] = { | 41 const struct Resolution* const kWellSupportedResolutions[] = { |
41 &kQVGA, | 42 &kQVGA, |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |
OLD | NEW |