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

Side by Side Diff: content/renderer/media/user_media_client_impl.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: Rebase Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/user_media_client_impl.h" 5 #include "content/renderer/media/user_media_client_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (audio_basic.hotwordEnabled.hasExact()) { 79 if (audio_basic.hotwordEnabled.hasExact()) {
80 controls->hotword_enabled = audio_basic.hotwordEnabled.exact(); 80 controls->hotword_enabled = audio_basic.hotwordEnabled.exact();
81 } else { 81 } else {
82 for (const auto& audio_advanced : request.audioConstraints().advanced()) { 82 for (const auto& audio_advanced : request.audioConstraints().advanced()) {
83 if (audio_advanced.hotwordEnabled.hasExact()) { 83 if (audio_advanced.hotwordEnabled.hasExact()) {
84 controls->hotword_enabled = audio_advanced.hotwordEnabled.exact(); 84 controls->hotword_enabled = audio_advanced.hotwordEnabled.exact();
85 break; 85 break;
86 } 86 }
87 } 87 }
88 } 88 }
89
90 if (request.audioConstraints().basic().disableLocalEcho.hasExact()) {
91 controls->disable_local_echo =
92 request.audioConstraints().basic().disableLocalEcho.exact();
93 } else {
94 controls->disable_local_echo =
95 controls->audio.stream_source != kMediaStreamSourceDesktop;
96 }
89 } 97 }
90 if (!request.videoConstraints().isNull()) { 98 if (!request.videoConstraints().isNull()) {
91 const blink::WebMediaTrackConstraintSet& video_basic = 99 const blink::WebMediaTrackConstraintSet& video_basic =
92 request.videoConstraints().basic(); 100 request.videoConstraints().basic();
93 CopyFirstString(video_basic.mediaStreamSource.exact(), 101 CopyFirstString(video_basic.mediaStreamSource.exact(),
94 &(controls->video.stream_source)); 102 &(controls->video.stream_source));
95 CopyVector(video_basic.deviceId.exact(), &(controls->video.device_ids)); 103 CopyVector(video_basic.deviceId.exact(), &(controls->video.device_ids));
96 CopyVector(video_basic.deviceId.ideal(), 104 CopyVector(video_basic.deviceId.ideal(),
97 &(controls->video.alternate_device_ids)); 105 &(controls->video.alternate_device_ids));
98 for (const auto& constraint : request.videoConstraints().advanced()) { 106 for (const auto& constraint : request.videoConstraints().advanced()) {
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 1036
1029 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { 1037 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const {
1030 return !sources_waiting_for_callback_.empty(); 1038 return !sources_waiting_for_callback_.empty();
1031 } 1039 }
1032 1040
1033 void UserMediaClientImpl::OnDestruct() { 1041 void UserMediaClientImpl::OnDestruct() {
1034 delete this; 1042 delete this;
1035 } 1043 }
1036 1044
1037 } // namespace content 1045 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/media_stream_request.cc ('k') | content/test/data/media/getusermedia.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698