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

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

Issue 442643002: Allow MediaStream constraints to specify higher than 30 FPS tab capture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile whoops. Created 6 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
Index: content/renderer/media/media_stream_video_source.cc
diff --git a/content/renderer/media/media_stream_video_source.cc b/content/renderer/media/media_stream_video_source.cc
index 42c5b1b4c558aeb7bfcd849c274e95f79d7960a5..d6f8b8a405eff8b3c58067a71ef014d213303f3e 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()));
« no previous file with comments | « content/renderer/media/media_stream_video_source.h ('k') | content/renderer/media/mock_media_stream_video_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698