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

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

Issue 1729683002: Remove old-style constraints from Chrome internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Complete the interface change Created 4 years, 9 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_video_capturer_source.cc
diff --git a/content/renderer/media/media_stream_video_capturer_source.cc b/content/renderer/media/media_stream_video_capturer_source.cc
index 59be54802d7daf9eccb3e35697645f464f4cc53d..ea2fb04af8da96c8b2105bdff99eae860a8a92bd 100644
--- a/content/renderer/media/media_stream_video_capturer_source.cc
+++ b/content/renderer/media/media_stream_video_capturer_source.cc
@@ -96,14 +96,11 @@ void SetContentCaptureParamsFromConstraints(
int width = 0;
int height = 0;
gfx::Size desired_max_frame_size;
- if (GetConstraintValueAsInteger(constraints,
- MediaStreamVideoSource::kMaxWidth,
- &width) &&
- GetConstraintValueAsInteger(constraints,
- MediaStreamVideoSource::kMaxHeight,
- &height) &&
- DimensionValueIsValid(width) &&
- DimensionValueIsValid(height)) {
+ if (GetConstraintMaxAsInteger(
+ constraints, &blink::WebMediaTrackConstraintSet::width, &width) &&
+ GetConstraintMaxAsInteger(
+ constraints, &blink::WebMediaTrackConstraintSet::height, &height) &&
+ DimensionValueIsValid(width) && DimensionValueIsValid(height)) {
desired_max_frame_size.SetSize(width, height);
if (params->requested_format.frame_size.IsEmpty() ||
desired_max_frame_size.width() <
@@ -124,9 +121,9 @@ void SetContentCaptureParamsFromConstraints(
// If the maximum frame rate was provided, use it if either: 1) none has been
// set yet; or 2) the maximum specificed is smaller than the current setting.
double frame_rate = 0.0;
- if (GetConstraintValueAsDouble(constraints,
- MediaStreamVideoSource::kMaxFrameRate,
- &frame_rate) &&
+ if (GetConstraintMaxAsDouble(constraints,
+ &blink::WebMediaTrackConstraintSet::frameRate,
+ &frame_rate) &&
FrameRateValueIsValid(frame_rate)) {
if (params->requested_format.frame_rate <= 0.0f ||
frame_rate < params->requested_format.frame_rate) {
@@ -143,12 +140,10 @@ void SetContentCaptureParamsFromConstraints(
// If the minimum frame resolution was provided, compare it to the maximum
// frame resolution to determine the intended resolution change policy.
if (!desired_max_frame_size.IsEmpty() &&
- GetConstraintValueAsInteger(constraints,
- MediaStreamVideoSource::kMinWidth,
- &width) &&
- GetConstraintValueAsInteger(constraints,
- MediaStreamVideoSource::kMinHeight,
- &height) &&
+ GetConstraintMinAsInteger(
+ constraints, &blink::WebMediaTrackConstraintSet::width, &width) &&
+ GetConstraintMinAsInteger(
+ constraints, &blink::WebMediaTrackConstraintSet::height, &height) &&
width <= desired_max_frame_size.width() &&
height <= desired_max_frame_size.height()) {
if (width == desired_max_frame_size.width() &&
@@ -186,8 +181,9 @@ void SetPowerLineFrequencyParamFromConstraints(
media::VideoCaptureParams* params) {
int freq;
params->power_line_frequency = media::PowerLineFrequency::FREQUENCY_DEFAULT;
- if (!GetOptionalConstraintValueAsInteger(constraints, kPowerLineFrequency,
- &freq)) {
+ if (!GetConstraintValueAsInteger(
+ constraints,
+ &blink::WebMediaTrackConstraintSet::googPowerLineFrequency, &freq)) {
return;
}
if (freq == static_cast<int>(media::PowerLineFrequency::FREQUENCY_50HZ))

Powered by Google App Engine
This is Rietveld 408576698