Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: content/renderer/media/mock_media_constraint_factory.cc

Issue 227743004: Added a kEchoCancellation constraint to turn off the audio processing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/mock_media_constraint_factory.cc
diff --git a/content/renderer/media/mock_media_constraint_factory.cc b/content/renderer/media/mock_media_constraint_factory.cc
index 99d9f56244b49030173e76e88303b1c6eb246355..5708d50bf2f1e061da480cdbcbfa729a2795df4c 100644
--- a/content/renderer/media/mock_media_constraint_factory.cc
+++ b/content/renderer/media/mock_media_constraint_factory.cc
@@ -9,6 +9,13 @@
namespace content {
+namespace {
+
+static const char kValueTrue[] = "true";
+static const char kValueFalse[] = "false";
+
+} // namespace
+
MockMediaConstraintFactory::MockMediaConstraintFactory() {
}
@@ -37,6 +44,18 @@ void MockMediaConstraintFactory::AddMandatory(const std::string& key,
base::UTF8ToUTF16(base::DoubleToString(value))));
}
+void MockMediaConstraintFactory::AddMandatory(const std::string& key,
+ const std::string& value) {
+ mandatory_.push_back(blink::WebMediaConstraint(
+ base::UTF8ToUTF16(key), base::UTF8ToUTF16(value)));
+}
+
+void MockMediaConstraintFactory::AddMandatory(const std::string& key,
+ bool value) {
+ const std::string string_value = value ? kValueTrue : kValueFalse;
+ AddMandatory(key, string_value);
+}
+
void MockMediaConstraintFactory::AddOptional(const std::string& key,
int value) {
optional_.push_back(blink::WebMediaConstraint(base::UTF8ToUTF16(key),
@@ -50,6 +69,18 @@ void MockMediaConstraintFactory::AddOptional(const std::string& key,
base::UTF8ToUTF16(base::DoubleToString(value))));
}
+void MockMediaConstraintFactory::AddOptional(const std::string& key,
+ const std::string& value) {
+ optional_.push_back(blink::WebMediaConstraint(
+ base::UTF8ToUTF16(key), base::UTF8ToUTF16(value)));
+}
+
+void MockMediaConstraintFactory::AddOptional(const std::string& key,
+ bool value) {
+ const std::string string_value = value ? kValueTrue : kValueFalse;
+ AddOptional(key, string_value);
+}
+
void MockMediaConstraintFactory::DisableDefaultAudioConstraints() {
static const char* kDefaultAudioConstraints[] = {
webrtc::MediaConstraintsInterface::kEchoCancellation,
@@ -62,7 +93,7 @@ void MockMediaConstraintFactory::DisableDefaultAudioConstraints() {
webrtc::MediaConstraintsInterface::kExperimentalNoiseSuppression
};
MockMediaConstraintFactory factory;
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kDefaultAudioConstraints); ++i) {
+ for (size_t i = 0; i < arraysize(kDefaultAudioConstraints); ++i) {
AddMandatory(kDefaultAudioConstraints[i], false);
}
}

Powered by Google App Engine
This is Rietveld 408576698