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

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

Issue 2803483003: [Mojo Video Capture] Split interface BuildableVideoCaptureDevice (Closed)
Patch Set: Remove fallback mechanism. Created 3 years, 8 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 169daaa8eece1cf1e3a0c0163fe321555cbd2bc0..bc60336c614059c93dc7b3da8d94af9b892f91e9 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -26,7 +26,6 @@
#include "content/browser/media/capture/web_contents_video_capture_device.h"
#include "content/browser/media/media_internals.h"
#include "content/browser/renderer_host/media/video_capture_controller.h"
-#include "content/browser/renderer_host/media/video_capture_controller_event_handler.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/desktop_media_id.h"
#include "content/public/common/media_stream_request.h"
@@ -287,7 +286,7 @@ void VideoCaptureManager::ProcessDeviceStartRequestQueue() {
const media::VideoCaptureDeviceInfo* device_info =
GetDeviceInfoById(controller->device_id());
if (!device_info) {
- OnDeviceStartFailed(controller);
+ OnDeviceLaunchFailed(controller);
return;
}
for (auto& observer : capture_observers_)
@@ -302,15 +301,14 @@ void VideoCaptureManager::ProcessDeviceStartRequestQueue() {
// TODO(chfremer): Check if request->params() can actually be different from
// controller->parameters, and simplify if this is not the case.
controller->CreateAndStartDeviceAsync(
- request->params(),
- static_cast<BuildableVideoCaptureDevice::Callbacks*>(this),
+ request->params(), static_cast<VideoCaptureDeviceLaunchObserver*>(this),
base::Bind([](scoped_refptr<VideoCaptureManager>,
scoped_refptr<VideoCaptureController>) {},
scoped_refptr<VideoCaptureManager>(this),
GetControllerSharedRef(controller)));
}
-void VideoCaptureManager::OnDeviceStarted(VideoCaptureController* controller) {
+void VideoCaptureManager::OnDeviceLaunched(VideoCaptureController* controller) {
DVLOG(3) << __func__;
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(!device_start_request_queue_.empty());
@@ -339,7 +337,7 @@ void VideoCaptureManager::OnDeviceStarted(VideoCaptureController* controller) {
ProcessDeviceStartRequestQueue();
}
-void VideoCaptureManager::OnDeviceStartFailed(
+void VideoCaptureManager::OnDeviceLaunchFailed(
VideoCaptureController* controller) {
const std::string log_message = base::StringPrintf(
"Starting device %s has failed. Maybe recently disconnected?",
@@ -352,7 +350,7 @@ void VideoCaptureManager::OnDeviceStartFailed(
ProcessDeviceStartRequestQueue();
}
-void VideoCaptureManager::OnDeviceStartAborted() {
+void VideoCaptureManager::OnDeviceLaunchAborted() {
device_start_request_queue_.pop_front();
ProcessDeviceStartRequestQueue();
}
@@ -786,10 +784,9 @@ VideoCaptureController* VideoCaptureManager::GetOrCreateController(
return existing_device;
}
- VideoCaptureController* new_controller =
- new VideoCaptureController(device_info.id, device_info.type, params,
- video_capture_provider_->CreateBuildableDevice(
- device_info.id, device_info.type));
+ VideoCaptureController* new_controller = new VideoCaptureController(
+ device_info.id, device_info.type, params,
+ video_capture_provider_->CreateDeviceLauncher());
controllers_.emplace_back(new_controller);
return new_controller;
}

Powered by Google App Engine
This is Rietveld 408576698