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/renderer/media/video_capture_impl_manager.h" | 5 #include "content/renderer/media/video_capture_impl_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/renderer/media/video_capture_impl.h" | 9 #include "content/renderer/media/video_capture_impl.h" |
10 #include "content/renderer/media/video_capture_message_filter.h" | 10 #include "content/renderer/media/video_capture_message_filter.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 new VideoCaptureImpl(id, message_loop_proxy_, filter_); | 30 new VideoCaptureImpl(id, message_loop_proxy_, filter_); |
31 devices_[id] = new Device(vc, handler); | 31 devices_[id] = new Device(vc, handler); |
32 vc->Init(); | 32 vc->Init(); |
33 return vc; | 33 return vc; |
34 } | 34 } |
35 | 35 |
36 devices_[id]->clients.push_front(handler); | 36 devices_[id]->clients.push_front(handler); |
37 return it->second->vc; | 37 return it->second->vc; |
38 } | 38 } |
39 | 39 |
| 40 void VideoCaptureImplManager::SuspendDevices(bool suspend) { |
| 41 base::AutoLock auto_lock(lock_); |
| 42 for (Devices::iterator it = devices_.begin(); it != devices_.end(); ++it) |
| 43 it->second->vc->SuspendCapture(suspend); |
| 44 } |
| 45 |
40 void VideoCaptureImplManager::RemoveDevice( | 46 void VideoCaptureImplManager::RemoveDevice( |
41 media::VideoCaptureSessionId id, | 47 media::VideoCaptureSessionId id, |
42 media::VideoCapture::EventHandler* handler) { | 48 media::VideoCapture::EventHandler* handler) { |
43 DCHECK(handler); | 49 DCHECK(handler); |
44 | 50 |
45 base::AutoLock auto_lock(lock_); | 51 base::AutoLock auto_lock(lock_); |
46 Devices::iterator it = devices_.find(id); | 52 Devices::iterator it = devices_.find(id); |
47 if (it == devices_.end()) | 53 if (it == devices_.end()) |
48 return; | 54 return; |
49 | 55 |
(...skipping 23 matching lines...) Expand all Loading... |
73 VideoCaptureImplManager::Device::Device( | 79 VideoCaptureImplManager::Device::Device( |
74 VideoCaptureImpl* device, | 80 VideoCaptureImpl* device, |
75 media::VideoCapture::EventHandler* handler) | 81 media::VideoCapture::EventHandler* handler) |
76 : vc(device) { | 82 : vc(device) { |
77 clients.push_front(handler); | 83 clients.push_front(handler); |
78 } | 84 } |
79 | 85 |
80 VideoCaptureImplManager::Device::~Device() {} | 86 VideoCaptureImplManager::Device::~Device() {} |
81 | 87 |
82 } // namespace content | 88 } // namespace content |
OLD | NEW |