| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 return; | 226 return; |
| 227 | 227 |
| 228 if (VideoCaptureController* controller = it->second.get()) { | 228 if (VideoCaptureController* controller = it->second.get()) { |
| 229 media_stream_manager_->video_capture_manager() | 229 media_stream_manager_->video_capture_manager() |
| 230 ->RequestRefreshFrameForClient(controller); | 230 ->RequestRefreshFrameForClient(controller); |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 | 233 |
| 234 void VideoCaptureHost::ReleaseBuffer(int32_t device_id, | 234 void VideoCaptureHost::ReleaseBuffer(int32_t device_id, |
| 235 int32_t buffer_id, | 235 int32_t buffer_id, |
| 236 const gpu::SyncToken& sync_token, | |
| 237 double consumer_resource_utilization) { | 236 double consumer_resource_utilization) { |
| 238 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 237 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 239 | 238 |
| 240 VideoCaptureControllerID controller_id(device_id); | 239 VideoCaptureControllerID controller_id(device_id); |
| 241 auto it = controllers_.find(controller_id); | 240 auto it = controllers_.find(controller_id); |
| 242 if (it == controllers_.end()) | 241 if (it == controllers_.end()) |
| 243 return; | 242 return; |
| 244 | 243 |
| 245 const base::WeakPtr<VideoCaptureController>& controller = it->second; | 244 const base::WeakPtr<VideoCaptureController>& controller = it->second; |
| 246 if (controller) { | 245 if (controller) { |
| 247 controller->ReturnBuffer(controller_id, this, buffer_id, sync_token, | 246 controller->ReturnBuffer(controller_id, this, buffer_id, |
| 248 consumer_resource_utilization); | 247 consumer_resource_utilization); |
| 249 } | 248 } |
| 250 } | 249 } |
| 251 | 250 |
| 252 void VideoCaptureHost::GetDeviceSupportedFormats( | 251 void VideoCaptureHost::GetDeviceSupportedFormats( |
| 253 int32_t device_id, | 252 int32_t device_id, |
| 254 int32_t session_id, | 253 int32_t session_id, |
| 255 const GetDeviceSupportedFormatsCallback& callback) { | 254 const GetDeviceSupportedFormatsCallback& callback) { |
| 256 DVLOG(1) << __func__ << " " << device_id; | 255 DVLOG(1) << __func__ << " " << device_id; |
| 257 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 256 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 const base::WeakPtr<VideoCaptureController> controller = it->second; | 319 const base::WeakPtr<VideoCaptureController> controller = it->second; |
| 321 controllers_.erase(it); | 320 controllers_.erase(it); |
| 322 if (!controller) | 321 if (!controller) |
| 323 return; | 322 return; |
| 324 | 323 |
| 325 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 324 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
| 326 controller.get(), controller_id, this, on_error); | 325 controller.get(), controller_id, this, on_error); |
| 327 } | 326 } |
| 328 | 327 |
| 329 } // namespace content | 328 } // namespace content |
| OLD | NEW |