Bug 1330284 - Use MediaContentType in DecoderTraits:IsAndroidMediaType() - r?jya
MozReview-Commit-ID: 6gK5FqMDypq
--- a/dom/media/DecoderTraits.cpp
+++ b/dom/media/DecoderTraits.cpp
@@ -75,26 +75,26 @@ static char const *const gHttpLiveStream
static bool
IsHttpLiveStreamingType(const nsACString& aType)
{
return CodecListContains(gHttpLiveStreamingTypes, aType);
}
#ifdef MOZ_ANDROID_OMX
static bool
-IsAndroidMediaType(const nsACString& aType)
+IsAndroidMediaType(const MediaContentType& aType)
{
if (!MediaDecoder::IsAndroidMediaPluginEnabled()) {
return false;
}
- static const char* supportedTypes[] = {
- "audio/mpeg", "audio/mp4", "video/mp4", "video/x-m4v", nullptr
- };
- return CodecListContains(supportedTypes, aType);
+ return aType.Type() == MEDIAMIMETYPE("audio/mpeg")
+ || aType.Type() == MEDIAMIMETYPE("audio/mp4")
+ || aType.Type() == MEDIAMIMETYPE("video/mp4")
+ || aType.Type() == MEDIAMIMETYPE("video/x-m4v");
}
#endif
/* static */ bool
DecoderTraits::IsMP4SupportedType(const MediaContentType& aType,
DecoderDoctorDiagnostics* aDiagnostics)
{
#ifdef MOZ_FMP4
@@ -450,17 +450,17 @@ bool DecoderTraits::IsSupportedInVideoDo
if (!type) {
return false;
}
return
OggDecoder::IsSupportedType(*type) ||
WebMDecoder::IsSupportedType(*type) ||
#ifdef MOZ_ANDROID_OMX
- (MediaDecoder::IsAndroidMediaPluginEnabled() && IsAndroidMediaType(aType)) ||
+ (MediaDecoder::IsAndroidMediaPluginEnabled() && IsAndroidMediaType(*type)) ||
#endif
#ifdef MOZ_FMP4
MP4Decoder::IsSupportedType(*type, /* DecoderDoctorDiagnostics* */ nullptr) ||
#endif
MP3Decoder::IsSupportedType(*type) ||
ADTSDecoder::IsSupportedType(*type) ||
FlacDecoder::IsSupportedType(*type) ||
#ifdef MOZ_DIRECTSHOW