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

Unified Diff: media/base/mime_util_internal.cc

Issue 1837963004: Make CanPlayType return "probably" for HI10P h264 videos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: media/base/mime_util_internal.cc
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc
index e9b38f1191801c55e0e7d4e7092cfaf7a1c92140..1a2937ecebc3f260cbc42129c0369b032dc4bc6a 100644
--- a/media/base/mime_util_internal.cc
+++ b/media/base/mime_util_internal.cc
@@ -283,7 +283,7 @@ SupportsType MimeUtil::AreSupportedCodecs(
for (size_t i = 0; i < codecs.size(); ++i) {
bool is_ambiguous = true;
Codec codec = INVALID_CODEC;
- if (!StringToCodec(codecs[i], &codec, &is_ambiguous))
+ if (!StringToCodec(codecs[i], &codec, &is_ambiguous, is_encrypted))
return IsNotSupported;
if (!IsCodecSupported(codec, mime_type_lower_case, is_encrypted) ||
@@ -324,7 +324,7 @@ void MimeUtil::InitializeMimeTypeMaps() {
for (size_t j = 0; j < mime_type_codecs.size(); ++j) {
Codec codec = INVALID_CODEC;
bool is_ambiguous = true;
- CHECK(StringToCodec(mime_type_codecs[j], &codec, &is_ambiguous));
+ CHECK(StringToCodec(mime_type_codecs[j], &codec, &is_ambiguous, false));
DCHECK(!is_ambiguous);
codecs.insert(codec);
}
@@ -533,7 +533,8 @@ bool MimeUtil::IsCodecSupportedOnPlatform(
bool MimeUtil::StringToCodec(const std::string& codec_id,
Codec* codec,
- bool* is_ambiguous) const {
+ bool* is_ambiguous,
+ bool is_encrypted) const {
StringToCodecMappings::const_iterator itr =
string_to_codec_map_.find(codec_id);
if (itr != string_to_codec_map_.end()) {
@@ -556,10 +557,26 @@ bool MimeUtil::StringToCodec(const std::string& codec_id,
uint8_t level_idc = 0;
if (ParseAVCCodecId(codec_id, &profile, &level_idc)) {
*codec = MimeUtil::H264;
- *is_ambiguous =
- (profile != H264PROFILE_BASELINE && profile != H264PROFILE_MAIN &&
- profile != H264PROFILE_HIGH) ||
- !IsValidH264Level(level_idc);
+ switch (profile) {
+ case H264PROFILE_BASELINE:
+ case H264PROFILE_MAIN:
+ case H264PROFILE_HIGH:
+#if !defined(OS_ANDROID)
ddorwin 2016/03/31 05:58:44 This means that Chromecast (and other platforms th
hubbe 2016/03/31 21:53:48 Hmm, after reading a bunch of config files, I *thi
+ // HIGH10PROFILE is supported through fallback to
+ // ffmpeg decoder, which is not available on android.
+ case H264PROFILE_HIGH10PROFILE:
+ if (is_encrypted) {
ddorwin 2016/03/31 05:44:05 All of the above profiles fall through to here. Th
hubbe 2016/03/31 21:53:48 Oops, fixed.
+ // Currently we do not support EME on 10-bit videos.
ddorwin 2016/03/31 05:44:05 Should we return false instead?
hubbe 2016/03/31 21:53:48 We don't do that for any of the other profiles we
+ *is_ambiguous = true;
+ break;
+ }
+#endif
+
+ *is_ambiguous = !IsValidH264Level(level_idc);
+ break;
+ default:
+ *is_ambiguous = true;
+ }
return true;
}
« content/browser/media/media_canplaytype_browsertest.cc ('K') | « media/base/mime_util_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698