| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/video_capture_host.h" | 5 #include "content/browser/renderer_host/media/video_capture_host.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return; | 204 return; |
| 205 | 205 |
| 206 if (VideoCaptureController* controller = it->second.get()) { | 206 if (VideoCaptureController* controller = it->second.get()) { |
| 207 media_stream_manager_->video_capture_manager() | 207 media_stream_manager_->video_capture_manager() |
| 208 ->RequestRefreshFrameForClient(controller); | 208 ->RequestRefreshFrameForClient(controller); |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 | 211 |
| 212 void VideoCaptureHost::ReleaseBuffer(int32_t device_id, | 212 void VideoCaptureHost::ReleaseBuffer(int32_t device_id, |
| 213 int32_t buffer_id, | 213 int32_t buffer_id, |
| 214 const gpu::SyncToken& sync_token, | |
| 215 double consumer_resource_utilization) { | 214 double consumer_resource_utilization) { |
| 216 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 215 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 217 | 216 |
| 218 VideoCaptureControllerID controller_id(device_id); | 217 VideoCaptureControllerID controller_id(device_id); |
| 219 auto it = controllers_.find(controller_id); | 218 auto it = controllers_.find(controller_id); |
| 220 if (it == controllers_.end()) | 219 if (it == controllers_.end()) |
| 221 return; | 220 return; |
| 222 | 221 |
| 223 const base::WeakPtr<VideoCaptureController>& controller = it->second; | 222 const base::WeakPtr<VideoCaptureController>& controller = it->second; |
| 224 if (controller) { | 223 if (controller) { |
| 225 controller->ReturnBuffer(controller_id, this, buffer_id, sync_token, | 224 controller->ReturnBuffer(controller_id, this, buffer_id, |
| 226 consumer_resource_utilization); | 225 consumer_resource_utilization); |
| 227 } | 226 } |
| 228 } | 227 } |
| 229 | 228 |
| 230 void VideoCaptureHost::GetDeviceSupportedFormats( | 229 void VideoCaptureHost::GetDeviceSupportedFormats( |
| 231 int32_t device_id, | 230 int32_t device_id, |
| 232 int32_t session_id, | 231 int32_t session_id, |
| 233 const GetDeviceSupportedFormatsCallback& callback) { | 232 const GetDeviceSupportedFormatsCallback& callback) { |
| 234 DVLOG(1) << __func__ << " " << device_id; | 233 DVLOG(1) << __func__ << " " << device_id; |
| 235 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 234 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 const base::WeakPtr<VideoCaptureController> controller = it->second; | 325 const base::WeakPtr<VideoCaptureController> controller = it->second; |
| 327 controllers_.erase(it); | 326 controllers_.erase(it); |
| 328 if (!controller) | 327 if (!controller) |
| 329 return; | 328 return; |
| 330 | 329 |
| 331 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 330 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
| 332 controller.get(), controller_id, this, on_error); | 331 controller.get(), controller_id, this, on_error); |
| 333 } | 332 } |
| 334 | 333 |
| 335 } // namespace content | 334 } // namespace content |
| OLD | NEW |