Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: content/browser/renderer_host/media/video_capture_host.cc

Issue 1873293002: Report if video capturing meets output protection requirement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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(
287 int session_id,
288 const std::string& stream_device_id,
289 bool is_secure) {
290 DCHECK_CURRENTLY_ON(BrowserThread::IO);
291
292 media_stream_manager_->SetCapturingLinkSecured(session_id, stream_device_id,
293 is_secure);
294 }
295
284 void VideoCaptureHost::OnRendererFinishedWithBuffer( 296 void VideoCaptureHost::OnRendererFinishedWithBuffer(
285 int device_id, 297 int device_id,
286 int buffer_id, 298 int buffer_id,
287 const gpu::SyncToken& sync_token, 299 const gpu::SyncToken& sync_token,
288 double consumer_resource_utilization) { 300 double consumer_resource_utilization) {
289 DCHECK_CURRENTLY_ON(BrowserThread::IO); 301 DCHECK_CURRENTLY_ON(BrowserThread::IO);
290 302
291 VideoCaptureControllerID controller_id(device_id); 303 VideoCaptureControllerID controller_id(device_id);
292 EntryMap::iterator it = entries_.find(controller_id); 304 EntryMap::iterator it = entries_.find(controller_id);
293 if (it != entries_.end()) { 305 if (it != entries_.end()) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 return; 354 return;
343 355
344 if (it->second) { 356 if (it->second) {
345 media_stream_manager_->video_capture_manager()->StopCaptureForClient( 357 media_stream_manager_->video_capture_manager()->StopCaptureForClient(
346 it->second.get(), controller_id, this, on_error); 358 it->second.get(), controller_id, this, on_error);
347 } 359 }
348 entries_.erase(it); 360 entries_.erase(it);
349 } 361 }
350 362
351 } // namespace content 363 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698