OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ |
6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ | 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ |
7 | 7 |
8 #include "media/capture/video/video_capture_device_factory.h" | 8 #include "media/capture/video/video_capture_device_factory.h" |
9 #include "media/capture/video/video_capture_device_info.h" | 9 #include "media/capture/video/video_capture_device_info.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 | 12 |
| 13 // GetDeviceInfosAsync() must be called at least once before calling |
| 14 // CreateDevice(). |
13 class CAPTURE_EXPORT VideoCaptureSystem { | 15 class CAPTURE_EXPORT VideoCaptureSystem { |
14 public: | 16 public: |
15 using DeviceInfoCallback = | 17 using DeviceInfoCallback = |
16 base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>; | 18 base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>; |
17 | 19 |
18 virtual ~VideoCaptureSystem() {} | 20 virtual ~VideoCaptureSystem() {} |
19 | 21 |
20 // The passed-in |result_callback| must have ownership of the called | 22 // The passed-in |result_callback| must have ownership of the called |
21 // VideoCaptureSystem instance to guarantee that it stays alive during the | 23 // VideoCaptureSystem instance to guarantee that it stays alive during the |
22 // asynchronous operation. | 24 // asynchronous operation. |
23 virtual void GetDeviceInfosAsync( | 25 virtual void GetDeviceInfosAsync( |
24 const DeviceInfoCallback& result_callback) = 0; | 26 const DeviceInfoCallback& result_callback) = 0; |
25 | 27 |
26 // Creates a VideoCaptureDevice object. Returns nullptr if something goes | 28 // Creates a VideoCaptureDevice object. Returns nullptr if something goes |
27 // wrong. | 29 // wrong. |
28 virtual std::unique_ptr<VideoCaptureDevice> CreateDevice( | 30 virtual std::unique_ptr<VideoCaptureDevice> CreateDevice( |
29 const std::string& device_id) = 0; | 31 const std::string& device_id) = 0; |
30 }; | 32 }; |
31 | 33 |
32 } // namespace media | 34 } // namespace media |
33 | 35 |
34 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ | 36 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ |
OLD | NEW |