OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_SERVICE_VIDEO_CAPTURE_PROVIDER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_SERVICE_VIDEO_CAPTURE_PROVIDER_H_ |
| 7 |
| 8 #include "base/threading/thread_checker.h" |
| 9 #include "content/browser/renderer_host/media/video_capture_provider.h" |
| 10 #include "services/video_capture/public/interfaces/device_factory.mojom.h" |
| 11 #include "services/video_capture/public/interfaces/device_factory_provider.mojom
.h" |
| 12 |
| 13 namespace service_manager { |
| 14 class Connector; |
| 15 } |
| 16 |
| 17 namespace content { |
| 18 |
| 19 // Implementation of VideoCaptureProvider that uses the "video_capture" service. |
| 20 class CONTENT_EXPORT ServiceVideoCaptureProvider : public VideoCaptureProvider { |
| 21 public: |
| 22 ServiceVideoCaptureProvider(); |
| 23 ~ServiceVideoCaptureProvider() override; |
| 24 |
| 25 void Uninitialize() override; |
| 26 |
| 27 void GetDeviceInfosAsync( |
| 28 const base::Callback<void( |
| 29 const std::vector<media::VideoCaptureDeviceInfo>&)>& result_callback) |
| 30 override; |
| 31 |
| 32 std::unique_ptr<VideoCaptureDeviceLauncher> CreateDeviceLauncher() override; |
| 33 |
| 34 private: |
| 35 void LazyConnectToService(); |
| 36 void OnLostConnectionToDeviceFactory(); |
| 37 |
| 38 std::unique_ptr<service_manager::Connector> connector_; |
| 39 // We must hold on to |device_factory_provider_| because it holds the |
| 40 // service-side binding for |device_factory_|. |
| 41 video_capture::mojom::DeviceFactoryProviderPtr device_factory_provider_; |
| 42 video_capture::mojom::DeviceFactoryPtr device_factory_; |
| 43 base::ThreadChecker thread_checker_; |
| 44 }; |
| 45 |
| 46 } // namespace content |
| 47 |
| 48 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_SERVICE_VIDEO_CAPTURE_PROVIDER_H_ |
OLD | NEW |