Index: content/browser/renderer_host/media/mojo_service_video_capture_provider.h |
diff --git a/content/browser/renderer_host/media/mojo_service_video_capture_provider.h b/content/browser/renderer_host/media/mojo_service_video_capture_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ffbca09261c251d3e62843a6d3f21546ec1fc866 |
--- /dev/null |
+++ b/content/browser/renderer_host/media/mojo_service_video_capture_provider.h |
@@ -0,0 +1,43 @@ |
+// Copyright 2017 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOJO_SERVICE_VIDEO_CAPTURE_PROVIDER_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOJO_SERVICE_VIDEO_CAPTURE_PROVIDER_H_ |
+ |
+#include "base/threading/thread_checker.h" |
+#include "content/browser/renderer_host/media/video_capture_provider.h" |
+#include "services/video_capture/public/interfaces/device_factory.mojom.h" |
+#include "services/video_capture/public/interfaces/device_factory_provider.mojom.h" |
+ |
+namespace content { |
+ |
+class CONTENT_EXPORT MojoServiceVideoCaptureProvider |
+ : public VideoCaptureProvider { |
+ public: |
+ MojoServiceVideoCaptureProvider(); |
+ ~MojoServiceVideoCaptureProvider() override; |
+ |
+ void Uninitialize() override; |
+ |
+ void GetDeviceInfosAsync( |
+ const base::Callback<void( |
+ const std::vector<media::VideoCaptureDeviceInfo>&)>& result_callback) |
+ override; |
+ |
+ std::unique_ptr<VideoCaptureDeviceLauncher> CreateDeviceLauncher() override; |
+ |
+ private: |
+ void LazyConnectToService(); |
+ void OnLostConnectionToDeviceFactory(); |
+ |
+ // We must hold on to |device_factory_provider_| because it holds the |
+ // service-side binding for |device_factory_|. |
+ video_capture::mojom::DeviceFactoryProviderPtr device_factory_provider_; |
+ video_capture::mojom::DeviceFactoryPtr device_factory_; |
+ base::ThreadChecker thread_checker_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOJO_SERVICE_VIDEO_CAPTURE_PROVIDER_H_ |