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