Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: content/browser/renderer_host/media/mojo_service_video_capture_provider.h

Issue 2854443002: [Mojo Video Capture] Implement a VideoCaptureProvider that uses the video capture service
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698