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

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: Adress comments 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 1ca3520ff10042e8f2942b1b4896d644b2e4d8ad..18faefa1aacf875b00437de4464ea71cd939df34 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -109,10 +109,15 @@ class MediaStreamManager::DeviceRequest {
if (media_observer == NULL)
return;
+ std::string device_id = requested_device_id;
+ if (WebContentsCaptureUtil::IsWebContentsDeviceId(requested_device_id))
+ device_id = WebContentsCaptureUtil::StripWebContentsDeviceScheme(
+ requested_device_id);
+
no longer working on chromium 2012/11/26 22:20:07 can this (WebContentsCaptureUtil::IsWebContentsDev
justinlin 2012/11/27 22:26:12 Done. Actually don't need the "if" anymore.
media_observer->OnMediaRequestStateChanged(
render_process_id, render_view_id,
MediaStreamDevice(
- stream_type, requested_device_id, requested_device_id), new_state);
+ stream_type, device_id, device_id), new_state);
}
MediaRequestState getState(MediaStreamType stream_type) const {
@@ -246,6 +251,7 @@ void MediaStreamManager::GenerateStreamForDevice(
security_origin),
label);
DeviceRequest& request = requests_[*label];
+
request.requested_device_id = device_id;
// Get user confirmation to use the capture device.
@@ -275,7 +281,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,
+ device_id,
+ device_id,
false)));
}
if (IsVideoMediaType(options.video_type)) {
@@ -283,7 +291,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,
+ device_id,
+ device_id,
false)));
}
}

Powered by Google App Engine
This is Rietveld 408576698