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 for (const auto& audio_advanced : request.audioConstraints().advanced()) { |
74 if (!audio_advanced.hotwordEnabled.matches(false)) | |
75 controls->hotword_enabled = true; | |
hta - Chromium
2016/02/26 11:35:44
1) put a break in this loop.
2) instead use
if
Anand Mistry (off Chromium)
2016/02/29 02:10:07
Done.
| |
76 } | |
74 } | 77 } |
75 if (!request.videoConstraints().isNull()) { | 78 if (!request.videoConstraints().isNull()) { |
76 const blink::WebMediaTrackConstraintSet& video_basic = | 79 const blink::WebMediaTrackConstraintSet& video_basic = |
77 request.videoConstraints().basic(); | 80 request.videoConstraints().basic(); |
78 CopyFirstString(video_basic.mediaStreamSource.exact(), | 81 CopyFirstString(video_basic.mediaStreamSource.exact(), |
79 &(controls->video.stream_source)); | 82 &(controls->video.stream_source)); |
80 CopyVector(video_basic.deviceId.exact(), &(controls->video.device_ids)); | 83 CopyVector(video_basic.deviceId.exact(), &(controls->video.device_ids)); |
81 CopyVector(video_basic.deviceId.ideal(), | 84 CopyVector(video_basic.deviceId.ideal(), |
82 &(controls->video.alternate_device_ids)); | 85 &(controls->video.alternate_device_ids)); |
83 } | 86 } |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1133 return; | 1136 return; |
1134 } | 1137 } |
1135 } | 1138 } |
1136 } | 1139 } |
1137 | 1140 |
1138 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1141 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
1139 return !sources_waiting_for_callback_.empty(); | 1142 return !sources_waiting_for_callback_.empty(); |
1140 } | 1143 } |
1141 | 1144 |
1142 } // namespace content | 1145 } // namespace content |
OLD | NEW |