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

Unified Diff: media/muxers/webm_muxer.cc

Issue 2750233003: Change segment width dynamically in MediaRecorder
Patch Set: 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 | « media/muxers/webm_muxer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/muxers/webm_muxer.cc
diff --git a/media/muxers/webm_muxer.cc b/media/muxers/webm_muxer.cc
index 5b98472f875a5f536b9369f7e38fc626f4a6732d..43c0fbf8bc37aab56ce09c5721ce276e455defe9 100644
--- a/media/muxers/webm_muxer.cc
+++ b/media/muxers/webm_muxer.cc
@@ -140,6 +140,17 @@ bool WebmMuxer::OnEncodedVideo(const VideoParameters& params,
DVLOG(1) << __func__ << " - " << encoded_data->size() << "B";
DCHECK(thread_checker_.CalledOnValidThread());
+ if (!last_frame_size_.IsEmpty() &&
+ last_frame_size_ != params.visible_rect_size) {
+ mkvmuxer::VideoTrack* const video_track =
+ reinterpret_cast<mkvmuxer::VideoTrack*>(
+ segment_.GetTrackByNumber(video_track_index_));
+ DCHECK(video_track);
+ video_track->set_width(params.visible_rect_size.width());
+ video_track->set_height(params.visible_rect_size.height());
+ }
+ last_frame_size_ = params.visible_rect_size;
+
if (!video_track_index_) {
// |track_index_|, cannot be zero (!), initialize WebmMuxer in that case.
// http://www.matroska.org/technical/specs/index.html#Tracks
« no previous file with comments | « media/muxers/webm_muxer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698