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" |
(...skipping 22 matching lines...) Expand all Loading... |
33 return scoped_ptr<VideoCaptureDeviceFactory>(new | 33 return scoped_ptr<VideoCaptureDeviceFactory>(new |
34 media::FakeVideoCaptureDeviceFactory()); | 34 media::FakeVideoCaptureDeviceFactory()); |
35 } | 35 } |
36 } else { | 36 } else { |
37 #if defined(OS_MACOSX) | 37 #if defined(OS_MACOSX) |
38 return scoped_ptr<VideoCaptureDeviceFactory>(new | 38 return scoped_ptr<VideoCaptureDeviceFactory>(new |
39 VideoCaptureDeviceFactoryMac()); | 39 VideoCaptureDeviceFactoryMac()); |
40 #elif defined(OS_LINUX) | 40 #elif defined(OS_LINUX) |
41 return scoped_ptr<VideoCaptureDeviceFactory>(new | 41 return scoped_ptr<VideoCaptureDeviceFactory>(new |
42 VideoCaptureDeviceFactoryLinux()); | 42 VideoCaptureDeviceFactoryLinux()); |
| 43 #elif defined(OS_LINUX) |
| 44 return scoped_ptr<VideoCaptureDeviceFactory>(new |
| 45 VideoCaptureDeviceFactoryLinux()); |
43 #elif defined(OS_ANDROID) | 46 #elif defined(OS_ANDROID) |
44 return scoped_ptr<VideoCaptureDeviceFactory>(new | 47 return scoped_ptr<VideoCaptureDeviceFactory>(new |
45 VideoCaptureDeviceFactoryAndroid()); | 48 VideoCaptureDeviceFactoryAndroid()); |
46 #else | 49 #else |
47 return scoped_ptr<VideoCaptureDeviceFactory>(new | 50 return scoped_ptr<VideoCaptureDeviceFactory>(new |
48 VideoCaptureDeviceFactory()); | 51 VideoCaptureDeviceFactory()); |
49 #endif | 52 #endif |
50 } | 53 } |
51 } | 54 } |
52 | 55 |
53 VideoCaptureDeviceFactory::VideoCaptureDeviceFactory() { | 56 VideoCaptureDeviceFactory::VideoCaptureDeviceFactory() { |
54 thread_checker_.DetachFromThread(); | 57 thread_checker_.DetachFromThread(); |
55 } | 58 } |
56 | 59 |
57 VideoCaptureDeviceFactory::~VideoCaptureDeviceFactory() {} | 60 VideoCaptureDeviceFactory::~VideoCaptureDeviceFactory() {} |
58 | 61 |
59 scoped_ptr<VideoCaptureDevice> VideoCaptureDeviceFactory::Create( | 62 scoped_ptr<VideoCaptureDevice> VideoCaptureDeviceFactory::Create( |
| 63 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
60 const VideoCaptureDevice::Name& device_name) { | 64 const VideoCaptureDevice::Name& device_name) { |
61 DCHECK(thread_checker_.CalledOnValidThread()); | 65 DCHECK(thread_checker_.CalledOnValidThread()); |
62 return scoped_ptr<VideoCaptureDevice>( | 66 return scoped_ptr<VideoCaptureDevice>( |
63 VideoCaptureDevice::Create(device_name)); | 67 VideoCaptureDevice::Create(ui_task_runner, device_name)); |
64 } | 68 } |
65 | 69 |
66 void VideoCaptureDeviceFactory::GetDeviceNames( | 70 void VideoCaptureDeviceFactory::GetDeviceNames( |
67 VideoCaptureDevice::Names* device_names) { | 71 VideoCaptureDevice::Names* device_names) { |
68 DCHECK(thread_checker_.CalledOnValidThread()); | 72 DCHECK(thread_checker_.CalledOnValidThread()); |
69 VideoCaptureDevice::GetDeviceNames(device_names); | 73 VideoCaptureDevice::GetDeviceNames(device_names); |
70 } | 74 } |
71 | 75 |
72 void VideoCaptureDeviceFactory::GetDeviceSupportedFormats( | 76 void VideoCaptureDeviceFactory::GetDeviceSupportedFormats( |
73 const VideoCaptureDevice::Name& device, | 77 const VideoCaptureDevice::Name& device, |
74 VideoCaptureFormats* supported_formats) { | 78 VideoCaptureFormats* supported_formats) { |
75 DCHECK(thread_checker_.CalledOnValidThread()); | 79 DCHECK(thread_checker_.CalledOnValidThread()); |
76 VideoCaptureDevice::GetDeviceSupportedFormats(device, supported_formats); | 80 VideoCaptureDevice::GetDeviceSupportedFormats(device, supported_formats); |
77 } | 81 } |
78 | 82 |
79 } // namespace media | 83 } // namespace media |
OLD | NEW |