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

Side by Side Diff: content/browser/renderer_host/media/mojo_service_video_capture_device_launcher.h

Issue 2854443002: [Mojo Video Capture] Implement a VideoCaptureProvider that uses the video capture service
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(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_MOJO_SERVICE_VIDEO_CAPTURE_DEVICE_LA UNCHER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOJO_SERVICE_VIDEO_CAPTURE_DEVICE_LA UNCHER_H_
7
8 #include "content/browser/renderer_host/media/video_capture_controller.h"
9 #include "content/browser/renderer_host/media/video_capture_provider.h"
10 #include "content/public/common/media_stream_request.h"
11 #include "services/video_capture/public/interfaces/device_factory.mojom.h"
12
13 namespace content {
14
15 class MojoServiceVideoCaptureDeviceLauncher
16 : public VideoCaptureDeviceLauncher {
17 public:
18 MojoServiceVideoCaptureDeviceLauncher(
19 video_capture::mojom::DeviceFactoryPtr* device_factory);
20 ~MojoServiceVideoCaptureDeviceLauncher() override;
21
22 void LaunchDeviceAsync(const std::string& device_id,
23 MediaStreamType stream_type,
24 const media::VideoCaptureParams& params,
25 base::WeakPtr<media::VideoFrameReceiver> receiver,
26 Callbacks* callbacks,
27 base::OnceClosure done_cb) override;
28 void AbortLaunch() override;
29
30 void OnUtilizationReport(int frame_feedback_id, double utilization);
31
32 private:
33 enum class State {
34 READY_TO_LAUNCH,
35 DEVICE_START_IN_PROGRESS,
36 DEVICE_START_ABORTING
37 };
38
39 void OnCreateDeviceCallback(
40 const media::VideoCaptureParams& params,
41 video_capture::mojom::DevicePtr device,
42 base::WeakPtr<media::VideoFrameReceiver> receiver,
43 Callbacks* callbacks,
44 base::OnceClosure done_cb,
45 video_capture::mojom::DeviceAccessResultCode result_code);
46 void OnDeviceCreatedSuccessfully(
47 const media::VideoCaptureParams& params,
48 video_capture::mojom::DevicePtr device,
49 base::WeakPtr<media::VideoFrameReceiver> receiver,
50 Callbacks* callbacks,
51 base::OnceClosure done_cb);
52 void OnDeviceCreationFailed(Callbacks* callbacks, base::OnceClosure done_cb);
53
54 video_capture::mojom::DeviceFactoryPtr* const device_factory_;
55 State state_;
56 base::ThreadChecker thread_checker_;
57 };
58
59 } // namespace content
60
61 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOJO_SERVICE_VIDEO_CAPTURE_DEVICE _LAUNCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698