| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 if (!request.audioConstraints().isNull()) { | 62 if (!request.audioConstraints().isNull()) { |
| 63 const blink::WebMediaTrackConstraintSet& audio_basic = | 63 const blink::WebMediaTrackConstraintSet& audio_basic = |
| 64 request.audioConstraints().basic(); | 64 request.audioConstraints().basic(); |
| 65 CopyFirstString(audio_basic.mediaStreamSource.exact(), | 65 CopyFirstString(audio_basic.mediaStreamSource.exact(), |
| 66 &(controls->audio.stream_source)); | 66 &(controls->audio.stream_source)); |
| 67 CopyVector(audio_basic.deviceId.exact(), &(controls->audio.device_ids)); | 67 CopyVector(audio_basic.deviceId.exact(), &(controls->audio.device_ids)); |
| 68 // Optionals. They may be either in ideal or in advanced.exact. | 68 // Optionals. They may be either in ideal or in advanced.exact. |
| 69 // TODO(hta): Get alternatives only mentioned in advanced array. | 69 // TODO(hta): Get alternatives only mentioned in advanced array. |
| 70 CopyVector(audio_basic.deviceId.ideal(), | 70 CopyVector(audio_basic.deviceId.ideal(), |
| 71 &controls->audio.alternate_device_ids); | 71 &controls->audio.alternate_device_ids); |
| 72 if (!audio_basic.hotwordEnabled.matches(false)) | 72 |
| 73 controls->hotword_enabled = true; | 73 if (audio_basic.hotwordEnabled.hasExact()) { |
| 74 controls->hotword_enabled = audio_basic.hotwordEnabled.exact(); |
| 75 } else { |
| 76 for (const auto& audio_advanced : request.audioConstraints().advanced()) { |
| 77 if (audio_advanced.hotwordEnabled.hasExact()) { |
| 78 controls->hotword_enabled = audio_advanced.hotwordEnabled.exact(); |
| 79 break; |
| 80 } |
| 81 } |
| 82 } |
| 74 } | 83 } |
| 75 if (!request.videoConstraints().isNull()) { | 84 if (!request.videoConstraints().isNull()) { |
| 76 const blink::WebMediaTrackConstraintSet& video_basic = | 85 const blink::WebMediaTrackConstraintSet& video_basic = |
| 77 request.videoConstraints().basic(); | 86 request.videoConstraints().basic(); |
| 78 CopyFirstString(video_basic.mediaStreamSource.exact(), | 87 CopyFirstString(video_basic.mediaStreamSource.exact(), |
| 79 &(controls->video.stream_source)); | 88 &(controls->video.stream_source)); |
| 80 CopyVector(video_basic.deviceId.exact(), &(controls->video.device_ids)); | 89 CopyVector(video_basic.deviceId.exact(), &(controls->video.device_ids)); |
| 81 CopyVector(video_basic.deviceId.ideal(), | 90 CopyVector(video_basic.deviceId.ideal(), |
| 82 &(controls->video.alternate_device_ids)); | 91 &(controls->video.alternate_device_ids)); |
| 83 } | 92 } |
| (...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 return; | 1146 return; |
| 1138 } | 1147 } |
| 1139 } | 1148 } |
| 1140 } | 1149 } |
| 1141 | 1150 |
| 1142 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1151 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
| 1143 return !sources_waiting_for_callback_.empty(); | 1152 return !sources_waiting_for_callback_.empty(); |
| 1144 } | 1153 } |
| 1145 | 1154 |
| 1146 } // namespace content | 1155 } // namespace content |
| OLD | NEW |