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

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

Issue 11298006: Browser-wide audio mirroring for TabCapture API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Relevant files only. Created 8 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/media_stream_manager.cc
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index c01ce79ae528c045b614777e450facbc1b9bf9eb..762ca4c64433d9cd2754f07c0763ab17b691609d 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -246,7 +246,14 @@ void MediaStreamManager::GenerateStreamForDevice(
security_origin),
label);
DeviceRequest& request = requests_[*label];
- request.requested_device_id = device_id;
+
+ // Append our tab capture device id scheme.
+ // TODO(justinlin): This is kind of a hack, but the plumbing for audio streams
+ // is too complicated to plumb in by type. Will revisit once it's refactored.
+ const std::string &virtual_device_id =
+ WebContentsCaptureUtil::AppendWebContentsDeviceScheme(device_id);
+
+ request.requested_device_id = virtual_device_id;
// Get user confirmation to use the capture device.
PostRequestToUI(*label);
@@ -275,7 +282,9 @@ void MediaStreamManager::GenerateStreamForDevice(
request.setState(options.audio_type, MEDIA_REQUEST_STATE_PENDING_APPROVAL);
ui_controller_->AddAvailableDevicesToRequest(
*label, options.audio_type, StreamDeviceInfoArray(
- 1, StreamDeviceInfo(options.audio_type, device_id, device_id,
+ 1, StreamDeviceInfo(options.audio_type,
+ virtual_device_id,
+ virtual_device_id,
false)));
}
if (IsVideoMediaType(options.video_type)) {
@@ -283,7 +292,9 @@ void MediaStreamManager::GenerateStreamForDevice(
request.setState(options.video_type, MEDIA_REQUEST_STATE_PENDING_APPROVAL);
ui_controller_->AddAvailableDevicesToRequest(
*label, options.video_type, StreamDeviceInfoArray(
- 1, StreamDeviceInfo(options.video_type, device_id, device_id,
+ 1, StreamDeviceInfo(options.video_type,
+ virtual_device_id,
+ virtual_device_id,
false)));
}
}

Powered by Google App Engine
This is Rietveld 408576698