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

Unified Diff: media/base/video_codecs.cc

Issue 2226443002: Support multiple media tracks in MSE / ChunkDemuxer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mp4 format is not supported on some trybots, so use webm Created 4 years, 3 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: media/base/video_codecs.cc
diff --git a/media/base/video_codecs.cc b/media/base/video_codecs.cc
index 13afa406b4781455b4c33d2a08d0ccf7580f19a7..adfc5d1a27255fc6c57ffd30b318220292fe8b80 100644
--- a/media/base/video_codecs.cc
+++ b/media/base/video_codecs.cc
@@ -285,4 +285,26 @@ bool ParseHEVCCodecId(const std::string& codec_id,
}
#endif
+VideoCodec StringToVideoCodec(const std::string& codec_id) {
+ std::vector<std::string> elem = base::SplitString(
+ codec_id, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ if (elem.empty())
+ return kUnknownVideoCodec;
+ VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
+ uint8_t level = 0;
+ if (ParseAVCCodecId(codec_id, &profile, &level))
+ return kCodecH264;
+ if (codec_id == "vp8" || codec_id == "vp8.0")
+ return kCodecVP8;
+ if (codec_id == "vp9" || codec_id == "vp9.0")
+ return kCodecVP9;
+ if (codec_id == "theora")
+ return kCodecTheora;
+#if BUILDFLAG(ENABLE_HEVC_DEMUXING)
+ if (ParseHEVCCodecId(codec_id, &profile, &level))
+ return kCodecHEVC;
+#endif
+ return kUnknownVideoCodec;
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698