| 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/video_capture_device_factory.h" | 5 #include "media/video/capture/video_capture_device_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "media/base/media_switches.h" | 8 #include "media/base/media_switches.h" |
| 9 #include "media/video/capture/fake_video_capture_device_factory.h" | 9 #include "media/video/capture/fake_video_capture_device_factory.h" |
| 10 #include "media/video/capture/file_video_capture_device_factory.h" | 10 #include "media/video/capture/file_video_capture_device_factory.h" |
| 11 | 11 |
| 12 #if defined(OS_MACOSX) | 12 #if defined(OS_MACOSX) |
| 13 #include "media/video/capture/mac/video_capture_device_factory_mac.h" | 13 #include "media/video/capture/mac/video_capture_device_factory_mac.h" |
| 14 #elif defined(OS_LINUX) | 14 #elif defined(OS_LINUX) |
| 15 #include "media/video/capture/linux/video_capture_device_factory_linux.h" | 15 #include "media/video/capture/linux/video_capture_device_factory_linux.h" |
| 16 #elif defined(OS_ANDROID) | 16 #elif defined(OS_ANDROID) |
| 17 #include "media/video/capture/android/video_capture_device_factory_android.h" | 17 #include "media/video/capture/android/video_capture_device_factory_android.h" |
| 18 #elif defined(OS_WIN) |
| 19 #include "media/video/capture/win/video_capture_device_factory_win.h" |
| 18 #endif | 20 #endif |
| 19 | 21 |
| 20 namespace media { | 22 namespace media { |
| 21 | 23 |
| 22 // static | 24 // static |
| 23 scoped_ptr<VideoCaptureDeviceFactory> | 25 scoped_ptr<VideoCaptureDeviceFactory> |
| 24 VideoCaptureDeviceFactory::CreateFactory() { | 26 VideoCaptureDeviceFactory::CreateFactory() { |
| 25 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 27 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 26 // Use a Fake or File Video Device Factory if the command line flags are | 28 // Use a Fake or File Video Device Factory if the command line flags are |
| 27 // present, otherwise use the normal, platform-dependent, device factory. | 29 // present, otherwise use the normal, platform-dependent, device factory. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 39 VideoCaptureDeviceFactoryMac()); | 41 VideoCaptureDeviceFactoryMac()); |
| 40 #elif defined(OS_LINUX) | 42 #elif defined(OS_LINUX) |
| 41 return scoped_ptr<VideoCaptureDeviceFactory>(new | 43 return scoped_ptr<VideoCaptureDeviceFactory>(new |
| 42 VideoCaptureDeviceFactoryLinux()); | 44 VideoCaptureDeviceFactoryLinux()); |
| 43 #elif defined(OS_LINUX) | 45 #elif defined(OS_LINUX) |
| 44 return scoped_ptr<VideoCaptureDeviceFactory>(new | 46 return scoped_ptr<VideoCaptureDeviceFactory>(new |
| 45 VideoCaptureDeviceFactoryLinux()); | 47 VideoCaptureDeviceFactoryLinux()); |
| 46 #elif defined(OS_ANDROID) | 48 #elif defined(OS_ANDROID) |
| 47 return scoped_ptr<VideoCaptureDeviceFactory>(new | 49 return scoped_ptr<VideoCaptureDeviceFactory>(new |
| 48 VideoCaptureDeviceFactoryAndroid()); | 50 VideoCaptureDeviceFactoryAndroid()); |
| 51 #elif defined(OS_WIN) |
| 52 return scoped_ptr<VideoCaptureDeviceFactory>(new |
| 53 VideoCaptureDeviceFactoryWin()); |
| 49 #else | 54 #else |
| 50 return scoped_ptr<VideoCaptureDeviceFactory>(new | 55 return scoped_ptr<VideoCaptureDeviceFactory>(new |
| 51 VideoCaptureDeviceFactory()); | 56 VideoCaptureDeviceFactory()); |
| 52 #endif | 57 #endif |
| 53 } | 58 } |
| 54 } | 59 } |
| 55 | 60 |
| 56 VideoCaptureDeviceFactory::VideoCaptureDeviceFactory() { | 61 VideoCaptureDeviceFactory::VideoCaptureDeviceFactory() { |
| 57 thread_checker_.DetachFromThread(); | 62 thread_checker_.DetachFromThread(); |
| 58 } | 63 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 74 } | 79 } |
| 75 | 80 |
| 76 void VideoCaptureDeviceFactory::GetDeviceSupportedFormats( | 81 void VideoCaptureDeviceFactory::GetDeviceSupportedFormats( |
| 77 const VideoCaptureDevice::Name& device, | 82 const VideoCaptureDevice::Name& device, |
| 78 VideoCaptureFormats* supported_formats) { | 83 VideoCaptureFormats* supported_formats) { |
| 79 DCHECK(thread_checker_.CalledOnValidThread()); | 84 DCHECK(thread_checker_.CalledOnValidThread()); |
| 80 VideoCaptureDevice::GetDeviceSupportedFormats(device, supported_formats); | 85 VideoCaptureDevice::GetDeviceSupportedFormats(device, supported_formats); |
| 81 } | 86 } |
| 82 | 87 |
| 83 } // namespace media | 88 } // namespace media |
| OLD | NEW |