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

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

Issue 2291893002: Let Contraints Controll Mute/Unmute Audio Local Playback For Desktop Sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove Debug Code Created 4 years, 3 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/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 0d549c72f8aec382eb1ace40b0d9b79e4d00dece..0baee69568417fcd9f763a2b1626b751cb0e1818 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -258,7 +258,7 @@ class MediaStreamManager::DeviceRequest {
requesting_process_id, requesting_frame_id, page_request_id,
ConvertToGURL(security_origin), user_gesture, request_type,
requested_audio_device_id, requested_video_device_id, audio_type_,
- video_type_));
+ video_type_, mute_source));
miu 2016/09/07 21:10:03 Seems like the extra bool argument is not needed,
qiangchen 2016/09/09 18:45:24 We need it. Because at this point, the device_id i
}
// Creates a tab capture specific MediaStreamRequest object that is used by
@@ -271,7 +271,7 @@ class MediaStreamManager::DeviceRequest {
ui_request_.reset(new MediaStreamRequest(
target_render_process_id, target_render_frame_id, page_request_id,
ConvertToGURL(security_origin), user_gesture, request_type, "", "",
- audio_type_, video_type_));
+ audio_type_, video_type_, mute_source));
}
bool HasUIRequest() const { return ui_request_.get() != nullptr; }
@@ -354,6 +354,8 @@ class MediaStreamManager::DeviceRequest {
std::string tab_capture_device_id;
+ bool mute_source;
+
private:
std::vector<MediaRequestState> state_;
std::unique_ptr<MediaStreamRequest> ui_request_;
@@ -1318,7 +1320,13 @@ bool MediaStreamManager::SetupTabCaptureRequest(DeviceRequest* request) {
request->video_type() != MEDIA_NO_SERVICE)) {
return false;
}
- request->tab_capture_device_id = capture_device_id;
+ // TODO(qiangchen): Plug in constraint value here for tabCapture.
+ request->mute_source = request->controls.mute_source_audio;
+
+ content::WebContentsMediaCaptureId web_id =
+ content::WebContentsMediaCaptureId::Parse(capture_device_id);
+ web_id.mute_source = request->mute_source;
+ request->tab_capture_device_id = web_id.ToString();
request->CreateTabCaptureUIRequest(target_render_process_id,
target_render_frame_id);
@@ -1354,6 +1362,7 @@ bool MediaStreamManager::SetupScreenCaptureRequest(DeviceRequest* request) {
!request->controls.video.device_ids.empty()) {
video_device_id = request->controls.video.device_ids[0];
}
+ request->mute_source = request->controls.mute_source_audio;
}
const std::string audio_device_id =

Powered by Google App Engine
This is Rietveld 408576698