| 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().muteSourceAudio.exact(); |
| 90 bool has_exact = |
| 91 request.audioConstraints().basic().muteSourceAudio.hasExact(); |
| 92 |
| 93 if (has_exact) { |
| 94 controls->mute_source_audio = exact; |
| 95 } else { |
| 96 controls->mute_source_audio = |
| 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 | 1210 |
| 1200 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1211 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
| 1201 return !sources_waiting_for_callback_.empty(); | 1212 return !sources_waiting_for_callback_.empty(); |
| 1202 } | 1213 } |
| 1203 | 1214 |
| 1204 void UserMediaClientImpl::OnDestruct() { | 1215 void UserMediaClientImpl::OnDestruct() { |
| 1205 delete this; | 1216 delete this; |
| 1206 } | 1217 } |
| 1207 | 1218 |
| 1208 } // namespace content | 1219 } // namespace content |
| OLD | NEW |