| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/browser_main_loop.h" | 10 #include "content/browser/browser_main_loop.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 if (it->second) { | 265 if (it->second) { |
| 266 media_stream_manager_->video_capture_manager()->ResumeCaptureForClient( | 266 media_stream_manager_->video_capture_manager()->ResumeCaptureForClient( |
| 267 session_id, params, it->second.get(), controller_id, this); | 267 session_id, params, it->second.get(), controller_id, this); |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 | 270 |
| 271 void VideoCaptureHost::OnRendererFinishedWithBuffer( | 271 void VideoCaptureHost::OnRendererFinishedWithBuffer( |
| 272 int device_id, | 272 int device_id, |
| 273 int buffer_id, | 273 int buffer_id, |
| 274 uint32 sync_point, | 274 const gpu::SyncToken& sync_token, |
| 275 double consumer_resource_utilization) { | 275 double consumer_resource_utilization) { |
| 276 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 276 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 277 | 277 |
| 278 VideoCaptureControllerID controller_id(device_id); | 278 VideoCaptureControllerID controller_id(device_id); |
| 279 EntryMap::iterator it = entries_.find(controller_id); | 279 EntryMap::iterator it = entries_.find(controller_id); |
| 280 if (it != entries_.end()) { | 280 if (it != entries_.end()) { |
| 281 const base::WeakPtr<VideoCaptureController>& controller = it->second; | 281 const base::WeakPtr<VideoCaptureController>& controller = it->second; |
| 282 if (controller) { | 282 if (controller) { |
| 283 controller->ReturnBuffer(controller_id, | 283 controller->ReturnBuffer(controller_id, this, buffer_id, sync_token, |
| 284 this, | |
| 285 buffer_id, | |
| 286 sync_point, | |
| 287 consumer_resource_utilization); | 284 consumer_resource_utilization); |
| 288 } | 285 } |
| 289 } | 286 } |
| 290 } | 287 } |
| 291 | 288 |
| 292 void VideoCaptureHost::OnGetDeviceSupportedFormats( | 289 void VideoCaptureHost::OnGetDeviceSupportedFormats( |
| 293 int device_id, | 290 int device_id, |
| 294 media::VideoCaptureSessionId capture_session_id) { | 291 media::VideoCaptureSessionId capture_session_id) { |
| 295 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 292 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 296 DVLOG(1) << "VideoCaptureHost::OnGetDeviceFormats, capture_session_id " | 293 DVLOG(1) << "VideoCaptureHost::OnGetDeviceFormats, capture_session_id " |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 return; | 329 return; |
| 333 | 330 |
| 334 if (it->second) { | 331 if (it->second) { |
| 335 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 332 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
| 336 it->second.get(), controller_id, this, on_error); | 333 it->second.get(), controller_id, this, on_error); |
| 337 } | 334 } |
| 338 entries_.erase(it); | 335 entries_.erase(it); |
| 339 } | 336 } |
| 340 | 337 |
| 341 } // namespace content | 338 } // namespace content |
| OLD | NEW |