Bug 1328038: Refuse to play High 4:4:4 Predictive Profile. r=jamescheng
It is not supported by Windows WMF.
MozReview-Commit-ID: 2OyjC0qGwD4
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -124,22 +124,25 @@ public:
AddToCheckList(
[mimeType, extraData]() {
if (MP4Decoder::IsH264(mimeType)) {
mp4_demuxer::SPSData spsdata;
// WMF H.264 Video Decoder and Apple ATDecoder
// do not support YUV444 format.
// For consistency, all decoders should be checked.
if (mp4_demuxer::H264::DecodeSPSFromExtraData(extraData, spsdata) &&
- spsdata.chroma_format_idc == PDMFactory::kYUV444) {
- return CheckResult(SupportChecker::Reason::kVideoFormatNotSupported,
- MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
- RESULT_DETAIL("Decoder may not have the capability to handle"
- " the requested video format"
- " with YUV444 chroma subsampling.")));
+ (spsdata.profile_idc == 244 /* Hi444PP */ ||
+ spsdata.chroma_format_idc == PDMFactory::kYUV444)) {
+ return CheckResult(
+ SupportChecker::Reason::kVideoFormatNotSupported,
+ MediaResult(
+ NS_ERROR_DOM_MEDIA_FATAL_ERR,
+ RESULT_DETAIL("Decoder may not have the capability to handle"
+ " the requested video format"
+ " with YUV444 chroma subsampling.")));
}
}
return CheckResult(SupportChecker::Reason::kSupported);
});
}
}
SupportChecker::CheckResult
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -176,17 +176,18 @@ H264Converter::CreateDecoder(DecoderDoct
return NS_ERROR_NOT_INITIALIZED;
}
UpdateConfigFromExtraData(mCurrentConfig.mExtraData);
mp4_demuxer::SPSData spsdata;
if (mp4_demuxer::H264::DecodeSPSFromExtraData(mCurrentConfig.mExtraData, spsdata)) {
// Do some format check here.
// WMF H.264 Video Decoder and Apple ATDecoder do not support YUV444 format.
- if (spsdata.chroma_format_idc == 3 /*YUV444*/) {
+ if (spsdata.profile_idc == 244 /* Hi444PP */ ||
+ spsdata.chroma_format_idc == PDMFactory::kYUV444) {
mLastError = NS_ERROR_FAILURE;
if (aDiagnostics) {
aDiagnostics->SetVideoNotSupported();
}
return NS_ERROR_FAILURE;
}
} else {
// SPS was invalid.