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