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

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

Issue 83633008: Reland: Reorganize media::VideoCapture* types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 a1fcad7b6a6071a1b8b23349ffee9ce728dcde02..18a7f2b679b5d0bb899fbe573867c74d39460d7d 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -133,7 +133,7 @@ void VideoCaptureManager::UseFakeDevice() {
void VideoCaptureManager::DoStartDeviceOnDeviceThread(
DeviceEntry* entry,
- const media::VideoCaptureCapability& capture_params,
+ const media::VideoCaptureParams& params,
scoped_ptr<media::VideoCaptureDevice::Client> device_client) {
SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime");
DCHECK(IsOnDeviceThread());
@@ -178,25 +178,23 @@ void VideoCaptureManager::DoStartDeviceOnDeviceThread(
return;
}
- video_capture_device->AllocateAndStart(capture_params, device_client.Pass());
+ video_capture_device->AllocateAndStart(params, device_client.Pass());
entry->video_capture_device = video_capture_device.Pass();
}
void VideoCaptureManager::StartCaptureForClient(
+ media::VideoCaptureSessionId session_id,
const media::VideoCaptureParams& params,
base::ProcessHandle client_render_process,
VideoCaptureControllerID client_id,
VideoCaptureControllerEventHandler* client_handler,
const DoneCB& done_cb) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- DVLOG(1) << "VideoCaptureManager::StartCaptureForClient, ("
- << params.requested_format.width
- << ", " << params.requested_format.height
- << ", " << params.requested_format.frame_rate
- << ", #" << params.session_id
- << ")";
-
- DeviceEntry* entry = GetOrCreateDeviceEntry(params.session_id);
+ DVLOG(1) << "VideoCaptureManager::StartCaptureForClient, "
+ << params.requested_format.frame_size.ToString() << ", "
+ << params.requested_format.frame_rate << ", #" << session_id << ")";
+
+ DeviceEntry* entry = GetOrCreateDeviceEntry(session_id);
if (!entry) {
done_cb.Run(base::WeakPtr<VideoCaptureController>());
return;
@@ -209,24 +207,19 @@ void VideoCaptureManager::StartCaptureForClient(
DVLOG(1) << "VideoCaptureManager starting device (type = "
<< entry->stream_type << ", id = " << entry->id << ")";
- media::VideoCaptureCapability params_as_capability;
- params_as_capability.width = params.requested_format.width;
- params_as_capability.height = params.requested_format.height;
- params_as_capability.frame_rate = params.requested_format.frame_rate;
- params_as_capability.frame_size_type =
- params.requested_format.frame_size_type;
-
- device_loop_->PostTask(FROM_HERE, base::Bind(
- &VideoCaptureManager::DoStartDeviceOnDeviceThread, this,
- entry, params_as_capability,
- base::Passed(entry->video_capture_controller->NewDeviceClient())));
+ device_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(
+ &VideoCaptureManager::DoStartDeviceOnDeviceThread,
+ this,
+ entry,
+ params,
+ base::Passed(entry->video_capture_controller->NewDeviceClient())));
}
// Run the callback first, as AddClient() may trigger OnFrameInfo().
done_cb.Run(entry->video_capture_controller->GetWeakPtr());
- entry->video_capture_controller->AddClient(client_id,
- client_handler,
- client_render_process,
- params);
+ entry->video_capture_controller->AddClient(
+ client_id, client_handler, client_render_process, session_id, params);
}
void VideoCaptureManager::StopCaptureForClient(

Powered by Google App Engine
This is Rietveld 408576698