| 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 media::VideoCaptureSessionId id, |
| 113 bool is_secure) { |
| 114 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); |
| 115 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); |
| 116 DCHECK(it != devices_.end()); |
| 117 VideoCaptureImpl* const impl = it->second.second; |
| 118 ChildProcess::current()->io_task_runner()->PostTask( |
| 119 FROM_HERE, base::Bind(&VideoCaptureImpl::SetCapturingLinkSecured, |
| 120 base::Unretained(impl), is_secure)); |
| 121 } |
| 111 | 122 |
| 112 void VideoCaptureImplManager::GetDeviceSupportedFormats( | 123 void VideoCaptureImplManager::GetDeviceSupportedFormats( |
| 113 media::VideoCaptureSessionId id, | 124 media::VideoCaptureSessionId id, |
| 114 const VideoCaptureDeviceFormatsCB& callback) { | 125 const VideoCaptureDeviceFormatsCB& callback) { |
| 115 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); | 126 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); |
| 116 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); | 127 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); |
| 117 DCHECK(it != devices_.end()); | 128 DCHECK(it != devices_.end()); |
| 118 VideoCaptureImpl* const impl = it->second.second; | 129 VideoCaptureImpl* const impl = it->second.second; |
| 119 ChildProcess::current()->io_task_runner()->PostTask( | 130 ChildProcess::current()->io_task_runner()->PostTask( |
| 120 FROM_HERE, base::Bind(&VideoCaptureImpl::GetDeviceSupportedFormats, | 131 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()); | 185 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); |
| 175 for (const auto& device : devices_) { | 186 for (const auto& device : devices_) { |
| 176 VideoCaptureImpl* const impl = device.second.second; | 187 VideoCaptureImpl* const impl = device.second.second; |
| 177 ChildProcess::current()->io_task_runner()->PostTask( | 188 ChildProcess::current()->io_task_runner()->PostTask( |
| 178 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, | 189 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, |
| 179 base::Unretained(impl), suspend)); | 190 base::Unretained(impl), suspend)); |
| 180 } | 191 } |
| 181 } | 192 } |
| 182 | 193 |
| 183 } // namespace content | 194 } // namespace content |
| OLD | NEW |