| 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_IMPL_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_IMPL_H_ |
| 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_IMPL_H_ | 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_IMPL_H_ |
| 7 | 7 |
| 8 #include "media/capture/video/video_capture_system.h" | 8 #include "media/capture/video/video_capture_system.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| 11 | 11 |
| 12 // Layer on top of VideoCaptureDeviceFactory that translates device descriptors | 12 // Layer on top of VideoCaptureDeviceFactory that translates device descriptors |
| 13 // to string identifiers and consolidates and caches device descriptors and | 13 // to string identifiers and consolidates and caches device descriptors and |
| 14 // supported formats into VideoCaptureDeviceInfos. | 14 // supported formats into VideoCaptureDeviceInfos. |
| 15 class CAPTURE_EXPORT VideoCaptureSystemImpl : public VideoCaptureSystem { | 15 class CAPTURE_EXPORT VideoCaptureSystemImpl : public VideoCaptureSystem { |
| 16 public: | 16 public: |
| 17 explicit VideoCaptureSystemImpl( | 17 explicit VideoCaptureSystemImpl( |
| 18 std::unique_ptr<VideoCaptureDeviceFactory> factory); | 18 std::unique_ptr<VideoCaptureDeviceFactory> factory); |
| 19 ~VideoCaptureSystemImpl() override; | 19 ~VideoCaptureSystemImpl() override; |
| 20 | 20 |
| 21 void GetDeviceInfosAsync(const DeviceInfoCallback& result_callback) override; | 21 void GetDeviceInfosAsync(const DeviceInfoCallback& result_callback) override; |
| 22 std::unique_ptr<VideoCaptureDevice> CreateDevice( | 22 std::unique_ptr<VideoCaptureDevice> CreateDevice( |
| 23 const std::string& device_id) override; | 23 const std::string& device_id) override; |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 void OnDescriptorsReceived( | |
| 27 const DeviceInfoCallback& result_callback, | |
| 28 std::unique_ptr<VideoCaptureDeviceDescriptors> descriptors); | |
| 29 | |
| 30 // Returns nullptr if no descriptor found. | 26 // Returns nullptr if no descriptor found. |
| 31 const VideoCaptureDeviceInfo* LookupDeviceInfoFromId( | 27 const VideoCaptureDeviceInfo* LookupDeviceInfoFromId( |
| 32 const std::string& device_id); | 28 const std::string& device_id); |
| 33 | 29 |
| 34 const std::unique_ptr<VideoCaptureDeviceFactory> factory_; | 30 const std::unique_ptr<VideoCaptureDeviceFactory> factory_; |
| 35 std::vector<VideoCaptureDeviceInfo> devices_info_cache_; | 31 std::vector<VideoCaptureDeviceInfo> devices_info_cache_; |
| 36 | 32 |
| 37 base::ThreadChecker thread_checker_; | 33 base::ThreadChecker thread_checker_; |
| 38 }; | 34 }; |
| 39 | 35 |
| 40 } // namespace media | 36 } // namespace media |
| 41 | 37 |
| 42 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_IMPL_H_ | 38 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_IMPL_H_ |
| OLD | NEW |