mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1292374: P1. Add support for full hardware acceleration in VP9. r=jya
MozReview-Commit-ID: ENawyqrzVgH --HG-- extra : rebase_source : 53e6879b9f2841de5880778503bf20baada15583
This commit is contained in:
parent
b25fe68ce0
commit
5753f883ef
@ -12,8 +12,7 @@
|
|||||||
#include "mozilla/RefPtr.h"
|
#include "mozilla/RefPtr.h"
|
||||||
#include "WMFMediaDataDecoder.h"
|
#include "WMFMediaDataDecoder.h"
|
||||||
|
|
||||||
extern const GUID CLSID_WebmMfVp8Dec;
|
extern const GUID CLSID_WebmMfVpxDec;
|
||||||
extern const GUID CLSID_WebmMfVp9Dec;
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
@ -233,12 +233,9 @@ WMFDecoderModule::Supports(const TrackInfo& aTrackInfo,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (MediaPrefs::PDMWMFIntelDecoderEnabled() && sDXVAEnabled) {
|
if (MediaPrefs::PDMWMFIntelDecoderEnabled() && sDXVAEnabled) {
|
||||||
if (VPXDecoder::IsVP8(aTrackInfo.mMimeType) &&
|
if ((VPXDecoder::IsVP8(aTrackInfo.mMimeType) ||
|
||||||
CanCreateWMFDecoder<CLSID_WebmMfVp8Dec>()) {
|
VPXDecoder::IsVP9(aTrackInfo.mMimeType)) &&
|
||||||
return true;
|
CanCreateWMFDecoder<CLSID_WebmMfVpxDec>()) {
|
||||||
}
|
|
||||||
if (VPXDecoder::IsVP9(aTrackInfo.mMimeType) &&
|
|
||||||
CanCreateWMFDecoder<CLSID_WebmMfVp9Dec>()) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,20 +59,12 @@ const GUID MFVideoFormat_VP90 =
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const CLSID CLSID_WebmMfVp8Dec =
|
const CLSID CLSID_WebmMfVpxDec =
|
||||||
{
|
{
|
||||||
0x451e3cb7,
|
0xe3aaf548,
|
||||||
0x2622,
|
0xc9a4,
|
||||||
0x4ba5,
|
0x4c6e,
|
||||||
{0x8e, 0x1d, 0x44, 0xb3, 0xc4, 0x1d, 0x09, 0x24}
|
{ 0x23, 0x4d, 0x5a, 0xda, 0x37, 0x4b, 0x00, 0x00 }
|
||||||
};
|
|
||||||
|
|
||||||
const CLSID CLSID_WebmMfVp9Dec =
|
|
||||||
{
|
|
||||||
0x7ab4bd2,
|
|
||||||
0x1979,
|
|
||||||
0x4fcd,
|
|
||||||
{0xa6, 0x97, 0xdf, 0x9a, 0xd1, 0x5b, 0x34, 0xfe}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
@ -147,8 +139,8 @@ WMFVideoMFTManager::GetMFTGUID()
|
|||||||
MOZ_ASSERT(mStreamType != Unknown);
|
MOZ_ASSERT(mStreamType != Unknown);
|
||||||
switch (mStreamType) {
|
switch (mStreamType) {
|
||||||
case H264: return CLSID_CMSH264DecoderMFT;
|
case H264: return CLSID_CMSH264DecoderMFT;
|
||||||
case VP8: return CLSID_WebmMfVp8Dec;
|
case VP8: return CLSID_WebmMfVpxDec;
|
||||||
case VP9: return CLSID_WebmMfVp9Dec;
|
case VP9: return CLSID_WebmMfVpxDec;
|
||||||
default: return GUID_NULL;
|
default: return GUID_NULL;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -442,8 +434,7 @@ bool
|
|||||||
WMFVideoMFTManager::InitInternal(bool aForceD3D9)
|
WMFVideoMFTManager::InitInternal(bool aForceD3D9)
|
||||||
{
|
{
|
||||||
mUseHwAccel = false; // default value; changed if D3D setup succeeds.
|
mUseHwAccel = false; // default value; changed if D3D setup succeeds.
|
||||||
bool useDxva = InitializeDXVA(aForceD3D9 ||
|
bool useDxva = InitializeDXVA(aForceD3D9);
|
||||||
mStreamType == VP8 || mStreamType == VP9);
|
|
||||||
|
|
||||||
RefPtr<MFTDecoder> decoder(new MFTDecoder());
|
RefPtr<MFTDecoder> decoder(new MFTDecoder());
|
||||||
|
|
||||||
@ -488,6 +479,10 @@ WMFVideoMFTManager::InitInternal(bool aForceD3D9)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!mUseHwAccel) {
|
if (!mUseHwAccel) {
|
||||||
|
// Use VP8/9 MFT only if HW acceleration is available
|
||||||
|
if (mStreamType == VP9 || mStreamType == VP8) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Telemetry::Accumulate(Telemetry::MEDIA_DECODER_BACKEND_USED,
|
Telemetry::Accumulate(Telemetry::MEDIA_DECODER_BACKEND_USED,
|
||||||
uint32_t(media::MediaDecoderBackend::WMFSoftware));
|
uint32_t(media::MediaDecoderBackend::WMFSoftware));
|
||||||
}
|
}
|
||||||
@ -518,6 +513,15 @@ WMFVideoMFTManager::SetDecoderMediaTypes()
|
|||||||
hr = inputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_MixedInterlaceOrProgressive);
|
hr = inputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_MixedInterlaceOrProgressive);
|
||||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||||
|
|
||||||
|
// MSFT MFT needs this frame size set for VP9?
|
||||||
|
if (mStreamType == VP9 || mStreamType == VP8) {
|
||||||
|
hr = inputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive);
|
||||||
|
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||||
|
|
||||||
|
hr = MFSetAttributeSize(inputType, MF_MT_FRAME_SIZE, mVideoInfo.ImageRect().width, mVideoInfo.ImageRect().height);
|
||||||
|
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||||
|
}
|
||||||
|
|
||||||
RefPtr<IMFMediaType> outputType;
|
RefPtr<IMFMediaType> outputType;
|
||||||
hr = wmf::MFCreateMediaType(getter_AddRefs(outputType));
|
hr = wmf::MFCreateMediaType(getter_AddRefs(outputType));
|
||||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||||
|
Loading…
Reference in New Issue
Block a user