Video capturing
-
I have a problem with video capturing. When I call create function everything goes fine, it means capDriver is loaded succesfully, setting callback function goes fine.... . What i see on the cap window is just the first image which has been grabed. The problem is that the call back function is not called. How to change the code if I want to use frame callback function? Please help typedef LRESULT (CALLBACK *FRAMECALLBACK)(HWND , LPVIDEOHDR); LRESULT PASCAL _grabber_CallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr); BOOL CCaptureVideo::Create(DWORD dwStyle, const RECT& rect, HWND pParentWnd) { hCaptureWnd=capCreateCaptureWindow("AviCap_Basic", dwStyle, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, pParentWnd, AVICAP_WINDOW_ID); if(!hCaptureWnd) { TRACE("CAviCap Window creation failed\n"); //iLastError=CAP_WINCREATION_FAILED; return FALSE; } if( capDriverConnect(hCaptureWnd, DEFAULT_CAPTURE_DRIVER) ) { AfxMessageBox("cap Driver connect ok"); } if (capSetCallbackOnFrame(hCaptureWnd, _grabber_CallbackProc) ) { AfxMessageBox("Callback ok"); } if( capPreview(hCaptureWnd, FALSE)) { AfxMessageBox("Preview ok"); } return TRUE; } LRESULT PASCAL _grabber_CallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr) { AfxMessageBox("grab"); return 0; }