OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 161 matching lines...) Loading... |
172 } | 172 } |
173 | 173 |
174 void CopyConstraintsIntoRtcConfiguration( | 174 void CopyConstraintsIntoRtcConfiguration( |
175 const MediaConstraintsInterface* constraints, | 175 const MediaConstraintsInterface* constraints, |
176 PeerConnectionInterface::RTCConfiguration* configuration) { | 176 PeerConnectionInterface::RTCConfiguration* configuration) { |
177 // Copy info from constraints into configuration, if present. | 177 // Copy info from constraints into configuration, if present. |
178 if (!constraints) { | 178 if (!constraints) { |
179 return; | 179 return; |
180 } | 180 } |
181 | 181 |
182 bool value; | 182 bool enable_ipv6; |
183 if (FindConstraint(constraints, MediaConstraintsInterface::kEnableIPv6, | 183 if (FindConstraint(constraints, MediaConstraintsInterface::kEnableIPv6, |
184 &value, nullptr)) { | 184 &enable_ipv6, nullptr)) { |
185 if (!value) { | 185 configuration->disable_ipv6 = !enable_ipv6; |
186 configuration->disable_ipv6 = true; | |
187 } | |
188 } | 186 } |
189 ConstraintToOptionalBool(constraints, MediaConstraintsInterface::kEnableDscp, | 187 FindConstraint(constraints, MediaConstraintsInterface::kEnableDscp, |
190 &configuration->enable_dscp); | 188 &configuration->media_config.enable_dscp, nullptr); |
191 ConstraintToOptionalBool(constraints, | 189 FindConstraint( |
192 MediaConstraintsInterface::kCpuOveruseDetection, | 190 constraints, MediaConstraintsInterface::kCpuOveruseDetection, |
193 &configuration->cpu_overuse_detection); | 191 &configuration->media_config.video.enable_cpu_overuse_detection, nullptr); |
194 if (FindConstraint(constraints, | 192 FindConstraint(constraints, MediaConstraintsInterface::kEnableRtpDataChannels, |
195 MediaConstraintsInterface::kEnableRtpDataChannels, &value, | 193 &configuration->enable_rtp_data_channel, nullptr); |
196 NULL) && | |
197 value) { | |
198 configuration->enable_rtp_data_channel = true; | |
199 } | |
200 // Find Suspend Below Min Bitrate constraint. | 194 // Find Suspend Below Min Bitrate constraint. |
201 ConstraintToOptionalBool( | 195 FindConstraint(constraints, |
202 constraints, | 196 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, |
203 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, | 197 &configuration->media_config.video.suspend_below_min_bitrate, |
204 &configuration->suspend_below_min_bitrate); | 198 nullptr); |
205 ConstraintToOptionalInt(constraints, | 199 ConstraintToOptionalInt(constraints, |
206 MediaConstraintsInterface::kScreencastMinBitrate, | 200 MediaConstraintsInterface::kScreencastMinBitrate, |
207 &configuration->screencast_min_bitrate); | 201 &configuration->screencast_min_bitrate); |
208 ConstraintToOptionalBool(constraints, | 202 ConstraintToOptionalBool(constraints, |
209 MediaConstraintsInterface::kCombinedAudioVideoBwe, | 203 MediaConstraintsInterface::kCombinedAudioVideoBwe, |
210 &configuration->combined_audio_video_bwe); | 204 &configuration->combined_audio_video_bwe); |
211 ConstraintToOptionalBool(constraints, | 205 ConstraintToOptionalBool(constraints, |
212 MediaConstraintsInterface::kEnableDtlsSrtp, | 206 MediaConstraintsInterface::kEnableDtlsSrtp, |
213 &configuration->enable_dtls_srtp); | 207 &configuration->enable_dtls_srtp); |
214 } | 208 } |
215 | 209 |
216 } // namespace webrtc | 210 } // namespace webrtc |
OLD | NEW |