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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // IPC Messages handler. | 144 // IPC Messages handler. |
145 bool VideoCaptureHost::OnMessageReceived(const IPC::Message& message) { | 145 bool VideoCaptureHost::OnMessageReceived(const IPC::Message& message) { |
146 bool handled = true; | 146 bool handled = true; |
147 IPC_BEGIN_MESSAGE_MAP(VideoCaptureHost, message) | 147 IPC_BEGIN_MESSAGE_MAP(VideoCaptureHost, message) |
148 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Start, OnStartCapture) | 148 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Start, OnStartCapture) |
149 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Pause, OnPauseCapture) | 149 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Pause, OnPauseCapture) |
150 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Resume, OnResumeCapture) | 150 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Resume, OnResumeCapture) |
151 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_RequestRefreshFrame, | 151 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_RequestRefreshFrame, |
152 OnRequestRefreshFrame) | 152 OnRequestRefreshFrame) |
153 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Stop, OnStopCapture) | 153 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Stop, OnStopCapture) |
| 154 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_SetCapturingLinkSecured, |
| 155 OnSetCapturingLinkSecured) |
154 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_BufferReady, | 156 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_BufferReady, |
155 OnRendererFinishedWithBuffer) | 157 OnRendererFinishedWithBuffer) |
156 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_GetDeviceSupportedFormats, | 158 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_GetDeviceSupportedFormats, |
157 OnGetDeviceSupportedFormats) | 159 OnGetDeviceSupportedFormats) |
158 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_GetDeviceFormatsInUse, | 160 IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_GetDeviceFormatsInUse, |
159 OnGetDeviceFormatsInUse) | 161 OnGetDeviceFormatsInUse) |
160 IPC_MESSAGE_UNHANDLED(handled = false) | 162 IPC_MESSAGE_UNHANDLED(handled = false) |
161 IPC_END_MESSAGE_MAP() | 163 IPC_END_MESSAGE_MAP() |
162 | 164 |
163 return handled; | 165 return handled; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 EntryMap::iterator it = entries_.find(controller_id); | 276 EntryMap::iterator it = entries_.find(controller_id); |
275 if (it == entries_.end()) | 277 if (it == entries_.end()) |
276 return; | 278 return; |
277 | 279 |
278 if (VideoCaptureController* controller = it->second.get()) { | 280 if (VideoCaptureController* controller = it->second.get()) { |
279 media_stream_manager_->video_capture_manager() | 281 media_stream_manager_->video_capture_manager() |
280 ->RequestRefreshFrameForClient(controller); | 282 ->RequestRefreshFrameForClient(controller); |
281 } | 283 } |
282 } | 284 } |
283 | 285 |
| 286 void VideoCaptureHost::OnSetCapturingLinkSecured(content::MediaStreamType type, |
| 287 int session_id, |
| 288 bool is_secure) { |
| 289 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 290 |
| 291 media_stream_manager_->SetCapturingLinkSecured(type, session_id, is_secure); |
| 292 } |
| 293 |
284 void VideoCaptureHost::OnRendererFinishedWithBuffer( | 294 void VideoCaptureHost::OnRendererFinishedWithBuffer( |
285 int device_id, | 295 int device_id, |
286 int buffer_id, | 296 int buffer_id, |
287 const gpu::SyncToken& sync_token, | 297 const gpu::SyncToken& sync_token, |
288 double consumer_resource_utilization) { | 298 double consumer_resource_utilization) { |
289 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 299 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
290 | 300 |
291 VideoCaptureControllerID controller_id(device_id); | 301 VideoCaptureControllerID controller_id(device_id); |
292 EntryMap::iterator it = entries_.find(controller_id); | 302 EntryMap::iterator it = entries_.find(controller_id); |
293 if (it != entries_.end()) { | 303 if (it != entries_.end()) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 return; | 352 return; |
343 | 353 |
344 if (it->second) { | 354 if (it->second) { |
345 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 355 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
346 it->second.get(), controller_id, this, on_error); | 356 it->second.get(), controller_id, this, on_error); |
347 } | 357 } |
348 entries_.erase(it); | 358 entries_.erase(it); |
349 } | 359 } |
350 | 360 |
351 } // namespace content | 361 } // namespace content |
OLD | NEW |