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

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

Issue 2857303002: [Mojo Video Capture] Implement a VideoCaptureProvider using the Mojo service (part 2) (Closed)
Patch Set: Incorporated suggestions from PatchSets 1 and 2 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/service_launched_video_capture_dev ice.h" 5 #include "content/browser/renderer_host/media/service_launched_video_capture_dev ice.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 ServiceLaunchedVideoCaptureDevice::ServiceLaunchedVideoCaptureDevice( 9 ServiceLaunchedVideoCaptureDevice::ServiceLaunchedVideoCaptureDevice(
10 video_capture::mojom::DevicePtr device) 10 video_capture::mojom::DevicePtr device)
11 : device_(std::move(device)) {} 11 : device_(std::move(device)) {
12 // Unretained |this| is safe, because |this| owns |device_|.
13 device_.set_connection_error_handler(
14 base::Bind(&ServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice,
15 base::Unretained(this)));
16 }
12 17
13 ServiceLaunchedVideoCaptureDevice::~ServiceLaunchedVideoCaptureDevice() {} 18 ServiceLaunchedVideoCaptureDevice::~ServiceLaunchedVideoCaptureDevice() =
19 default;
14 20
15 void ServiceLaunchedVideoCaptureDevice::GetPhotoCapabilities( 21 void ServiceLaunchedVideoCaptureDevice::GetPhotoCapabilities(
16 media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) const { 22 media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) const {
17 NOTIMPLEMENTED(); 23 NOTIMPLEMENTED();
18 } 24 }
19 25
20 void ServiceLaunchedVideoCaptureDevice::SetPhotoOptions( 26 void ServiceLaunchedVideoCaptureDevice::SetPhotoOptions(
21 media::mojom::PhotoSettingsPtr settings, 27 media::mojom::PhotoSettingsPtr settings,
22 media::VideoCaptureDevice::SetPhotoOptionsCallback callback) { 28 media::VideoCaptureDevice::SetPhotoOptionsCallback callback) {
23 NOTIMPLEMENTED(); 29 NOTIMPLEMENTED();
24 } 30 }
25 31
26 void ServiceLaunchedVideoCaptureDevice::TakePhoto( 32 void ServiceLaunchedVideoCaptureDevice::TakePhoto(
27 media::VideoCaptureDevice::TakePhotoCallback callback) { 33 media::VideoCaptureDevice::TakePhotoCallback callback) {
28 NOTIMPLEMENTED(); 34 NOTIMPLEMENTED();
29 } 35 }
30 36
31 void ServiceLaunchedVideoCaptureDevice::MaybeSuspendDevice() { 37 void ServiceLaunchedVideoCaptureDevice::MaybeSuspendDevice() {
32 NOTIMPLEMENTED(); 38 // Not yet implemented on service side. Do nothing here.
33 } 39 }
34 40
35 void ServiceLaunchedVideoCaptureDevice::ResumeDevice() { 41 void ServiceLaunchedVideoCaptureDevice::ResumeDevice() {
36 NOTIMPLEMENTED(); 42 // Not yet implemented on service side. Do nothing here.
37 } 43 }
38 44
39 void ServiceLaunchedVideoCaptureDevice::RequestRefreshFrame() { 45 void ServiceLaunchedVideoCaptureDevice::RequestRefreshFrame() {
40 NOTIMPLEMENTED(); 46 // Not yet implemented on service side. Do nothing here.
41 } 47 }
42 48
43 void ServiceLaunchedVideoCaptureDevice::SetDesktopCaptureWindowIdAsync( 49 void ServiceLaunchedVideoCaptureDevice::SetDesktopCaptureWindowIdAsync(
44 gfx::NativeViewId window_id, 50 gfx::NativeViewId window_id,
45 base::OnceClosure done_cb) { 51 base::OnceClosure done_cb) {
46 NOTIMPLEMENTED(); 52 // This method should only be called for desktop capture devices.
53 // The video_capture Mojo service does not support desktop capture devices
54 // (yet) and should not be used for it.
55 NOTREACHED();
47 } 56 }
48 57
49 void ServiceLaunchedVideoCaptureDevice::OnUtilizationReport( 58 void ServiceLaunchedVideoCaptureDevice::OnUtilizationReport(
50 int frame_feedback_id, 59 int frame_feedback_id,
51 double utilization) { 60 double utilization) {
61 device_->OnReceiverReportingUtilization(frame_feedback_id, utilization);
62 }
63
64 void ServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice() {
52 NOTIMPLEMENTED(); 65 NOTIMPLEMENTED();
53 } 66 }
54 67
55 } // namespace content 68 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698