Chromium Code Reviews| 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) { | |
|
qinmin
2013/04/16 04:06:17
no need for {}
wjia(left Chromium)
2013/04/16 16:44:05
Done.
| |
| 43 it->second->vc->SuspendCapture(suspend); | |
| 44 } | |
| 45 } | |
| 46 | |
| 40 void VideoCaptureImplManager::RemoveDevice( | 47 void VideoCaptureImplManager::RemoveDevice( |
| 41 media::VideoCaptureSessionId id, | 48 media::VideoCaptureSessionId id, |
| 42 media::VideoCapture::EventHandler* handler) { | 49 media::VideoCapture::EventHandler* handler) { |
| 43 DCHECK(handler); | 50 DCHECK(handler); |
| 44 | 51 |
| 45 base::AutoLock auto_lock(lock_); | 52 base::AutoLock auto_lock(lock_); |
| 46 Devices::iterator it = devices_.find(id); | 53 Devices::iterator it = devices_.find(id); |
| 47 if (it == devices_.end()) | 54 if (it == devices_.end()) |
| 48 return; | 55 return; |
| 49 | 56 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 73 VideoCaptureImplManager::Device::Device( | 80 VideoCaptureImplManager::Device::Device( |
| 74 VideoCaptureImpl* device, | 81 VideoCaptureImpl* device, |
| 75 media::VideoCapture::EventHandler* handler) | 82 media::VideoCapture::EventHandler* handler) |
| 76 : vc(device) { | 83 : vc(device) { |
| 77 clients.push_front(handler); | 84 clients.push_front(handler); |
| 78 } | 85 } |
| 79 | 86 |
| 80 VideoCaptureImplManager::Device::~Device() {} | 87 VideoCaptureImplManager::Device::~Device() {} |
| 81 | 88 |
| 82 } // namespace content | 89 } // namespace content |
| OLD | NEW |