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

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

Issue 10391065: handle the case when device is closed before media pipeline is fully initialized. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/video_capture_host.cc
===================================================================
--- content/browser/renderer_host/media/video_capture_host.cc (revision 137680)
+++ content/browser/renderer_host/media/video_capture_host.cc (working copy)
@@ -104,6 +104,12 @@
this, id.device_id, width, height, frame_per_second));
}
+void VideoCaptureHost::OnPaused(const VideoCaptureControllerID& id) {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&VideoCaptureHost::DoPaused, this, id.device_id));
+}
+
void VideoCaptureHost::OnReadyToDelete(const VideoCaptureControllerID& id) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -143,6 +149,19 @@
controller->StopCapture(id, this, false);
}
+void VideoCaptureHost::DoPaused(int device_id) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ VideoCaptureControllerID id(device_id);
+ EntryMap::iterator it = entries_.find(id);
+ if (it == entries_.end() || it->second->state == video_capture::kPaused)
+ return;
+
+ it->second->state = video_capture::kPaused;
+ Send(new VideoCaptureMsg_StateChanged(device_id,
+ video_capture::kPaused));
+}
+
void VideoCaptureHost::DoSendFrameInfo(int device_id,
int width,
int height,

Powered by Google App Engine
This is Rietveld 408576698