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 // Implementation notes about interactions with VideoCaptureImpl. | 5 // Implementation notes about interactions with VideoCaptureImpl. |
6 // | 6 // |
7 // How is VideoCaptureImpl used: | 7 // How is VideoCaptureImpl used: |
8 // | 8 // |
9 // VideoCaptureImpl is an IO thread object while VideoCaptureImplManager | 9 // VideoCaptureImpl is an IO thread object while VideoCaptureImplManager |
10 // lives only on the render thread. It is only possible to access an | 10 // lives only on the render thread. It is only possible to access an |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); | 101 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); |
102 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); | 102 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); |
103 DCHECK(it != devices_.end()); | 103 DCHECK(it != devices_.end()); |
104 VideoCaptureImpl* const impl = it->second.second; | 104 VideoCaptureImpl* const impl = it->second.second; |
105 ChildProcess::current()->io_task_runner()->PostTask( | 105 ChildProcess::current()->io_task_runner()->PostTask( |
106 FROM_HERE, | 106 FROM_HERE, |
107 base::Bind(&VideoCaptureImpl::RequestRefreshFrame, | 107 base::Bind(&VideoCaptureImpl::RequestRefreshFrame, |
108 base::Unretained(impl))); | 108 base::Unretained(impl))); |
109 } | 109 } |
110 | 110 |
| 111 void VideoCaptureImplManager::SetCapturingLinkSecured( |
| 112 content::MediaStreamType type, |
| 113 media::VideoCaptureSessionId id, |
| 114 bool is_secure) { |
| 115 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); |
| 116 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); |
| 117 DCHECK(it != devices_.end()); |
| 118 VideoCaptureImpl* const impl = it->second.second; |
| 119 ChildProcess::current()->io_task_runner()->PostTask( |
| 120 FROM_HERE, base::Bind(&VideoCaptureImpl::SetCapturingLinkSecured, |
| 121 base::Unretained(impl), type, is_secure)); |
| 122 } |
111 | 123 |
112 void VideoCaptureImplManager::GetDeviceSupportedFormats( | 124 void VideoCaptureImplManager::GetDeviceSupportedFormats( |
113 media::VideoCaptureSessionId id, | 125 media::VideoCaptureSessionId id, |
114 const VideoCaptureDeviceFormatsCB& callback) { | 126 const VideoCaptureDeviceFormatsCB& callback) { |
115 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); | 127 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); |
116 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); | 128 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); |
117 DCHECK(it != devices_.end()); | 129 DCHECK(it != devices_.end()); |
118 VideoCaptureImpl* const impl = it->second.second; | 130 VideoCaptureImpl* const impl = it->second.second; |
119 ChildProcess::current()->io_task_runner()->PostTask( | 131 ChildProcess::current()->io_task_runner()->PostTask( |
120 FROM_HERE, base::Bind(&VideoCaptureImpl::GetDeviceSupportedFormats, | 132 FROM_HERE, base::Bind(&VideoCaptureImpl::GetDeviceSupportedFormats, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); | 186 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); |
175 for (const auto& device : devices_) { | 187 for (const auto& device : devices_) { |
176 VideoCaptureImpl* const impl = device.second.second; | 188 VideoCaptureImpl* const impl = device.second.second; |
177 ChildProcess::current()->io_task_runner()->PostTask( | 189 ChildProcess::current()->io_task_runner()->PostTask( |
178 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, | 190 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, |
179 base::Unretained(impl), suspend)); | 191 base::Unretained(impl), suspend)); |
180 } | 192 } |
181 } | 193 } |
182 | 194 |
183 } // namespace content | 195 } // namespace content |
OLD | NEW |