DirectShow Programming 26
#############################
Video Source: www.youtube.com/watch?v=nC3TLHomnkg
In this lecture we finished the file playback example. We added code that creates a thread that waits on the graph windows event object until there are graph events for it to consume. • Here is some code: • HANDLE hEvent; • hr = pEventEx--GetEventHandle((OAEVENT*) hEvent); • ThrowIfError(hr); • BOOLEAN bDone = FALSE; • while(!bDone) • { • if (WAIT_OBJECT_0 == WaitForSingleObject(hEvent, INFINITE)) • { • long evCode, param1, param2; • while (S_OK == pEventEx--GetEvent( evCode, param1, param2, 0)) • { • printf(-Event code: %#04x\ • Params: %d, %d\ • -, evCode, param1, param2); • pEventEx--FreeEventParams(evCode, param1, param2); • bDone = (EC_COMPLETE == evCode); • } • } • }
#############################