summaryrefslogtreecommitdiffstats
path: root/content/renderer/media/media_stream_video_source.cc
diff options
context:
space:
mode:
authormiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-05 23:35:14 +0000
committermiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-05 23:35:14 +0000
commit683511a70428de8050427f1d26ec5643dde35e2f (patch)
tree6f06cf877cc9549c7a39316a1bb4e99df22e2e37 /content/renderer/media/media_stream_video_source.cc
parent1e7c29f57adb2441163c6bc036680c8612e7d757 (diff)
downloadchromium_src-683511a70428de8050427f1d26ec5643dde35e2f.zip
chromium_src-683511a70428de8050427f1d26ec5643dde35e2f.tar.gz
chromium_src-683511a70428de8050427f1d26ec5643dde35e2f.tar.bz2
Allow MediaStream constraints to specify higher than 30 FPS tab capture.
This will allow true 720p/60fps tab/desktop capture, if configured through the constraints (and the system hardware performance supports it). In addition, this will enable tab capture perf tests to run at higher frame rates so that more-subtle regressions are caught. A new hard upper-bound of 120 FPS is enforced with this change. BUG=400631 TBR=yzshen@chromium.org Review URL: https://codereview.chromium.org/442643002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/media/media_stream_video_source.cc')
-rw-r--r--content/renderer/media/media_stream_video_source.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/content/renderer/media/media_stream_video_source.cc b/content/renderer/media/media_stream_video_source.cc
index 42c5b1b..d6f8b8a4 100644
--- a/content/renderer/media/media_stream_video_source.cc
+++ b/content/renderer/media/media_stream_video_source.cc
@@ -173,9 +173,9 @@ bool UpdateFormatForConstraint(
} else if (constraint_name == MediaStreamVideoSource::kMaxHeight) {
return value > 0.0;
} else if (constraint_name == MediaStreamVideoSource::kMinFrameRate) {
- return (value <= format->frame_rate);
+ return (value > 0.0) && (value <= format->frame_rate);
} else if (constraint_name == MediaStreamVideoSource::kMaxFrameRate) {
- if (value == 0.0) {
+ if (value <= 0.0) {
// The frame rate is set by constraint.
// Don't allow 0 as frame rate if it is a mandatory constraint.
// Set the frame rate to 1 if it is not mandatory.
@@ -387,10 +387,17 @@ void MediaStreamVideoSource::AddTrack(
GetMandatoryConstraintValueAsInteger(constraints, kMaxHeight,
&max_requested_height);
+ double max_requested_frame_rate;
+ if (!GetConstraintValueAsDouble(constraints, kMaxFrameRate,
+ &max_requested_frame_rate)) {
+ max_requested_frame_rate = kDefaultFrameRate;
+ }
+
state_ = RETRIEVING_CAPABILITIES;
GetCurrentSupportedFormats(
max_requested_width,
max_requested_height,
+ max_requested_frame_rate,
base::Bind(&MediaStreamVideoSource::OnSupportedFormats,
weak_factory_.GetWeakPtr()));