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/service_launched_video_capture_device.cc

Issue 2857303002: [Mojo Video Capture] Implement a VideoCaptureProvider using the Mojo service (part 2) (Closed)
Patch Set: Added back update to |state_| which was accidentally dropped in PatchSet 3 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 DCHECK(sequence_checker_.CalledOnValidSequence());
20 }
14 21
15 void ServiceLaunchedVideoCaptureDevice::GetPhotoCapabilities( 22 void ServiceLaunchedVideoCaptureDevice::GetPhotoCapabilities(
16 media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) const { 23 media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) const {
24 DCHECK(sequence_checker_.CalledOnValidSequence());
17 NOTIMPLEMENTED(); 25 NOTIMPLEMENTED();
18 } 26 }
19 27
20 void ServiceLaunchedVideoCaptureDevice::SetPhotoOptions( 28 void ServiceLaunchedVideoCaptureDevice::SetPhotoOptions(
21 media::mojom::PhotoSettingsPtr settings, 29 media::mojom::PhotoSettingsPtr settings,
22 media::VideoCaptureDevice::SetPhotoOptionsCallback callback) { 30 media::VideoCaptureDevice::SetPhotoOptionsCallback callback) {
31 DCHECK(sequence_checker_.CalledOnValidSequence());
23 NOTIMPLEMENTED(); 32 NOTIMPLEMENTED();
24 } 33 }
25 34
26 void ServiceLaunchedVideoCaptureDevice::TakePhoto( 35 void ServiceLaunchedVideoCaptureDevice::TakePhoto(
27 media::VideoCaptureDevice::TakePhotoCallback callback) { 36 media::VideoCaptureDevice::TakePhotoCallback callback) {
37 DCHECK(sequence_checker_.CalledOnValidSequence());
28 NOTIMPLEMENTED(); 38 NOTIMPLEMENTED();
29 } 39 }
30 40
31 void ServiceLaunchedVideoCaptureDevice::MaybeSuspendDevice() { 41 void ServiceLaunchedVideoCaptureDevice::MaybeSuspendDevice() {
32 NOTIMPLEMENTED(); 42 DCHECK(sequence_checker_.CalledOnValidSequence());
43 // Not yet implemented on service side. Do nothing here.
33 } 44 }
34 45
35 void ServiceLaunchedVideoCaptureDevice::ResumeDevice() { 46 void ServiceLaunchedVideoCaptureDevice::ResumeDevice() {
36 NOTIMPLEMENTED(); 47 DCHECK(sequence_checker_.CalledOnValidSequence());
48 // Not yet implemented on service side. Do nothing here.
37 } 49 }
38 50
39 void ServiceLaunchedVideoCaptureDevice::RequestRefreshFrame() { 51 void ServiceLaunchedVideoCaptureDevice::RequestRefreshFrame() {
40 NOTIMPLEMENTED(); 52 DCHECK(sequence_checker_.CalledOnValidSequence());
53 // Not yet implemented on service side. Do nothing here.
41 } 54 }
42 55
43 void ServiceLaunchedVideoCaptureDevice::SetDesktopCaptureWindowIdAsync( 56 void ServiceLaunchedVideoCaptureDevice::SetDesktopCaptureWindowIdAsync(
44 gfx::NativeViewId window_id, 57 gfx::NativeViewId window_id,
45 base::OnceClosure done_cb) { 58 base::OnceClosure done_cb) {
46 NOTIMPLEMENTED(); 59 // This method should only be called for desktop capture devices.
60 // The video_capture Mojo service does not support desktop capture devices
61 // (yet) and should not be used for it.
62 NOTREACHED();
47 } 63 }
48 64
49 void ServiceLaunchedVideoCaptureDevice::OnUtilizationReport( 65 void ServiceLaunchedVideoCaptureDevice::OnUtilizationReport(
50 int frame_feedback_id, 66 int frame_feedback_id,
51 double utilization) { 67 double utilization) {
68 DCHECK(sequence_checker_.CalledOnValidSequence());
69 device_->OnReceiverReportingUtilization(frame_feedback_id, utilization);
70 }
71
72 void ServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice() {
73 DCHECK(sequence_checker_.CalledOnValidSequence());
52 NOTIMPLEMENTED(); 74 NOTIMPLEMENTED();
53 } 75 }
54 76
55 } // namespace content 77 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698