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

Unified Diff: content/browser/renderer_host/media/video_capture_host.cc

Issue 2365223002: Video Capture: Allow suspension of individual devices. (Closed)
Patch Set: Style tweaks, per mcasas's comments. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/video_capture_host.cc
diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc
index 20e34a2d6785773fb6af5650548d3e13af479a37..1b2757f0bdc651a7133590459af1ac643e97af4e 100644
--- a/content/browser/renderer_host/media/video_capture_host.cc
+++ b/content/browser/renderer_host/media/video_capture_host.cc
@@ -237,13 +237,12 @@ void VideoCaptureHost::OnPauseCapture(int device_id) {
VideoCaptureControllerID controller_id(device_id);
EntryMap::iterator it = entries_.find(controller_id);
- if (it == entries_.end())
+ if (it == entries_.end() || !it->second)
return;
- if (it->second) {
- media_stream_manager_->video_capture_manager()->PauseCaptureForClient(
- it->second.get(), controller_id, this);
- }
+ media_stream_manager_->video_capture_manager()->PauseCaptureForClient(
+ it->second.get(), controller_id, this);
+ Send(new VideoCaptureMsg_StateChanged(device_id, VIDEO_CAPTURE_STATE_PAUSED));
}
void VideoCaptureHost::OnResumeCapture(
@@ -255,13 +254,13 @@ void VideoCaptureHost::OnResumeCapture(
VideoCaptureControllerID controller_id(device_id);
EntryMap::iterator it = entries_.find(controller_id);
- if (it == entries_.end())
+ if (it == entries_.end() || !it->second)
return;
- if (it->second) {
- media_stream_manager_->video_capture_manager()->ResumeCaptureForClient(
- session_id, params, it->second.get(), controller_id, this);
- }
+ media_stream_manager_->video_capture_manager()->ResumeCaptureForClient(
+ session_id, params, it->second.get(), controller_id, this);
+ Send(new VideoCaptureMsg_StateChanged(device_id,
+ VIDEO_CAPTURE_STATE_RESUMED));
}
void VideoCaptureHost::OnRequestRefreshFrame(int device_id) {
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698