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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/browser/browser_main_loop.h" | 9 #include "content/browser/browser_main_loop.h" |
10 #include "content/browser/renderer_host/media/media_stream_manager.h" | 10 #include "content/browser/renderer_host/media/media_stream_manager.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 DeleteVideoCaptureControllerOnIOThread(controller_id); | 288 DeleteVideoCaptureControllerOnIOThread(controller_id); |
289 } | 289 } |
290 | 290 |
291 void VideoCaptureHost::OnPauseCapture(int device_id) { | 291 void VideoCaptureHost::OnPauseCapture(int device_id) { |
292 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 292 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
293 DVLOG(1) << "VideoCaptureHost::OnPauseCapture, device_id " << device_id; | 293 DVLOG(1) << "VideoCaptureHost::OnPauseCapture, device_id " << device_id; |
294 // Not used. | 294 // Not used. |
295 Send(new VideoCaptureMsg_StateChanged(device_id, VIDEO_CAPTURE_STATE_ERROR)); | 295 Send(new VideoCaptureMsg_StateChanged(device_id, VIDEO_CAPTURE_STATE_ERROR)); |
296 } | 296 } |
297 | 297 |
298 void VideoCaptureHost::OnReceiveEmptyBuffer(int device_id, | 298 void VideoCaptureHost::OnReceiveEmptyBuffer( |
299 int buffer_id, | 299 int device_id, |
300 uint32 sync_point) { | 300 int buffer_id, |
| 301 const std::vector<uint32>& sync_points) { |
301 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
302 | 303 |
303 VideoCaptureControllerID controller_id(device_id); | 304 VideoCaptureControllerID controller_id(device_id); |
304 EntryMap::iterator it = entries_.find(controller_id); | 305 EntryMap::iterator it = entries_.find(controller_id); |
305 if (it != entries_.end()) { | 306 if (it != entries_.end()) { |
306 const base::WeakPtr<VideoCaptureController>& controller = it->second; | 307 const base::WeakPtr<VideoCaptureController>& controller = it->second; |
307 if (controller) | 308 if (controller) |
308 controller->ReturnBuffer(controller_id, this, buffer_id, sync_point); | 309 controller->ReturnBuffer(controller_id, this, buffer_id, sync_points); |
309 } | 310 } |
310 } | 311 } |
311 | 312 |
312 void VideoCaptureHost::OnGetDeviceSupportedFormats( | 313 void VideoCaptureHost::OnGetDeviceSupportedFormats( |
313 int device_id, | 314 int device_id, |
314 media::VideoCaptureSessionId capture_session_id) { | 315 media::VideoCaptureSessionId capture_session_id) { |
315 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
316 DVLOG(1) << "VideoCaptureHost::OnGetDeviceFormats, capture_session_id " | 317 DVLOG(1) << "VideoCaptureHost::OnGetDeviceFormats, capture_session_id " |
317 << capture_session_id; | 318 << capture_session_id; |
318 media::VideoCaptureFormats device_supported_formats; | 319 media::VideoCaptureFormats device_supported_formats; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 return; | 353 return; |
353 | 354 |
354 if (it->second) { | 355 if (it->second) { |
355 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 356 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
356 it->second.get(), controller_id, this); | 357 it->second.get(), controller_id, this); |
357 } | 358 } |
358 entries_.erase(it); | 359 entries_.erase(it); |
359 } | 360 } |
360 | 361 |
361 } // namespace content | 362 } // namespace content |
OLD | NEW |