| Index: webrtc/api/localaudiosource.cc
|
| diff --git a/webrtc/api/localaudiosource.cc b/webrtc/api/localaudiosource.cc
|
| index d91394eebcfca022e1e4b1270dc15985de4ab065..70035fececf80bf97647a4292754e79fbc0050f1 100644
|
| --- a/webrtc/api/localaudiosource.cc
|
| +++ b/webrtc/api/localaudiosource.cc
|
| @@ -57,6 +57,28 @@ void FromConstraints(const MediaConstraintsInterface::Constraints& constraints,
|
| };
|
|
|
| for (const auto& constraint : constraints) {
|
| + // Set non-boolean constraints.
|
| + if (0 == constraint.key.compare(
|
| + MediaConstraintsInterface::kLevelControlInitialPeakLevelDBFS)) {
|
| + float level_control_initial_peak_level_dbfs = 0.0f;
|
| + if (rtc::FromString(constraint.value,
|
| + &level_control_initial_peak_level_dbfs)) {
|
| + options->level_control_initial_peak_level_dbfs =
|
| + rtc::Optional<float>(level_control_initial_peak_level_dbfs);
|
| + }
|
| + continue;
|
| + }
|
| + if (constraint.key.compare(
|
| + MediaConstraintsInterface::kAudioNetworkAdaptorConfig) == 0) {
|
| + // When |kAudioNetworkAdaptorConfig| is defined, it both means that audio
|
| + // network adaptor is desired, and provides the config string.
|
| + options->audio_network_adaptor = rtc::Optional<bool>(true);
|
| + options->audio_network_adaptor_config =
|
| + rtc::Optional<std::string>(constraint.value);
|
| + continue;
|
| + }
|
| +
|
| + // Parse boolean value.
|
| bool value = false;
|
| if (!rtc::FromString(constraint.value, &value))
|
| continue;
|
| @@ -66,18 +88,6 @@ void FromConstraints(const MediaConstraintsInterface::Constraints& constraints,
|
| entry.value = rtc::Optional<bool>(value);
|
| }
|
| }
|
| -
|
| - // Set non-boolean constraints.
|
| - std::string value;
|
| - if (constraints.FindFirst(
|
| - MediaConstraintsInterface::kLevelControlInitialPeakLevelDBFS,
|
| - &value)) {
|
| - float level_control_initial_peak_level_dbfs;
|
| - if (rtc::FromString(value, &level_control_initial_peak_level_dbfs)) {
|
| - options->level_control_initial_peak_level_dbfs =
|
| - rtc::Optional<float>(level_control_initial_peak_level_dbfs);
|
| - }
|
| - }
|
| }
|
|
|
| } // namespace
|
|
|