Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ramashankar
New Contributor III
60 Views

Issue in detecting D3D11 supports programmatically

Hi,

I am having a test machine which has Windows 8.1 OS and Intel(R) HD Graphics 4400 card (driver version 10.18.14.4170). This machine supports D3D11. I confirmed it by running sample_decode application also using -d3d11 option and output was fine.

But if I check the Decoder capability using MFXQueryIMPL(), then it is suggesting only MFX_IMPL_VIA_D3D9. I was assuming that this API should suggest MFX_IMPL_VIA_D3D11.

Basically, my requirement is to first check the decoding capability on system (whether HW decoding supported or not, and whether using D3D11 memory or D3D9 memory) and then initialize the decoder accordingly. I have written a function which looks like as following:

mfxStatus CheckDecoderCapability(bool& bIsHWDecodingSupported, MemType& MemoryType)
{
	mfxSession session;
	mfxIMPL impl;
	mfxVersion version;
	mfxStatus sts = MFX_ERR_NONE;

	// set for auto selection of any hardware/software implementation using any memory
	impl = MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_ANY;

	// set version to 1.0 and later we will query actual version of the library which will get loaded
	version.Major = 1;
	version.Minor = 0;

	// initialize the session
	sts = MFXInit(impl, &version, &session);
	CHECK_RESULT(sts, MFX_ERR_NONE, sts);

	// get API version of the loaded library
	sts = MFXQueryVersion(session, &version);
	CHECK_RESULT(sts, MFX_ERR_NONE, sts);

	// get implementation of the loaded library
	sts = MFXQueryIMPL(session, &impl);
	CHECK_RESULT(sts, MFX_ERR_NONE, sts);

	if (MFX_IMPL_HARDWARE == MFX_IMPL_BASETYPE(impl))
		bIsHWDecodingSupported = true;
	else
		bIsHWDecodingSupported = false;

	if ((0xff00 & impl) == MFX_IMPL_VIA_D3D11)
		MemoryType = D3D11_MEMORY;
	else if ((0xff00 & impl) == MFX_IMPL_VIA_D3D9)
		MemoryType = D3D9_MEMORY;
	else
		MemoryType = SYSTEM_MEMORY;

	sts = MFXClose(session);
	CHECK_RESULT(sts, MFX_ERR_NONE, sts);
	return MFX_ERR_NONE;
}

So my questions is:

1. In this test machine, why MFXQueryIMPL() is unable to detect support of D3D11? I am attaching analyzer log also for this test machine.

2. Is there any other way through which i can detect whether my environment is supporting D3D11 or not?

Thanks

 

0 Kudos
5 Replies
Surbhi_M_Intel
Employee
60 Views

Hi Ramashankar, 

I am able to reproduce the behavior you are seeing, will get back to you soon on this with explanation.

Thanks,
Surbhi 

 

Ramashankar
New Contributor III
60 Views

Hi Surabhi,

Thanks for the confirmation. Good to know that you are able to reproduce this issue. Will wait for your reply/solution.

Thanks

Surbhi_M_Intel
Employee
60 Views

Hi again, 

The reason why it is not looking for d3d9 implementation is by default it looks for d3d9 implementation first and if it find it is supported then it uses that. If not, then check the support for d3d11. The reason of doing so is to maintain the backward compatibility. 
However I am speaking to engineering team regarding if this could be changed to check for d3d11->d3d9 and then fall back to sw implementation so that it supports the highest implementation possible. Will keep you posted on this. 

Thanks,
Surbhi

Ramashankar
New Contributor III
60 Views

Hi Surbhi,

Thanks for the explanation, I got your point. So probably Intel may modify it in some next release of Media SDK. 

But in the meantime, is there any other approach or other API through which I can directly check the d3d11 support in the system (assuming that MFXQueryIMPL() can not be used now for this, as you explained the reason above)?

Thanks

 

Surbhi_M_Intel
Employee
60 Views

Yes, if it changes it will come in future releases. The one way we can find the capability is probably by initializing the implementation to be d3d11 instead to use AUTO_ANY and call MFXVideoDecodeQuery() function. This function return MFX_ERR_UNSUPPORTED if it fails to identify the implementation. Please refer to Pg 60 of the Media SDK Manual to find more details on the decode query function. 

Thanks,
Surbhi

Reply