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

Side by Side Diff: content/browser/renderer_host/media/mojo_service_launched_video_capture_device.cc

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 #include "content/browser/renderer_host/media/mojo_service_launched_video_captur e_device.h"
6
7 // #include "content/public/browser/browser_thread.h"
8 // #include "media/capture/video/video_frame_receiver_on_task_runner.h"
9 // #include "mojo/public/cpp/bindings/strong_binding.h"
10 // #include "services/video_capture/public/cpp/receiver_media_to_mojo_adapter.h"
11 // #include
12 // "services/video_capture/public/cpp/device_to_feedback_observer_adapter.h"
13
14 namespace content {
15
16 MojoServiceLaunchedVideoCaptureDevice::MojoServiceLaunchedVideoCaptureDevice(
17 video_capture::mojom::DevicePtr device)
18 : device_(std::move(device)) {
19 // Unretained |this| is safe, because |this| owns |device_|.
20 device_.set_connection_error_handler(base::Bind(
21 &MojoServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice,
22 base::Unretained(this)));
23 }
24
25 MojoServiceLaunchedVideoCaptureDevice::
26 ~MojoServiceLaunchedVideoCaptureDevice() {
27 DCHECK(thread_checker_.CalledOnValidThread());
28 device_.reset();
29 }
30
31 void MojoServiceLaunchedVideoCaptureDevice::GetPhotoCapabilities(
32 media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) const {
33 DCHECK(thread_checker_.CalledOnValidThread());
34 NOTIMPLEMENTED();
35 }
36
37 void MojoServiceLaunchedVideoCaptureDevice::SetPhotoOptions(
38 media::mojom::PhotoSettingsPtr settings,
39 media::VideoCaptureDevice::SetPhotoOptionsCallback callback) {
40 DCHECK(thread_checker_.CalledOnValidThread());
41 NOTIMPLEMENTED();
42 }
43
44 void MojoServiceLaunchedVideoCaptureDevice::TakePhoto(
45 media::VideoCaptureDevice::TakePhotoCallback callback) {
46 DCHECK(thread_checker_.CalledOnValidThread());
47 NOTIMPLEMENTED();
48 }
49
50 void MojoServiceLaunchedVideoCaptureDevice::MaybeSuspendDevice() {
51 DCHECK(thread_checker_.CalledOnValidThread());
52 NOTIMPLEMENTED();
53 }
54
55 void MojoServiceLaunchedVideoCaptureDevice::ResumeDevice() {
56 DCHECK(thread_checker_.CalledOnValidThread());
57 NOTIMPLEMENTED();
58 }
59
60 void MojoServiceLaunchedVideoCaptureDevice::RequestRefreshFrame() {
61 DCHECK(thread_checker_.CalledOnValidThread());
62 NOTIMPLEMENTED();
63 }
64
65 void MojoServiceLaunchedVideoCaptureDevice::SetDesktopCaptureWindowIdAsync(
66 gfx::NativeViewId window_id,
67 base::OnceClosure done_cb) {
68 DCHECK(thread_checker_.CalledOnValidThread());
69 // This method should only be called for desktop capture devices.
70 // The video_capture Mojo service does not support desktop capture devices
71 // (yet) and should not be used for it.
72 NOTREACHED();
73 }
74
75 void MojoServiceLaunchedVideoCaptureDevice::OnUtilizationReport(
76 int frame_feedback_id,
77 double utilization) {
78 DCHECK(thread_checker_.CalledOnValidThread());
79 device_->OnReceiverReportingUtilization(frame_feedback_id, utilization);
80 }
81
82 void MojoServiceLaunchedVideoCaptureDevice::OnGetPhotoCapabilitiesResponse(
83 media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback,
84 media::mojom::PhotoCapabilitiesPtr capabilities) const {
85 callback.Run(std::move(capabilities));
86 }
87
88 void MojoServiceLaunchedVideoCaptureDevice::OnSetPhotoOptionsResponse(
89 media::VideoCaptureDevice::SetPhotoOptionsCallback callback,
90 bool success) {
91 callback.Run(success);
92 }
93
94 void MojoServiceLaunchedVideoCaptureDevice::OnTakePhotoResponse(
95 media::VideoCaptureDevice::TakePhotoCallback callback,
96 media::mojom::BlobPtr blob) {
97 callback.Run(std::move(blob));
98 }
99
100 void MojoServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice() {
101 NOTIMPLEMENTED();
102 }
103
104 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698