From 3d1bb97b1b8018c6ba3524473fa4f99032f35397 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Fri, 14 Aug 2015 12:30:10 -0700 Subject: [PATCH] write correct codecID for vp10 webm file Change-Id: Ifeb6073c4a687a73540a0f8aef0d834f4712c193 --- third_party/libwebm/mkvmuxer.cpp | 1 + third_party/libwebm/mkvmuxer.hpp | 1 + webmdec.cc | 2 ++ webmenc.cc | 17 ++++++++++++++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/third_party/libwebm/mkvmuxer.cpp b/third_party/libwebm/mkvmuxer.cpp index fe7eb2f..9be3119 100644 --- a/third_party/libwebm/mkvmuxer.cpp +++ b/third_party/libwebm/mkvmuxer.cpp @@ -1045,6 +1045,7 @@ const char Tracks::kOpusCodecId[] = "A_OPUS"; const char Tracks::kVorbisCodecId[] = "A_VORBIS"; const char Tracks::kVp8CodecId[] = "V_VP8"; const char Tracks::kVp9CodecId[] = "V_VP9"; +const char Tracks::kVp10CodecId[] = "V_VP10"; Tracks::Tracks() : track_entries_(NULL), track_entries_size_(0) {} diff --git a/third_party/libwebm/mkvmuxer.hpp b/third_party/libwebm/mkvmuxer.hpp index ecd8a74..497ad4c 100644 --- a/third_party/libwebm/mkvmuxer.hpp +++ b/third_party/libwebm/mkvmuxer.hpp @@ -533,6 +533,7 @@ class Tracks { static const char kVorbisCodecId[]; static const char kVp8CodecId[]; static const char kVp9CodecId[]; + static const char kVp10CodecId[]; Tracks(); ~Tracks(); diff --git a/webmdec.cc b/webmdec.cc index e152f5e..1020d04 100644 --- a/webmdec.cc +++ b/webmdec.cc @@ -103,6 +103,8 @@ int file_is_webm(struct WebmInputContext *webm_ctx, vpx_ctx->fourcc = VP8_FOURCC; } else if (!strncmp(video_track->GetCodecId(), "V_VP9", 5)) { vpx_ctx->fourcc = VP9_FOURCC; + } else if (!strncmp(video_track->GetCodecId(), "V_VP10", 6)) { + vpx_ctx->fourcc = VP10_FOURCC; } else { rewind_and_reset(webm_ctx, vpx_ctx); return 0; diff --git a/webmenc.cc b/webmenc.cc index 8212ee3..d41e700 100644 --- a/webmenc.cc +++ b/webmenc.cc @@ -49,7 +49,22 @@ void write_webm_file_header(struct EbmlGlobal *glob, static_cast( segment->GetTrackByNumber(video_track_id)); video_track->SetStereoMode(stereo_fmt); - video_track->set_codec_id(fourcc == VP8_FOURCC ? "V_VP8" : "V_VP9"); + const char *codec_id; + switch (fourcc) { + case VP8_FOURCC: + codec_id = "V_VP8"; + break; + case VP9_FOURCC: + codec_id = "V_VP9"; + break; + case VP10_FOURCC: + codec_id = "V_VP10"; + break; + default: + codec_id = "V_VP10"; + break; + } + video_track->set_codec_id(codec_id); if (par->numerator > 1 || par->denominator > 1) { // TODO(fgalligan): Add support of DisplayUnit, Display Aspect Ratio type // to WebM format. -- 2.7.4