Chromium Code Reviews| Index: media/capture/video/video_capture_system.h |
| diff --git a/media/capture/video/video_capture_system.h b/media/capture/video/video_capture_system.h |
| index 78a4bd7be9c31c6f303ce09669e5c63ef8f93d9f..02bf6d37a6c79dd8a667f56f4ebe6506076b19f8 100644 |
| --- a/media/capture/video/video_capture_system.h |
| +++ b/media/capture/video/video_capture_system.h |
| @@ -10,28 +10,33 @@ |
| namespace media { |
| -// Layer on top of VideoCaptureDeviceFactory that translates device descriptors |
| -// to string identifiers and consolidates and caches device descriptors and |
| -// supported formats into VideoCaptureDeviceInfos. |
| class CAPTURE_EXPORT VideoCaptureSystem { |
| public: |
| using DeviceInfoCallback = |
| base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>; |
| - explicit VideoCaptureSystem( |
| - std::unique_ptr<VideoCaptureDeviceFactory> factory); |
| - ~VideoCaptureSystem(); |
| - |
| - void GetDeviceInfosAsync(const DeviceInfoCallback& result_callback); |
| + virtual ~VideoCaptureSystem() {} |
| + virtual void GetDeviceInfosAsync( |
| + const DeviceInfoCallback& result_callback) = 0; |
| // Creates a VideoCaptureDevice object. Returns nullptr if something goes |
| // wrong. |
| - std::unique_ptr<VideoCaptureDevice> CreateDevice( |
| - const std::string& device_id); |
| + virtual std::unique_ptr<VideoCaptureDevice> CreateDevice( |
| + const std::string& device_id) = 0; |
| +}; |
| - media::VideoCaptureDeviceFactory* video_capture_device_factory() const { |
| - return factory_.get(); |
| - } |
| +// Layer on top of VideoCaptureDeviceFactory that translates device descriptors |
| +// to string identifiers and consolidates and caches device descriptors and |
| +// supported formats into VideoCaptureDeviceInfos. |
| +class CAPTURE_EXPORT VideoCaptureSystemImpl : public VideoCaptureSystem { |
|
miu
2017/04/03 21:31:24
Should this be in a separate video_capture_system_
chfremer
2017/04/04 21:59:32
Done.
|
| + public: |
| + explicit VideoCaptureSystemImpl( |
| + std::unique_ptr<VideoCaptureDeviceFactory> factory); |
| + ~VideoCaptureSystemImpl() override; |
| + |
| + void GetDeviceInfosAsync(const DeviceInfoCallback& result_callback) override; |
| + std::unique_ptr<VideoCaptureDevice> CreateDevice( |
| + const std::string& device_id) override; |
| private: |
| void OnDescriptorsReceived( |