| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 uint32 sync_point, |
| 275 const gpu::SyncToken& sync_token, |
| 275 double consumer_resource_utilization) { | 276 double consumer_resource_utilization) { |
| 276 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 277 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 277 | 278 |
| 278 VideoCaptureControllerID controller_id(device_id); | 279 VideoCaptureControllerID controller_id(device_id); |
| 279 EntryMap::iterator it = entries_.find(controller_id); | 280 EntryMap::iterator it = entries_.find(controller_id); |
| 280 if (it != entries_.end()) { | 281 if (it != entries_.end()) { |
| 281 const base::WeakPtr<VideoCaptureController>& controller = it->second; | 282 const base::WeakPtr<VideoCaptureController>& controller = it->second; |
| 282 if (controller) { | 283 if (controller) { |
| 283 controller->ReturnBuffer(controller_id, | 284 controller->ReturnBuffer(controller_id, this, buffer_id, sync_point, |
| 284 this, | 285 sync_token, consumer_resource_utilization); |
| 285 buffer_id, | |
| 286 sync_point, | |
| 287 consumer_resource_utilization); | |
| 288 } | 286 } |
| 289 } | 287 } |
| 290 } | 288 } |
| 291 | 289 |
| 292 void VideoCaptureHost::OnGetDeviceSupportedFormats( | 290 void VideoCaptureHost::OnGetDeviceSupportedFormats( |
| 293 int device_id, | 291 int device_id, |
| 294 media::VideoCaptureSessionId capture_session_id) { | 292 media::VideoCaptureSessionId capture_session_id) { |
| 295 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 293 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 296 DVLOG(1) << "VideoCaptureHost::OnGetDeviceFormats, capture_session_id " | 294 DVLOG(1) << "VideoCaptureHost::OnGetDeviceFormats, capture_session_id " |
| 297 << capture_session_id; | 295 << capture_session_id; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 return; | 330 return; |
| 333 | 331 |
| 334 if (it->second) { | 332 if (it->second) { |
| 335 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 333 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
| 336 it->second.get(), controller_id, this, on_error); | 334 it->second.get(), controller_id, this, on_error); |
| 337 } | 335 } |
| 338 entries_.erase(it); | 336 entries_.erase(it); |
| 339 } | 337 } |
| 340 | 338 |
| 341 } // namespace content | 339 } // namespace content |
| OLD | NEW |