Sample_decvpp, run H264 decoding, set the display Window's Handle: m_hwdev->Init (HWND...), when the display HWND size is FullScreen(
GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), in the running process ,I change the HWND size is 320*240, the video display normal.
If when the initial HWND size is very small (320*240), then i large the HWND size FullScreen, so video quality is very poor. It seem the video was Stretched into FullScreen by windows api StretchBlt, actually decoded size is 1080p.
I try to reset m_hwdev when find the size of HWND change. such as:
But no effect ,because the Reset() function return MFX_ERR_UNDEFINED_BEHAVIOR:
hr = m_pD3DD9->ResetEx(&d3dpp, NULL);
How can I solve the problem of dynamic change of windows size, without affecting the quality of video display?
The main reason for call to ResetEx to fail is this (from MSDN): "A call to IDirect3DDevice9Ex::ResetEx will fail if called on a different thread than that used to create the device being reset". So if this guess is correct you need to modify your code in such a way that a call to ResetEx would occur in the thread where you create IDirect3dDevice9Ex.
m_hwdev->SetHandle((mfxHandleType)MFX_HANDLE_DEVICEWINDOW, m_Hwnd) - this line is unnecessary
Thank you very much!
Another question: Use soft decoder, MFXVideoSession init is error .
// we set version to 1.0 and later we will query actual version of the library which will got leaded
min_version.Major = 1;
min_version.Minor = 0;
sts = m_mfxSession.Init(MFX_IMPL_SOFTWARE, &min_version);
the value of sts is MFX_ERR_UNSUPPORTED.
But It's good to run on some machines, why?
I think that there could be 2 possible reasons.
1. Unsupported hardware.
2. Out of date drivers.
If none of this is your case then only Intel guys can answer your question, wait for them.
Mihail P., Thank you for your answer,
I think drivers and hardware problems are related MFX_IMPL_HARDWARE_ANY.
It may be missing some of the Intel DLL library files, because the installation of INDE development environment can work well, and not installation of INDE environment does not work.
You might be right it could be an installation issue or environment not set properly. One way you can find out is to use the tracer tool present @ <installaed folder>\software development kit\tools. It captures Media SDK API calls. Check if you initiate are able to initiate a session using hw implementation. Also, if you can send us the system analyzer logs( tool present at same directory) and tracer logs we might be able to figure out your problem.