OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/capture/video/win/video_capture_device_factory_win.h" | 5 #include "media/capture/video/win/video_capture_device_factory_win.h" |
6 | 6 |
7 #include <mfapi.h> | 7 #include <mfapi.h> |
8 #include <mferror.h> | 8 #include <mferror.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 return SUCCEEDED(MFEnumDeviceSources(attributes.get(), devices, count)); | 107 return SUCCEEDED(MFEnumDeviceSources(attributes.get(), devices, count)); |
108 } | 108 } |
109 | 109 |
110 static bool IsDeviceBlackListed(const std::string& name) { | 110 static bool IsDeviceBlackListed(const std::string& name) { |
111 DCHECK_EQ(BLACKLISTED_CAMERA_MAX + 1, | 111 DCHECK_EQ(BLACKLISTED_CAMERA_MAX + 1, |
112 static_cast<int>(arraysize(kBlacklistedCameraNames))); | 112 static_cast<int>(arraysize(kBlacklistedCameraNames))); |
113 for (size_t i = 0; i < arraysize(kBlacklistedCameraNames); ++i) { | 113 for (size_t i = 0; i < arraysize(kBlacklistedCameraNames); ++i) { |
114 if (base::StartsWith(name, kBlacklistedCameraNames[i], | 114 if (base::StartsWith(name, kBlacklistedCameraNames[i], |
115 base::CompareCase::INSENSITIVE_ASCII)) { | 115 base::CompareCase::INSENSITIVE_ASCII)) { |
116 DVLOG(1) << "Enumerated blacklisted device: " << name; | 116 DVLOG(1) << "Enumerated blacklisted device: " << name; |
117 UMA_HISTOGRAM_ENUMERATION("Media.VideoCapture.BlacklistedDevice", i, | 117 UMA_HISTOGRAM_ENUMERATION("Media.VideoCapture.BlacklistedDevice", |
| 118 static_cast<int32_t>(i), |
118 BLACKLISTED_CAMERA_MAX + 1); | 119 BLACKLISTED_CAMERA_MAX + 1); |
119 return true; | 120 return true; |
120 } | 121 } |
121 } | 122 } |
122 return false; | 123 return false; |
123 } | 124 } |
124 | 125 |
125 static void GetDeviceNamesDirectShow(Names* device_names) { | 126 static void GetDeviceNamesDirectShow(Names* device_names) { |
126 DCHECK(device_names); | 127 DCHECK(device_names); |
127 DVLOG(1) << " GetDeviceNamesDirectShow"; | 128 DVLOG(1) << " GetDeviceNamesDirectShow"; |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 } | 421 } |
421 | 422 |
422 // static | 423 // static |
423 VideoCaptureDeviceFactory* | 424 VideoCaptureDeviceFactory* |
424 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 425 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
425 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 426 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
426 return new VideoCaptureDeviceFactoryWin(); | 427 return new VideoCaptureDeviceFactoryWin(); |
427 } | 428 } |
428 | 429 |
429 } // namespace media | 430 } // namespace media |
OLD | NEW |