Add kGoogEchoCancellation to MediaConstraintsInterface.

This constraint will be equal to kEchoCancellation until we've updated Chromium to use kGoogEchoCancellation where that constraint is needed.  Once that's done, I'll change kEchoCancellation to be 'echoCancellation'.

BUG=webrtc:4747
R=andrew@webrtc.org

Review URL: https://codereview.webrtc.org/1179233003.

Cr-Commit-Position: refs/heads/master@{#9433}
This commit is contained in:
Tommi
2015-06-15 09:14:03 +02:00
parent 01bbe3eb8c
commit 70c7fe14ac
4 changed files with 15 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ void FromConstraints(const MediaConstraintsInterface::Constraints& constraints,
const char* name;
cricket::Settable<bool>& value;
} key_to_value[] = {
{MediaConstraintsInterface::kEchoCancellation,
{MediaConstraintsInterface::kGoogEchoCancellation,
options->echo_cancellation},
// Both kExperimentalEchoCancellation (old) and
// kExtendedFilterEchoCancellation (new) translate to

View File

@@ -43,7 +43,8 @@ using webrtc::PeerConnectionFactoryInterface;
TEST(LocalAudioSourceTest, SetValidOptions) {
webrtc::FakeConstraints constraints;
constraints.AddMandatory(MediaConstraintsInterface::kEchoCancellation, false);
constraints.AddMandatory(
MediaConstraintsInterface::kGoogEchoCancellation, false);
constraints.AddOptional(
MediaConstraintsInterface::kExtendedFilterEchoCancellation, true);
constraints.AddOptional(MediaConstraintsInterface::kDAEchoCancellation, true);
@@ -133,8 +134,10 @@ TEST(LocalAudioSourceTest, OptionNotSet) {
TEST(LocalAudioSourceTest, MandatoryOverridesOptional) {
webrtc::FakeConstraints constraints;
constraints.AddMandatory(MediaConstraintsInterface::kEchoCancellation, false);
constraints.AddOptional(MediaConstraintsInterface::kEchoCancellation, true);
constraints.AddMandatory(
MediaConstraintsInterface::kGoogEchoCancellation, false);
constraints.AddOptional(
MediaConstraintsInterface::kGoogEchoCancellation, true);
rtc::scoped_refptr<LocalAudioSource> source =
LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(),

View File

@@ -48,6 +48,8 @@ const char MediaConstraintsInterface::kMinFrameRate[] = "minFrameRate";
// Audio constraints.
const char MediaConstraintsInterface::kEchoCancellation[] =
"googEchoCancellation";
const char MediaConstraintsInterface::kGoogEchoCancellation[] =
"googEchoCancellation";
const char MediaConstraintsInterface::kExperimentalEchoCancellation[] =
"googEchoCancellation2";
const char MediaConstraintsInterface::kExtendedFilterEchoCancellation[] =

View File

@@ -73,7 +73,13 @@ class MediaConstraintsInterface {
// Constraint keys used by a local audio source.
// These keys are google specific.
// TODO(tommi): Change kEchoCancellation to be "echoCancellation" once
// Chrome has been updated to use kGoogEchoCancellation where the 'goog'
// variant is needed.
// See https://code.google.com/p/webrtc/issues/detail?id=4747
static const char kEchoCancellation[]; // googEchoCancellation
static const char kGoogEchoCancellation[]; // googEchoCancellation
// TODO(henrik.lundin) Remove kExperimentalEchoCancellation.
// https://code.google.com/p/webrtc/issues/detail?id=4696
static const char kExperimentalEchoCancellation[]; // googEchoCancellation2