I have registered the mfx_mft_h264vd_32.dll to my computer.
By using TopoEdit, I add the Intel Media SDK H.264 Decoder MFT to playback the .mp4(H264 internal). The problem will appear if you do as follows:
1. Click the play button on the TopoEdit. It can succeed to playback;
2. Click the stop button on the TopoEdit or close the playback window;
3. Click the play button on the TopoEdit again. It cannot playback.
According to my trace information, I find that when stop the session, the MFT(MFPluginVDec::ProcessMessage(...)) will send the MFT_MESSAGE_COMMAND_FLUSH and MFT_MESSAGE_NOTIFY_END_STREAMING messge.
I have write a MFT that make the video to gray, the trace information show that when stop the session, the MFT(ProcessMessage(...)) will send the MFT_MESSAGE_COMMAND_FLUSH message twice without MFT_MESSAGE_NOTIFY_END_STREAMING messge. And it can succeed to preview again and again.
The problem is also appeared when the computer resumed from hibernate(S4), that is, the playback or preview will stop and not play again only if restart the TopoEdit.
Beg the help from somebody!
The SDK I used is Media SDK 2012 R3.
I did not modify the source code except adding same trace information
The mftrace information is as follows.
Petter Larsson (Intel) wrote:
Can you please tell us what version of Media SDK you are using?
Are you using the default MFT sample or have made modifications to it?
If you can, please also provide mftrace log and Media SDK trace log.
sorry for the delayed answer. We are studying the MFT sample code to see if there is something that can be done to resolve the issue. We will provide an update shortly.
I have resolve the stop to play bug.
When stop the media session, the decoder receive the message as follows:
And then play the media session. The decoder receive the message MFT_MEDDAGE_NOTIFY_START_OF_STREAM(set somep parameters)
I change the code as follows:
HRESULT MFPluginVDec::ProcessMessage(MFT_MESSAGE_TYPE eMessage,
if (MFX_ERR_NONE != ResetCodec(lock)) hr = hr;//E_FAIL;
m_bNotifyStartOfStream = false;
m_NeedInputEventInfo.m_requested = 0;
SAFE_NEW(m_pAsyncThread, MyThread(hr, thAsyncThreadFunc, this));
if (SUCCEEDED(hr) && !m_pAsyncThread) hr = E_FAIL;
// else if (MFX_ERR_NONE != ResetCodec(lock)) hr = E_FAIL;
m_bStreamingStarted = true;
m_bDoNotRequestInput = false;
m_bNotifyStartOfStream = true;
if (SUCCEEDED(hr)) hr = RequestInput();
When stop to play, it can suceed to preview again.