| OLD | NEW |
| 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(thread_checker_.CalledOnValidThread()); |
| 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(thread_checker_.CalledOnValidThread()); |
| 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(thread_checker_.CalledOnValidThread()); |
| 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(thread_checker_.CalledOnValidThread()); |
| 28 NOTIMPLEMENTED(); | 38 NOTIMPLEMENTED(); |
| 29 } | 39 } |
| 30 | 40 |
| 31 void ServiceLaunchedVideoCaptureDevice::MaybeSuspendDevice() { | 41 void ServiceLaunchedVideoCaptureDevice::MaybeSuspendDevice() { |
| 32 NOTIMPLEMENTED(); | 42 DCHECK(thread_checker_.CalledOnValidThread()); |
| 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(thread_checker_.CalledOnValidThread()); |
| 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(thread_checker_.CalledOnValidThread()); |
| 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 DCHECK(thread_checker_.CalledOnValidThread()); |
| 60 // This method should only be called for desktop capture devices. |
| 61 // The video_capture Mojo service does not support desktop capture devices |
| 62 // (yet) and should not be used for it. |
| 63 NOTREACHED(); |
| 47 } | 64 } |
| 48 | 65 |
| 49 void ServiceLaunchedVideoCaptureDevice::OnUtilizationReport( | 66 void ServiceLaunchedVideoCaptureDevice::OnUtilizationReport( |
| 50 int frame_feedback_id, | 67 int frame_feedback_id, |
| 51 double utilization) { | 68 double utilization) { |
| 69 DCHECK(thread_checker_.CalledOnValidThread()); |
| 70 device_->OnReceiverReportingUtilization(frame_feedback_id, utilization); |
| 71 } |
| 72 |
| 73 void ServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice() { |
| 52 NOTIMPLEMENTED(); | 74 NOTIMPLEMENTED(); |
| 53 } | 75 } |
| 54 | 76 |
| 55 } // namespace content | 77 } // namespace content |
| OLD | NEW |