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

Unified Diff: media/base/mime_util_internal.cc

Issue 2758873003: New media/base/decode_capabilities.h|cc (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « media/base/media_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/mime_util_internal.cc
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc
index d2ff7a150e3c55a4030083472a11915307fb34c8..db4f10b97cedcb8392e48a6731cd585e9f0424e9 100644
--- a/media/base/mime_util_internal.cc
+++ b/media/base/mime_util_internal.cc
@@ -710,15 +710,24 @@ SupportsType MimeUtil::IsCodecSupported(const std::string& mime_type_lower_case,
ambiguous_platform_support = true;
}
- if (GetMediaClient() && video_codec != kUnknownVideoCodec &&
- !GetMediaClient()->IsSupportedVideoConfig(
- {video_codec, video_profile, video_level, color_space})) {
- return IsNotSupported;
+ if (video_codec != kUnknownVideoCodec) {
+ VideoConfig video_config = {video_codec, video_profile, video_level,
+ color_space};
+
+ // If MediaClient is provided use it to check for decoder support.
+ MediaClient* media_client = GetMediaClient();
+ if (media_client && !media_client->IsSupportedVideoConfig(video_config))
+ return IsNotSupported;
+
+ // When no MediaClient is provided, assume default decoders are available
+ // as described by media::IsSupportedVideoConfig().
+ if (!media_client && !IsSupportedVideoConfig(video_config))
+ return IsNotSupported;
}
#if defined(OS_ANDROID)
// TODO(chcunningham): Delete this. Android platform support should be
- // handled by (android specific) MediaClient.
+ // handled by (android specific) media::IsSupportedVideoConfig() above.
if (!IsCodecSupportedOnAndroid(codec, mime_type_lower_case, is_encrypted,
platform_info_)) {
return IsNotSupported;
« no previous file with comments | « media/base/media_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698