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

Unified Diff: source/libvpx/webmenc.cc

Issue 1169543007: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 6 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 | « source/libvpx/webmenc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/webmenc.cc
diff --git a/source/libvpx/webmenc.cc b/source/libvpx/webmenc.cc
index a0e542b17cfdd4bca8622ebc067d839e0270b3a5..8212ee36cf62c031509f6425257434e24a87f336 100644
--- a/source/libvpx/webmenc.cc
+++ b/source/libvpx/webmenc.cc
@@ -24,7 +24,8 @@ void write_webm_file_header(struct EbmlGlobal *glob,
const vpx_codec_enc_cfg_t *cfg,
const struct vpx_rational *fps,
stereo_format_t stereo_fmt,
- unsigned int fourcc) {
+ unsigned int fourcc,
+ const struct VpxRational *par) {
mkvmuxer::MkvWriter *const writer = new mkvmuxer::MkvWriter(glob->stream);
mkvmuxer::Segment *const segment = new mkvmuxer::Segment();
segment->Init(writer);
@@ -49,6 +50,15 @@ void write_webm_file_header(struct EbmlGlobal *glob,
segment->GetTrackByNumber(video_track_id));
video_track->SetStereoMode(stereo_fmt);
video_track->set_codec_id(fourcc == VP8_FOURCC ? "V_VP8" : "V_VP9");
+ if (par->numerator > 1 || par->denominator > 1) {
+ // TODO(fgalligan): Add support of DisplayUnit, Display Aspect Ratio type
+ // to WebM format.
+ const uint64_t display_width =
+ static_cast<uint64_t>(((cfg->g_w * par->numerator * 1.0) /
+ par->denominator) + .5);
+ video_track->set_display_width(display_width);
+ video_track->set_display_height(cfg->g_h);
+ }
if (glob->debug) {
video_track->set_uid(kDebugTrackUid);
}
« no previous file with comments | « source/libvpx/webmenc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698