DirectShow not showing mp4 & WndProc Not working
-
Hello. I am trying to play video file using DirectShow found on this MSDN reference. I am facing two problems. 1- local H264 video doesn't get rendered properly. A frame shows and them some blocks keep showing. 2- Can not get notifications on my dialog window using WndProc. Using this sample. I am using following code for getting events.
void CDShowPlayerSampleDlg::OnStartPlay()
{
CPlayer::m_hWndPlayerDlg = this->m_hWnd; // MainDlg->m_hWnd
BOOL bResult = m_objPlayer.StartPlay(); // CPlayer m_objPlayer;
}LRESULT CDShowPlayerSampleDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(wParam) // lParam or wParam ?????????
{
case WM_GRAPHNOTIFY:
}
/* rest of the code here*/
}Now I am setting the event notifications on the IGraphBuilder like this (in CPlayer).
HRESULT hResult = m\_pGraphBuilder->QueryInterface(IID\_IMediaEventEx, (void\*\*)&m\_pEvent); hResult = m\_pEvent->SetNotifyWindow((OAHWND)m\_hWndPlayerDlg, WM\_GRAPHNOTIFY, 0);
1- So why can not I get notifications in CDShowPlayerSampleDlg::WindowProc? 2- And why is that Windows Media Video (.wmv) file plays correctly but H264 does not. What could I do for smooth H264 playback? Thanks for any pointers.
This world is going to explode due to international politics, SOON.
-
Hello. I am trying to play video file using DirectShow found on this MSDN reference. I am facing two problems. 1- local H264 video doesn't get rendered properly. A frame shows and them some blocks keep showing. 2- Can not get notifications on my dialog window using WndProc. Using this sample. I am using following code for getting events.
void CDShowPlayerSampleDlg::OnStartPlay()
{
CPlayer::m_hWndPlayerDlg = this->m_hWnd; // MainDlg->m_hWnd
BOOL bResult = m_objPlayer.StartPlay(); // CPlayer m_objPlayer;
}LRESULT CDShowPlayerSampleDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(wParam) // lParam or wParam ?????????
{
case WM_GRAPHNOTIFY:
}
/* rest of the code here*/
}Now I am setting the event notifications on the IGraphBuilder like this (in CPlayer).
HRESULT hResult = m\_pGraphBuilder->QueryInterface(IID\_IMediaEventEx, (void\*\*)&m\_pEvent); hResult = m\_pEvent->SetNotifyWindow((OAHWND)m\_hWndPlayerDlg, WM\_GRAPHNOTIFY, 0);
1- So why can not I get notifications in CDShowPlayerSampleDlg::WindowProc? 2- And why is that Windows Media Video (.wmv) file plays correctly but H264 does not. What could I do for smooth H264 playback? Thanks for any pointers.
This world is going to explode due to international politics, SOON.
-
switch(wParam) // will never work, the wParam and lParam variables hold other data
// you need to check the message number like:
switch(message)Yes. it solved my problem. On a different note, as you can see in my code
OnStartPlay()
, I am storing my MainDlg's HWND in the CPlayer. What if I don't have a window and I still want to process these kind of messages from CPlayer? ThanksThis world is going to explode due to international politics, SOON.
-
Yes. it solved my problem. On a different note, as you can see in my code
OnStartPlay()
, I am storing my MainDlg's HWND in the CPlayer. What if I don't have a window and I still want to process these kind of messages from CPlayer? ThanksThis world is going to explode due to international politics, SOON.