| 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", | 117 UMA_HISTOGRAM_ENUMERATION("Media.VideoCapture.BlacklistedDevice", i, |
| 118 static_cast<int32_t>(i), | |
| 119 BLACKLISTED_CAMERA_MAX + 1); | 118 BLACKLISTED_CAMERA_MAX + 1); |
| 120 return true; | 119 return true; |
| 121 } | 120 } |
| 122 } | 121 } |
| 123 return false; | 122 return false; |
| 124 } | 123 } |
| 125 | 124 |
| 126 static void GetDeviceNamesDirectShow(Names* device_names) { | 125 static void GetDeviceNamesDirectShow(Names* device_names) { |
| 127 DCHECK(device_names); | 126 DCHECK(device_names); |
| 128 DVLOG(1) << " GetDeviceNamesDirectShow"; | 127 DVLOG(1) << " GetDeviceNamesDirectShow"; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } | 420 } |
| 422 | 421 |
| 423 // static | 422 // static |
| 424 VideoCaptureDeviceFactory* | 423 VideoCaptureDeviceFactory* |
| 425 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 424 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
| 426 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 425 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 427 return new VideoCaptureDeviceFactoryWin(); | 426 return new VideoCaptureDeviceFactoryWin(); |
| 428 } | 427 } |
| 429 | 428 |
| 430 } // namespace media | 429 } // namespace media |
| OLD | NEW |