Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 if (audio_basic.hotwordEnabled.hasExact()) { | 78 if (audio_basic.hotwordEnabled.hasExact()) { |
| 79 controls->hotword_enabled = audio_basic.hotwordEnabled.exact(); | 79 controls->hotword_enabled = audio_basic.hotwordEnabled.exact(); |
| 80 } else { | 80 } else { |
| 81 for (const auto& audio_advanced : request.audioConstraints().advanced()) { | 81 for (const auto& audio_advanced : request.audioConstraints().advanced()) { |
| 82 if (audio_advanced.hotwordEnabled.hasExact()) { | 82 if (audio_advanced.hotwordEnabled.hasExact()) { |
| 83 controls->hotword_enabled = audio_advanced.hotwordEnabled.exact(); | 83 controls->hotword_enabled = audio_advanced.hotwordEnabled.exact(); |
| 84 break; | 84 break; |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | |
| 89 bool exact = request.audioConstraints().basic().disableLocalEcho.exact(); | |
|
Sergey Ulanov
2016/10/12 22:21:01
this doesn't look like a good variable name. Also
qiangchen
2016/10/12 22:49:54
Done.
| |
| 90 bool has_exact = | |
| 91 request.audioConstraints().basic().disableLocalEcho.hasExact(); | |
| 92 | |
| 93 if (has_exact) { | |
| 94 controls->disable_local_echo = exact; | |
| 95 } else { | |
| 96 controls->disable_local_echo = | |
| 97 controls->audio.stream_source != kMediaStreamSourceDesktop; | |
| 98 } | |
| 88 } | 99 } |
| 89 if (!request.videoConstraints().isNull()) { | 100 if (!request.videoConstraints().isNull()) { |
| 90 const blink::WebMediaTrackConstraintSet& video_basic = | 101 const blink::WebMediaTrackConstraintSet& video_basic = |
| 91 request.videoConstraints().basic(); | 102 request.videoConstraints().basic(); |
| 92 CopyFirstString(video_basic.mediaStreamSource.exact(), | 103 CopyFirstString(video_basic.mediaStreamSource.exact(), |
| 93 &(controls->video.stream_source)); | 104 &(controls->video.stream_source)); |
| 94 CopyVector(video_basic.deviceId.exact(), &(controls->video.device_ids)); | 105 CopyVector(video_basic.deviceId.exact(), &(controls->video.device_ids)); |
| 95 CopyVector(video_basic.deviceId.ideal(), | 106 CopyVector(video_basic.deviceId.ideal(), |
| 96 &(controls->video.alternate_device_ids)); | 107 &(controls->video.alternate_device_ids)); |
| 97 for (const auto& constraint : request.videoConstraints().advanced()) { | 108 for (const auto& constraint : request.videoConstraints().advanced()) { |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1186 | 1197 |
| 1187 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1198 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
| 1188 return !sources_waiting_for_callback_.empty(); | 1199 return !sources_waiting_for_callback_.empty(); |
| 1189 } | 1200 } |
| 1190 | 1201 |
| 1191 void UserMediaClientImpl::OnDestruct() { | 1202 void UserMediaClientImpl::OnDestruct() { |
| 1192 delete this; | 1203 delete this; |
| 1193 } | 1204 } |
| 1194 | 1205 |
| 1195 } // namespace content | 1206 } // namespace content |
| OLD | NEW |