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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 if (!PrepareVideoCaptureAttributesMediaFoundation(attributes.Receive(), 1)) | 96 if (!PrepareVideoCaptureAttributesMediaFoundation(attributes.Receive(), 1)) |
97 return false; | 97 return false; |
98 | 98 |
99 return SUCCEEDED(MFEnumDeviceSources(attributes.get(), devices, count)); | 99 return SUCCEEDED(MFEnumDeviceSources(attributes.get(), devices, count)); |
100 } | 100 } |
101 | 101 |
102 static bool IsDeviceBlackListed(const std::string& name) { | 102 static bool IsDeviceBlackListed(const std::string& name) { |
103 DCHECK_EQ(BLACKLISTED_CAMERA_MAX + 1, | 103 DCHECK_EQ(BLACKLISTED_CAMERA_MAX + 1, |
104 static_cast<int>(arraysize(kBlacklistedCameraNames))); | 104 static_cast<int>(arraysize(kBlacklistedCameraNames))); |
105 for (size_t i = 0; i < arraysize(kBlacklistedCameraNames); ++i) { | 105 for (size_t i = 0; i < arraysize(kBlacklistedCameraNames); ++i) { |
106 if (StartsWithASCII(name, kBlacklistedCameraNames[i], false)) { | 106 if (base::StartsWithASCII(name, kBlacklistedCameraNames[i], false)) { |
107 DVLOG(1) << "Enumerated blacklisted device: " << name; | 107 DVLOG(1) << "Enumerated blacklisted device: " << name; |
108 UMA_HISTOGRAM_ENUMERATION("Media.VideoCapture.BlacklistedDevice", | 108 UMA_HISTOGRAM_ENUMERATION("Media.VideoCapture.BlacklistedDevice", |
109 i, BLACKLISTED_CAMERA_MAX + 1); | 109 i, BLACKLISTED_CAMERA_MAX + 1); |
110 return true; | 110 return true; |
111 } | 111 } |
112 } | 112 } |
113 return false; | 113 return false; |
114 } | 114 } |
115 | 115 |
116 static void GetDeviceNamesDirectShow(Names* device_names) { | 116 static void GetDeviceNamesDirectShow(Names* device_names) { |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 } | 419 } |
420 | 420 |
421 // static | 421 // static |
422 VideoCaptureDeviceFactory* | 422 VideoCaptureDeviceFactory* |
423 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 423 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
424 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 424 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
425 return new VideoCaptureDeviceFactoryWin(); | 425 return new VideoCaptureDeviceFactoryWin(); |
426 } | 426 } |
427 | 427 |
428 } // namespace media | 428 } // namespace media |
OLD | NEW |