 Chromium Code Reviews
 Chromium Code Reviews Issue 720043003:
  Use factory method to create VideoCaptureDeviceFactory .  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 720043003:
  Use factory method to create VideoCaptureDeviceFactory .  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: media/video/capture/video_capture_device_factory.cc | 
| diff --git a/media/video/capture/video_capture_device_factory.cc b/media/video/capture/video_capture_device_factory.cc | 
| index 00a8f7ec3d4c6d2d34899a17818ce9399d4af11e..ba1cf55773bd60cb2c9834642cc8e58a84c56d1c 100644 | 
| --- a/media/video/capture/video_capture_device_factory.cc | 
| +++ b/media/video/capture/video_capture_device_factory.cc | 
| @@ -9,16 +9,6 @@ | 
| #include "media/video/capture/fake_video_capture_device_factory.h" | 
| #include "media/video/capture/file_video_capture_device_factory.h" | 
| -#if defined(OS_MACOSX) | 
| -#include "media/video/capture/mac/video_capture_device_factory_mac.h" | 
| -#elif defined(OS_LINUX) | 
| -#include "media/video/capture/linux/video_capture_device_factory_linux.h" | 
| -#elif defined(OS_ANDROID) | 
| -#include "media/video/capture/android/video_capture_device_factory_android.h" | 
| -#elif defined(OS_WIN) | 
| -#include "media/video/capture/win/video_capture_device_factory_win.h" | 
| -#endif | 
| - | 
| namespace media { | 
| // static | 
| @@ -38,22 +28,8 @@ scoped_ptr<VideoCaptureDeviceFactory> VideoCaptureDeviceFactory::CreateFactory( | 
| } else { | 
| // |ui_task_runner| is needed for the Linux ChromeOS factory to retrieve | 
| // screen rotations and for the Mac factory to run QTKit device enumeration. | 
| -#if defined(OS_MACOSX) | 
| - return scoped_ptr<VideoCaptureDeviceFactory>(new | 
| - VideoCaptureDeviceFactoryMac(ui_task_runner)); | 
| -#elif defined(OS_LINUX) | 
| - return scoped_ptr<VideoCaptureDeviceFactory>(new | 
| - VideoCaptureDeviceFactoryLinux(ui_task_runner)); | 
| -#elif defined(OS_ANDROID) | 
| - return scoped_ptr<VideoCaptureDeviceFactory>(new | 
| - VideoCaptureDeviceFactoryAndroid()); | 
| -#elif defined(OS_WIN) | 
| - return scoped_ptr<VideoCaptureDeviceFactory>(new | 
| - VideoCaptureDeviceFactoryWin()); | 
| -#else | 
| - return scoped_ptr<VideoCaptureDeviceFactory>(new | 
| - VideoCaptureDeviceFactory()); | 
| -#endif | 
| + return scoped_ptr<VideoCaptureDeviceFactory>( | 
| + CreateVideoCaptureDeviceFactory(ui_task_runner)); | 
| } | 
| } | 
| @@ -73,4 +49,13 @@ void VideoCaptureDeviceFactory::EnumerateDeviceNames(const base::Callback< | 
| callback.Run(device_names.Pass()); | 
| } | 
| +#if !defined(OS_MACOSX) && !defined(OS_LINUX) && !defined(OS_ANDROID) && !defined(OS_WIN) | 
| +// static | 
| +VideoCaptureDeviceFactory* | 
| +VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 
| + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 
| + return new VideoCaptureDeviceFactory(); | 
| 
mcasas
2014/11/19 22:25:32
Hmm this should never happen, should it? The only
 
ostap
2014/11/20 15:47:16
Done.
 | 
| +} | 
| +#endif | 
| + | 
| } // namespace media |