Adding googAudioNetworkAdaptorConfig to MediaConstraintsInterface.
This is to allow application to pass an audio network adaptor config string to WebRTC. BUG=webrtc:6303 Review-Url: https://codereview.webrtc.org/2437803004 Cr-Commit-Position: refs/heads/master@{#15532}
This commit is contained in:
parent
50bac868e7
commit
ba41428b12
@ -57,6 +57,28 @@ void FromConstraints(const MediaConstraintsInterface::Constraints& constraints,
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (const auto& constraint : 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;
|
bool value = false;
|
||||||
if (!rtc::FromString(constraint.value, &value))
|
if (!rtc::FromString(constraint.value, &value))
|
||||||
continue;
|
continue;
|
||||||
@ -66,18 +88,6 @@ void FromConstraints(const MediaConstraintsInterface::Constraints& constraints,
|
|||||||
entry.value = rtc::Optional<bool>(value);
|
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
|
} // namespace
|
||||||
|
|||||||
@ -56,6 +56,8 @@ const char MediaConstraintsInterface::kHighpassFilter[] =
|
|||||||
const char MediaConstraintsInterface::kTypingNoiseDetection[] =
|
const char MediaConstraintsInterface::kTypingNoiseDetection[] =
|
||||||
"googTypingNoiseDetection";
|
"googTypingNoiseDetection";
|
||||||
const char MediaConstraintsInterface::kAudioMirroring[] = "googAudioMirroring";
|
const char MediaConstraintsInterface::kAudioMirroring[] = "googAudioMirroring";
|
||||||
|
const char MediaConstraintsInterface::kAudioNetworkAdaptorConfig[] =
|
||||||
|
"googAudioNetworkAdaptorConfig";
|
||||||
|
|
||||||
// Google-specific constraint keys for a local video source (getUserMedia).
|
// Google-specific constraint keys for a local video source (getUserMedia).
|
||||||
const char MediaConstraintsInterface::kNoiseReduction[] = "googNoiseReduction";
|
const char MediaConstraintsInterface::kNoiseReduction[] = "googNoiseReduction";
|
||||||
|
|||||||
@ -80,6 +80,8 @@ class MediaConstraintsInterface {
|
|||||||
static const char kHighpassFilter[]; // googHighpassFilter
|
static const char kHighpassFilter[]; // googHighpassFilter
|
||||||
static const char kTypingNoiseDetection[]; // googTypingNoiseDetection
|
static const char kTypingNoiseDetection[]; // googTypingNoiseDetection
|
||||||
static const char kAudioMirroring[]; // googAudioMirroring
|
static const char kAudioMirroring[]; // googAudioMirroring
|
||||||
|
static const char
|
||||||
|
kAudioNetworkAdaptorConfig[]; // goodAudioNetworkAdaptorConfig
|
||||||
|
|
||||||
// Google-specific constraint keys for a local video source
|
// Google-specific constraint keys for a local video source
|
||||||
static const char kNoiseReduction[]; // googNoiseReduction
|
static const char kNoiseReduction[]; // googNoiseReduction
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user