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

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

Issue 2870413004: Detect frames from rotated devices in VideoTrackAdapter on Android. (Closed)
Patch Set: address comment by tommi@ Created 3 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
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 0425cd3cdaf28ba7be1c4d9271d38d7ff1040235..f3b8e875059884a5e144aa9092a628d1bd1ac44f 100644
--- a/content/renderer/media/media_stream_video_source.cc
+++ b/content/renderer/media/media_stream_video_source.cc
@@ -644,13 +644,15 @@ void MediaStreamVideoSource::FinalizeAddTrackLegacy() {
track_adapter_->AddTrack(
track.track, track.frame_callback,
VideoTrackAdapterSettings(max_width, max_height, min_aspect_ratio,
- max_aspect_ratio, max_frame_rate));
+ max_aspect_ratio, max_frame_rate,
+ base::Optional<gfx::Size>()));
// 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);
+ false /* is_rotated */, current_format_.frame_size,
+ gfx::Size(max_width, max_height), min_aspect_ratio, max_aspect_ratio,
+ &desired_size);
track.track->SetTargetSizeAndFrameRate(
desired_size.width(), desired_size.height(), max_frame_rate);
}
@@ -681,6 +683,7 @@ void MediaStreamVideoSource::FinalizeAddTrack() {
// according to the current format. Note: Format may change later.
gfx::Size desired_size;
VideoTrackAdapter::CalculateTargetSize(
+ false /* is_rotated */,
GetCurrentFormat() ? GetCurrentFormat()->frame_size
: gfx::Size(track.adapter_settings->max_width,
track.adapter_settings->max_height),

Powered by Google App Engine
This is Rietveld 408576698