How to implement a callback function

Eric Pouech pouech-eric at wanadoo.fr
Sun Apr 17 11:21:43 CDT 2005


luis lenders a écrit :
> Hi , i would like to implement this function:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_cappreview.asp
> Here fpProc is a pointer to the preview callback
> function
> Applications use this to get access to the videodata.
> Right now i already have a preview window.
> 
> If i'm correct it is similar to this
> function:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_capvideostreamcallback.asp
> 
> Here the structure LPVIDEOHDR lpVHdr contains the
> information about the videodata. My question is how
> all of this could be implemented; right now i have :
> 
> case WM_CAP_SET_CALLBACK_FRAME:
> LPVIDEOHDR lpVideoHdr; //defined in vfw.h
> typedef LRESULT (CALLBACK * CAPVIDEOCALLBACK)(HWND
> hwnd, LPVIDEOHDR lpVideoHdr);
> CAPVIDEOCALLBACK *framecallback = (CAPVIDEOCALLBACK
> *)lParam;
> 
> {so what goes here? }
> 
> 
> 
> return TRUE;
> break;
> 
> So how could i pass the data in lpVideoHdr to the
> application? Any help appreciated  as i'm still quite
> a beginner in this :)
it seems that you open somehow a capture session.
Within this session, you can set a user defined callback to be passed every 
frame captured.
On the WM_CAP_SET_CALLBACK_FRAME message, your session should store the pointer 
to the function in the session data (you should have something for that somewhere).
Everytime you complete the capture of a frame in a given session, and this 
callback has been defined, then you should call it (by passing the current 
LPVIDEOHDR which is likely to be the structure to contain the data for the 
captured frame).
HTH
A+
-- 
Eric Pouech




More information about the wine-devel mailing list