| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 MFInitializerSingleton() { MFStartup(MF_VERSION, MFSTARTUP_LITE); } | 45 MFInitializerSingleton() { MFStartup(MF_VERSION, MFSTARTUP_LITE); } |
| 46 ~MFInitializerSingleton() { MFShutdown(); } | 46 ~MFInitializerSingleton() { MFShutdown(); } |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 static base::LazyInstance<MFInitializerSingleton> g_mf_initialize = | 49 static base::LazyInstance<MFInitializerSingleton> g_mf_initialize = |
| 50 LAZY_INSTANCE_INITIALIZER; | 50 LAZY_INSTANCE_INITIALIZER; |
| 51 | 51 |
| 52 // Blacklisted devices are identified by a characteristic prefix of the name. | 52 // Blacklisted devices are identified by a characteristic prefix of the name. |
| 53 // This prefix is used case-insensitively. This list must be kept in sync with | 53 // This prefix is used case-insensitively. This list must be kept in sync with |
| 54 // |BlacklistedCameraNames|. | 54 // |BlacklistedCameraNames|. |
| 55 static const char* kBlacklistedCameraNames[] = { | 55 static const char* const kBlacklistedCameraNames[] = { |
| 56 // Name of a fake DirectShow filter on computers with GTalk installed. | 56 // Name of a fake DirectShow filter on computers with GTalk installed. |
| 57 {"Google Camera Adapter"}, | 57 "Google Camera Adapter", |
| 58 // The following two software WebCams cause crashes. | 58 // The following two software WebCams cause crashes. |
| 59 {"IP Camera [JPEG/MJPEG]"}, | 59 "IP Camera [JPEG/MJPEG]", |
| 60 {"CyberLink Webcam Splitter"} | 60 "CyberLink Webcam Splitter", |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 static void EnsureMediaFoundationInit() { | 63 static void EnsureMediaFoundationInit() { |
| 64 g_mf_initialize.Get(); | 64 g_mf_initialize.Get(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 static bool LoadMediaFoundationDlls() { | 67 static bool LoadMediaFoundationDlls() { |
| 68 static const wchar_t* const kMfDLLs[] = { | 68 static const wchar_t* const kMfDLLs[] = { |
| 69 L"%WINDIR%\\system32\\mf.dll", | 69 L"%WINDIR%\\system32\\mf.dll", |
| 70 L"%WINDIR%\\system32\\mfplat.dll", | 70 L"%WINDIR%\\system32\\mfplat.dll", |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 const Name& device, | 453 const Name& device, |
| 454 VideoCaptureFormats* formats) { | 454 VideoCaptureFormats* formats) { |
| 455 DCHECK(thread_checker_.CalledOnValidThread()); | 455 DCHECK(thread_checker_.CalledOnValidThread()); |
| 456 if (use_media_foundation_) | 456 if (use_media_foundation_) |
| 457 GetDeviceSupportedFormatsMediaFoundation(device, formats); | 457 GetDeviceSupportedFormatsMediaFoundation(device, formats); |
| 458 else | 458 else |
| 459 GetDeviceSupportedFormatsDirectShow(device, formats); | 459 GetDeviceSupportedFormatsDirectShow(device, formats); |
| 460 } | 460 } |
| 461 | 461 |
| 462 } // namespace media | 462 } // namespace media |
| OLD | NEW |