Bug 1679356 - P2. Ignore HW accelerated flag when using the Apple's VT decoder. r=jolin

On Apple Silicon, the flag kVTDecompressionPropertyKey_UsingHardwareAcceleratedVideoDecoder always returns false; even thoough we can really tell it's hardware accelerated by the CPU usage percentage (from 130% to 6% when playing 4K VP9).

So we ignore that flag for now, and just rely on VTIsHardwareDecodeSupported to return true.

Depends on D97983

Differential Revision: https://phabricator.services.mozilla.com/D97984
This commit is contained in:
Jean-Yves Avenard 2020-12-01 00:43:38 +00:00
Родитель 53f8a78ca2
Коммит 538e6ec758
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -139,18 +139,17 @@ bool AppleDecoderModule::CanCreateVP9Decoder() {
return false;
}
// Check that we can instantiate a VP9 decoder.
VideoInfo info(1920, 1080);
info.mMimeType = "video/vp9";
VPXDecoder::GetVPCCBox(info.mExtraData, VPXDecoder::VPXStreamInfo());
RefPtr<AppleVTDecoder> decoder =
new AppleVTDecoder(info, nullptr, {}, nullptr);
nsAutoCString reason;
MediaResult rv = decoder->InitializeSession();
bool isHardwareAccelerated = decoder->IsHardwareAccelerated(reason);
decoder->Shutdown();
return NS_SUCCEEDED(rv) && isHardwareAccelerated;
return NS_SUCCEEDED(rv);
}
return false;