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

Unified Diff: media/base/mime_util_internal.cc

Issue 2153643002: Make video codec support logic overridable via MediaClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 5 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 5bd7c7f0bbeb1aed0b73d603815fad4aa8aa6f65..93f2a790bb4a9078e4f696a9e57282dbf5b40396 100644
--- a/media/base/mime_util_internal.cc
+++ b/media/base/mime_util_internal.cc
@@ -10,6 +10,7 @@
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "media/base/media.h"
+#include "media/base/media_client.h"
#include "media/base/media_switches.h"
#include "media/base/video_codecs.h"
@@ -678,6 +679,10 @@ bool MimeUtil::StringToCodec(const std::string& mime_type_lower_case,
default:
*is_ambiguous = true;
}
+ if (GetMediaClient()) {
+ return GetMediaClient()->IsSupportedVideoConfig(kCodecH264, profile,
chcunningham 2016/07/22 00:54:41 This method is called StringToCodec, and its heade
ddorwin 2016/07/22 02:06:37 Agreed about the naming. There are other issues, s
servolk 2016/07/22 02:26:09 David, do you mean MSE's IsTypeSupported? It actua
servolk 2016/07/22 02:26:09 I agree with this, but actually performing that is
servolk 2016/07/22 03:06:28 Done in patchset #4
+ level_idc);
+ }
return true;
}
@@ -694,17 +699,23 @@ bool MimeUtil::StringToCodec(const std::string& mime_type_lower_case,
// (crbug/604566).
*is_ambiguous = true;
}
+ if (GetMediaClient()) {
+ // TODO(servolk): Add VP9 level info when it becomes available in VP9
+ // codec ids.
+ return GetMediaClient()->IsSupportedVideoConfig(kCodecVP9, profile, 1);
+ }
return true;
}
#if BUILDFLAG(ENABLE_HEVC_DEMUXING)
if (ParseHEVCCodecId(codec_id, &profile, &level_idc)) {
- // TODO(servolk): Set |is_ambiguous| to true for now to make CanPlayType
- // return 'maybe' for HEVC codec ids, instead of probably. This needs to be
- // changed to false after adding platform-level HEVC profile and level
- // checks, see crbug.com/601949.
- *is_ambiguous = true;
*codec = MimeUtil::HEVC;
+ if (GetMediaClient()) {
+ *is_ambiguous = false;
+ return GetMediaClient()->IsSupportedVideoConfig(kCodecHEVC, profile,
+ level_idc);
+ }
+ *is_ambiguous = true;
return true;
}
#endif
« content/browser/media/media_canplaytype_browsertest.cc ('K') | « media/base/media_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698