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

Unified Diff: remoting/client/plugin/media_source_video_renderer.cc

Issue 291193008: Handle odd width and height in the MediaSource renderer. (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: remoting/client/plugin/media_source_video_renderer.cc
diff --git a/remoting/client/plugin/media_source_video_renderer.cc b/remoting/client/plugin/media_source_video_renderer.cc
index 5326754ac9ce88dcf95e95feb745446184c41ee7..817df11c7ac546fa31249e298d10b8b994254c1c 100644
--- a/remoting/client/plugin/media_source_video_renderer.cc
+++ b/remoting/client/plugin/media_source_video_renderer.cc
@@ -65,9 +65,25 @@ MediaSourceVideoRenderer::VideoWriter::VideoWriter(
.InMicroseconds() *
base::Time::kNanosecondsPerMicrosecond);
- segment_->AddVideoTrack(frame_size_.width(), frame_size_.height(), 1);
+ uint64 crop_right = 0;
+ int width = frame_size_.width();
+ if (width % 2 == 1) {
+ ++width;
+ crop_right = 1;
+ }
+
+ uint64 crop_bottom = 0;
+ int height = frame_size_.height();
+ if (height % 2 == 1) {
+ ++height;
+ crop_bottom = 1;
+ }
+
+ segment_->AddVideoTrack(width, height, 1);
mkvmuxer::VideoTrack* video_track =
reinterpret_cast<mkvmuxer::VideoTrack*>(segment_->GetTrackByNumber(1));
+ video_track->set_crop_right(crop_right);
+ video_track->set_crop_bottom(crop_bottom);
video_track->set_frame_rate(base::Time::kNanosecondsPerSecond /
kFrameIntervalNs);
video_track->set_default_duration(base::Time::kNanosecondsPerSecond);
« 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