| 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/video/capture/win/video_capture_device_factory_win.h" | 5 #include "media/video/capture/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 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (!PrepareVideoCaptureAttributesMediaFoundation(attributes.Receive(), 1)) | 101 if (!PrepareVideoCaptureAttributesMediaFoundation(attributes.Receive(), 1)) |
| 102 return false; | 102 return false; |
| 103 | 103 |
| 104 return SUCCEEDED(MFEnumDeviceSources(attributes.get(), devices, count)); | 104 return SUCCEEDED(MFEnumDeviceSources(attributes.get(), devices, count)); |
| 105 } | 105 } |
| 106 | 106 |
| 107 static bool IsDeviceBlackListed(const std::string& name) { | 107 static bool IsDeviceBlackListed(const std::string& name) { |
| 108 DCHECK_EQ(BLACKLISTED_CAMERA_MAX + 1, | 108 DCHECK_EQ(BLACKLISTED_CAMERA_MAX + 1, |
| 109 static_cast<int>(arraysize(kBlacklistedCameraNames))); | 109 static_cast<int>(arraysize(kBlacklistedCameraNames))); |
| 110 for (size_t i = 0; i < arraysize(kBlacklistedCameraNames); ++i) { | 110 for (size_t i = 0; i < arraysize(kBlacklistedCameraNames); ++i) { |
| 111 if (base::StartsWithASCII(name, kBlacklistedCameraNames[i], false)) { | 111 if (base::StartsWith(name, kBlacklistedCameraNames[i], |
| 112 base::CompareCase::INSENSITIVE_ASCII)) { |
| 112 DVLOG(1) << "Enumerated blacklisted device: " << name; | 113 DVLOG(1) << "Enumerated blacklisted device: " << name; |
| 113 UMA_HISTOGRAM_ENUMERATION("Media.VideoCapture.BlacklistedDevice", | 114 UMA_HISTOGRAM_ENUMERATION("Media.VideoCapture.BlacklistedDevice", |
| 114 i, BLACKLISTED_CAMERA_MAX + 1); | 115 i, BLACKLISTED_CAMERA_MAX + 1); |
| 115 return true; | 116 return true; |
| 116 } | 117 } |
| 117 } | 118 } |
| 118 return false; | 119 return false; |
| 119 } | 120 } |
| 120 | 121 |
| 121 static void GetDeviceNamesDirectShow(Names* device_names) { | 122 static void GetDeviceNamesDirectShow(Names* device_names) { |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 426 } |
| 426 | 427 |
| 427 // static | 428 // static |
| 428 VideoCaptureDeviceFactory* | 429 VideoCaptureDeviceFactory* |
| 429 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 430 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
| 430 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 431 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 431 return new VideoCaptureDeviceFactoryWin(); | 432 return new VideoCaptureDeviceFactoryWin(); |
| 432 } | 433 } |
| 433 | 434 |
| 434 } // namespace media | 435 } // namespace media |
| OLD | NEW |