Re: Capture Graph with VMR9 in Windowless mode



On Mar 24, 7:40 am, Colin White <c...@xxxxxxxxxxxxxxxxxxxx> wrote:
On 23 Mar 2007 15:06:52 -0700, "Andrew" <4br...@xxxxxxxxx> wrote:>> Use CancelDefaultHandling onEC_DISPLAY_CHANGED, added an handler in
my app, detach the currently open file, then unbuild and re-build the
graph and re-start capturing.

Thanks for posting your workaround. I've also seen this problem in my
application and after implementing your suggestion the
EC_DISPLAY_CHANGEDmessage is posted again right after I re-start.
It's like the event wasn't cleared or something even though the entire
graph was unloaded and reloaded.

Has anyone else seen this behavior?

Andy

Andy
Are you certain that you've full emptied the queue and freed up all
resources (FreeEventParams) before returning TRUE in your event
handler?

(see the topics Event Notification in Directshow and subtopic
Retrieving Events)
Colin

Colin,

I belive I am. I wonder if there is an order of operations error. In
my message handler I call a function that does the graph tear down,
rebuild, and restart before the FreeEventParams is called. Is my
while loop what you're talking about when you say "emptied the
queue"?

Andy

LRESULT CDVRView::OnGraphNotify(WPARAM, LPARAM)
{
long evCode, param1, param2;
HRESULT hr;

while (hr = m_pMediaEvent->GetEvent(&evCode, &param1, &param2, 0),
SUCCEEDED(hr))
{
switch(evCode)
{
case EC_DISPLAY_CHANGED:
HandleDisplayChangedMessage();
break;

default:
break;
}
hr = m_pMediaEvent->FreeEventParams(evCode, param1, param2);
}

return TRUE;
}






.



Relevant Pages

  • Re: Capture Graph with VMR9 in Windowless mode
    ... graph and re-start capturing. ... Thanks for posting your workaround. ... graph was unloaded and reloaded. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Capture Graph with VMR9 in Windowless mode
    ... renderer is stopped -- but you would have the mux and file writer in a ... separate graph which is therefore not stopped. ... graph and re-start capturing. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Events dont work using C# & SetNotifyWindow
    ... The class that creates the DS graph already inherits from CWnd. ... that window are processed when appear (in the same class that creates the ... are in separate threads and messages are treated in the same c++ class that ... Are you saying that the WM_GRAPHNOTIFY message handler is not called until ...
    (microsoft.public.win32.programmer.directx.video)

Loading