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

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

Issue 308043003: Allow downsampling of output from a MediaStream video track to arbitrary max video size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8608311925e2da90c5fd5e5f12c60d47bd44d7af..bc482c07e041a0dd47047feabdd84668d0fa9ff6 100644
--- a/content/renderer/media/media_stream_video_source.cc
+++ b/content/renderer/media/media_stream_video_source.cc
@@ -49,11 +49,6 @@ namespace {
// are unknown.
const char kGooglePrefix[] = "goog";
-// MediaStreamVideoSource supports cropping of video frames but only up to
-// kMaxCropFactor. Ie - if a constraint is set to maxHeight 360, an original
-// input frame height of max 360 * kMaxCropFactor pixels is accepted.
-const int kMaxCropFactor = 2;
-
// Returns true if |constraint| has mandatory constraints.
bool HasMandatoryConstraints(const blink::WebMediaConstraints& constraints) {
blink::WebVector<blink::WebMediaConstraint> mandatory_constraints;
@@ -171,11 +166,11 @@ bool UpdateFormatForConstraint(
if (constraint_name == MediaStreamVideoSource::kMinWidth) {
return (value <= format->frame_size.width());
} else if (constraint_name == MediaStreamVideoSource::kMaxWidth) {
- return (value * kMaxCropFactor >= format->frame_size.width());
+ return value > 0;
mcasas 2014/05/30 13:31:58 Shouldn't we: return value > kMinimumPossibleFrame
} else if (constraint_name == MediaStreamVideoSource::kMinHeight) {
return (value <= format->frame_size.height());
} else if (constraint_name == MediaStreamVideoSource::kMaxHeight) {
- return (value * kMaxCropFactor >= format->frame_size.height());
+ return value > 0;
mcasas 2014/05/30 13:31:58 return value > kMaximumPossibleFrameWidth? (Assum
} else if (constraint_name == MediaStreamVideoSource::kMinFrameRate) {
return (value <= format->frame_rate);
} else if (constraint_name == MediaStreamVideoSource::kMaxFrameRate) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698