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

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

Issue 2941553003: Reland "SelectSettings algorithm for audio constraints." (Closed)
Patch Set: fix test Created 3 years, 6 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/media_stream_constraints_util_sets.cc
diff --git a/content/renderer/media/media_stream_constraints_util_sets.cc b/content/renderer/media/media_stream_constraints_util_sets.cc
index 66deebf5bd5f0366af273f58c7c520260a91bc1d..a667197248d7bde69314074a6c0d4f0e8cc8462a 100644
--- a/content/renderer/media/media_stream_constraints_util_sets.cc
+++ b/content/renderer/media/media_stream_constraints_util_sets.cc
@@ -533,4 +533,24 @@ ResolutionSet ResolutionSet::FromConstraintSet(
MaxAspectRatioFromConstraint(constraint_set.aspect_ratio));
}
+DiscreteSet<std::string> StringSetFromConstraint(
+ const blink::StringConstraint& constraint) {
+ if (!constraint.HasExact())
+ return DiscreteSet<std::string>::UniversalSet();
+
+ std::vector<std::string> elements;
+ for (const auto& entry : constraint.Exact())
+ elements.push_back(entry.Ascii());
+
+ return DiscreteSet<std::string>(std::move(elements));
+}
+
+DiscreteSet<bool> BoolSetFromConstraint(
+ const blink::BooleanConstraint& constraint) {
+ if (!constraint.HasExact())
+ return DiscreteSet<bool>::UniversalSet();
+
+ return DiscreteSet<bool>({constraint.Exact()});
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698