| 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 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |
| 6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_H_ | 6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/threading/thread_checker.h" | 8 #include "base/threading/thread_checker.h" |
| 9 #include "media/video/capture/video_capture_device.h" | 9 #include "media/video/capture/video_capture_device.h" |
| 10 | 10 |
| 11 namespace media { | 11 namespace media { |
| 12 | 12 |
| 13 // VideoCaptureDeviceFactory is the base class for creation of video capture | 13 // VideoCaptureDeviceFactory is the base class for creation of video capture |
| 14 // devices in the different platforms. VCDFs are created by MediaStreamManager | 14 // devices in the different platforms. VCDFs are created by MediaStreamManager |
| 15 // on IO thread and plugged into VideoCaptureManager, who owns and operates them | 15 // on IO thread and plugged into VideoCaptureManager, who owns and operates them |
| 16 // in Device Thread (a.k.a. Audio Thread). | 16 // in Device Thread (a.k.a. Audio Thread). |
| 17 class MEDIA_EXPORT VideoCaptureDeviceFactory { | 17 class MEDIA_EXPORT VideoCaptureDeviceFactory { |
| 18 public: | 18 public: |
| 19 static scoped_ptr<VideoCaptureDeviceFactory> CreateFactory(); | |
| 20 | |
| 21 VideoCaptureDeviceFactory(); | 19 VideoCaptureDeviceFactory(); |
| 22 virtual ~VideoCaptureDeviceFactory(); | 20 virtual ~VideoCaptureDeviceFactory() {} |
| 23 | 21 |
| 24 // Creates a VideoCaptureDevice object. Returns NULL if something goes wrong. | 22 // Creates a VideoCaptureDevice object. Returns NULL if something goes wrong. |
| 25 virtual scoped_ptr<VideoCaptureDevice> Create( | 23 virtual scoped_ptr<VideoCaptureDevice> Create( |
| 26 const VideoCaptureDevice::Name& device_name); | 24 const VideoCaptureDevice::Name& device_name); |
| 27 | 25 |
| 28 // Gets the names of all video capture devices connected to this computer. | 26 // Gets the names of all video capture devices connected to this computer. |
| 29 virtual void GetDeviceNames(VideoCaptureDevice::Names* device_names); | 27 virtual void GetDeviceNames(VideoCaptureDevice::Names* device_names); |
| 30 | 28 |
| 31 // Gets the supported formats of a particular device attached to the system. | 29 // Gets the supported formats of a particular device attached to the system. |
| 32 // This method should be called before allocating or starting a device. In | 30 // This method should be called before allocating or starting a device. In |
| 33 // case format enumeration is not supported, or there was a problem, the | 31 // case format enumeration is not supported, or there was a problem, the |
| 34 // formats array will be empty. | 32 // formats array will be empty. |
| 35 virtual void GetDeviceSupportedFormats( | 33 virtual void GetDeviceSupportedFormats( |
| 36 const VideoCaptureDevice::Name& device, | 34 const VideoCaptureDevice::Name& device, |
| 37 VideoCaptureFormats* supported_formats); | 35 VideoCaptureFormats* supported_formats); |
| 38 | 36 |
| 39 protected: | 37 protected: |
| 40 base::ThreadChecker thread_checker_; | 38 base::ThreadChecker thread_checker_; |
| 41 | 39 |
| 42 private: | 40 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory); | 41 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory); |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 } // namespace media | 44 } // namespace media |
| 47 | 45 |
| 48 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_H_ | 46 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |
| OLD | NEW |