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

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

Issue 2742893003: Let getSettings() return the constrained track resolution, not source. (Closed)
Patch Set: Added bug # for non-working test Created 3 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
« no previous file with comments | « no previous file | content/renderer/media/media_stream_video_track.h » ('j') | 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 3c962ff0c7d0e5d7889553ee2b4871c40bda95f8..41fa5e8eabb14759ed878f84d2ec1feb48eeb77f 100644
--- a/content/renderer/media/media_stream_video_source.cc
+++ b/content/renderer/media/media_stream_video_source.cc
@@ -582,6 +582,13 @@ void MediaStreamVideoSource::FinalizeAddTrack() {
track_adapter_->AddTrack(track.track, track.frame_callback, max_width,
max_height, min_aspect_ratio, max_aspect_ratio,
max_frame_rate);
+ // Calculate resulting frame size if the source delivers frames
+ // according to the current format. Note: Format may change later.
+ gfx::Size desired_size;
+ VideoTrackAdapter::CalculateTargetSize(
+ current_format_.frame_size, gfx::Size(max_width, max_height),
+ min_aspect_ratio, max_aspect_ratio, &desired_size);
+ track.track->SetTargetSize(desired_size.width(), desired_size.height());
}
DVLOG(3) << "FinalizeAddTrack() result " << result;
« no previous file with comments | « no previous file | content/renderer/media/media_stream_video_track.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698