| 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 namespace media { | 12 namespace media { |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 scoped_ptr<VideoCaptureDeviceFactory> VideoCaptureDeviceFactory::CreateFactory( | 15 scoped_ptr<VideoCaptureDeviceFactory> VideoCaptureDeviceFactory::CreateFactory( |
| 16 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 16 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 17 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 17 const base::CommandLine* command_line = |
| 18 base::CommandLine::ForCurrentProcess(); |
| 18 // Use a Fake or File Video Device Factory if the command line flags are | 19 // Use a Fake or File Video Device Factory if the command line flags are |
| 19 // present, otherwise use the normal, platform-dependent, device factory. | 20 // present, otherwise use the normal, platform-dependent, device factory. |
| 20 if (command_line->HasSwitch(switches::kUseFakeDeviceForMediaStream)) { | 21 if (command_line->HasSwitch(switches::kUseFakeDeviceForMediaStream)) { |
| 21 if (command_line->HasSwitch(switches::kUseFileForFakeVideoCapture)) { | 22 if (command_line->HasSwitch(switches::kUseFileForFakeVideoCapture)) { |
| 22 return scoped_ptr<VideoCaptureDeviceFactory>(new | 23 return scoped_ptr<VideoCaptureDeviceFactory>(new |
| 23 media::FileVideoCaptureDeviceFactory()); | 24 media::FileVideoCaptureDeviceFactory()); |
| 24 } else { | 25 } else { |
| 25 return scoped_ptr<VideoCaptureDeviceFactory>(new | 26 return scoped_ptr<VideoCaptureDeviceFactory>(new |
| 26 media::FakeVideoCaptureDeviceFactory()); | 27 media::FakeVideoCaptureDeviceFactory()); |
| 27 } | 28 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 53 // static | 54 // static |
| 54 VideoCaptureDeviceFactory* | 55 VideoCaptureDeviceFactory* |
| 55 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 56 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
| 56 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 57 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 57 NOTIMPLEMENTED(); | 58 NOTIMPLEMENTED(); |
| 58 return NULL; | 59 return NULL; |
| 59 } | 60 } |
| 60 #endif | 61 #endif |
| 61 | 62 |
| 62 } // namespace media | 63 } // namespace media |
| OLD | NEW |