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

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

Issue 2902203002: [Mojo Video Capture] Hook up connection lost events (Closed)
Patch Set: Fix duplicate member introduced during merging Created 3 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_manager.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
index bc60336c614059c93dc7b3da8d94af9b892f91e9..cc170527fd677c35732c3753e781aa784a8cbcf7 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -355,6 +355,15 @@ void VideoCaptureManager::OnDeviceLaunchAborted() {
ProcessDeviceStartRequestQueue();
}
+void VideoCaptureManager::OnDeviceConnectionLost(
+ VideoCaptureController* controller) {
+ const std::string log_message = base::StringPrintf(
+ "Lost connection to device %d.", controller->serial_id());
+ DLOG(WARNING) << log_message;
+ controller->OnLog(log_message);
+ controller->OnError();
+}
+
void VideoCaptureManager::ConnectClient(
media::VideoCaptureSessionId session_id,
const media::VideoCaptureParams& params,
@@ -430,6 +439,10 @@ void VideoCaptureManager::DisconnectClient(
// If controller has no more clients, delete controller and device.
DestroyControllerIfNoClients(controller);
+
+ if (controllers_.empty()) {
+ video_capture_provider_->Uninitialize();
+ }
}
void VideoCaptureManager::PauseCaptureForClient(

Powered by Google App Engine
This is Rietveld 408576698