Issue #1820 - Part 8: Check bit depth in PDM::Supports.

This commit is contained in:
Moonchild 2022-04-27 16:08:36 +00:00 committed by roytam1
commit 009fb3146f
3 changed files with 38 additions and 4 deletions

View file

@ -205,6 +205,14 @@ bool
WMFDecoderModule::Supports(const TrackInfo& aTrackInfo,
DecoderDoctorDiagnostics* aDiagnostics) const
{
// Check bit depth of video.
// XXXMC: This is here in case we want to start accepting HDR video. Do we?
// This currently defaults to a fail if video bitdepth != 8
const auto videoInfo = aTrackInfo.GetAsVideoInfo();
if (videoInfo && !SupportsBitDepth(videoInfo->mBitDepth, aDiagnostics)) {
return false;
}
if ((aTrackInfo.mMimeType.EqualsLiteral("audio/mp4a-latm") ||
aTrackInfo.mMimeType.EqualsLiteral("audio/mp4")) &&
WMFDecoderModule::HasAAC()) {
@ -221,7 +229,7 @@ WMFDecoderModule::Supports(const TrackInfo& aTrackInfo,
return false;
}
} else {
// Windows <=7 supports at most 1920x1088.
// Windows 7 supports at most 1920x1088.
if (videoInfo->mImage.width > 1920 || videoInfo->mImage.height > 1088) {
return false;
}