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

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

Issue 2231863004: Add "exact" constraint evaluation to video picker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Guido's comments Created 4 years, 4 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
« no previous file with comments | « no previous file | content/renderer/media/media_stream_constraints_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_constraints_util.cc
diff --git a/content/renderer/media/media_stream_constraints_util.cc b/content/renderer/media/media_stream_constraints_util.cc
index d313f3b94247917806310927d7f0499a5c0d2e7c..3150c94c547d767f3d137758dba962bc0bf73c36 100644
--- a/content/renderer/media/media_stream_constraints_util.cc
+++ b/content/renderer/media/media_stream_constraints_util.cc
@@ -41,12 +41,20 @@ bool ScanConstraintsForMaxValue(const blink::WebMediaConstraints& constraints,
*value = the_field.max();
return true;
}
+ if (the_field.hasExact()) {
+ *value = the_field.exact();
+ return true;
+ }
for (const auto& advanced_constraint : constraints.advanced()) {
const auto& the_field = advanced_constraint.*picker;
if (the_field.hasMax()) {
*value = the_field.max();
return true;
}
+ if (the_field.hasExact()) {
+ *value = the_field.exact();
+ return true;
+ }
}
return false;
}
@@ -60,12 +68,20 @@ bool ScanConstraintsForMinValue(const blink::WebMediaConstraints& constraints,
*value = the_field.min();
return true;
}
+ if (the_field.hasExact()) {
+ *value = the_field.exact();
+ return true;
+ }
for (const auto& advanced_constraint : constraints.advanced()) {
const auto& the_field = advanced_constraint.*picker;
if (the_field.hasMin()) {
*value = the_field.min();
return true;
}
+ if (the_field.hasExact()) {
+ *value = the_field.exact();
+ return true;
+ }
}
return false;
}
« no previous file with comments | « no previous file | content/renderer/media/media_stream_constraints_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698