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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..63e836f55b029ba65b9b4cef1dcb86b35707d6ac |
| --- /dev/null |
| +++ b/media/capture/video/video_capture_system.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ |
| +#define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ |
| + |
| +#include "media/capture/video/video_capture_device_factory.h" |
| +#include "media/capture/video/video_capture_device_info.h" |
| + |
| +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: |
| + VideoCaptureSystem(std::unique_ptr<VideoCaptureDeviceFactory> factory); |
|
miu
2017/03/22 22:51:24
explicit
chfremer
2017/03/23 00:34:13
Done.
|
| + ~VideoCaptureSystem(); |
| + |
| + void GetDeviceInfosAsync( |
| + const base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>& |
|
miu
2017/03/22 22:51:23
nit: Since the callback is used in more than one p
chfremer
2017/03/23 00:34:13
Done.
|
| + result_callback); |
| + |
| + // Creates a VideoCaptureDevice object. Returns NULL if something goes wrong. |
| + std::unique_ptr<VideoCaptureDevice> CreateDevice(const std::string device_id); |
| + |
| + media::VideoCaptureDeviceFactory* video_capture_device_factory() { |
|
miu
2017/03/22 22:51:24
nit:
media::VideoCaptureDeviceFactory* video_ca
miu
2017/03/22 22:51:24
Is the plan to remove this accessor in later CLs,
chfremer
2017/03/23 00:34:13
Done.
chfremer
2017/03/23 00:34:13
Yes. This accessor is going to go away in CL19.
|
| + return factory_.get(); |
| + } |
| + |
| + private: |
| + void OnDescriptorsReceived( |
| + const base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>& |
|
miu
2017/03/22 22:51:24
DeviceInfoCallback here. (and in the methods in th
chfremer
2017/03/23 00:34:14
Done.
|
| + result_callback, |
| + std::unique_ptr<VideoCaptureDeviceDescriptors> descriptors); |
| + |
| + // Returns false if no descriptor found. |
| + bool LookupDescriptorFromId(const std::string& device_id, |
| + media::VideoCaptureDeviceDescriptor* descriptor); |
| + |
| + const std::unique_ptr<VideoCaptureDeviceFactory> factory_; |
| + std::vector<VideoCaptureDeviceInfo> devices_info_cache_; |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |