Move the sources to trunk
[opencv] / interfaces / ch / c / handmade / cvcam / cvcamPlayAVI_chdl.c
1 /* Copyright (c) 2001-2002 by SoftIntegration, Inc. All Rights Reserved */
2 #include <windows.h>
3 #include <cvcam.h>
4 #include <ch.h>
5
6 typedef  void (*callback)(void *);
7 static ChInterp_t interp;
8 static void cvcamPlayAVI_chdl_funarg(void* arg);
9 static void *cvcamPlayAVI_chdl_funptr;
10
11 EXPORTCH int cvcamPlayAVI_chdl(void *varg) {
12     va_list ap;
13     const char* file;
14     void* window;
15     int width;
16     int height;
17     callback callback_ch, callback_c=NULL;
18     int retval;
19
20     Ch_VaStart(interp, ap, varg);
21     file = Ch_VaArg(interp, ap, const char*);
22     window = Ch_VaArg(interp, ap, void*);
23     width = Ch_VaArg(interp, ap, int);
24     height = Ch_VaArg(interp, ap, int);
25     callback_ch = Ch_VaArg(interp, ap, callback);
26     cvcamPlayAVI_chdl_funptr = (void *)callback_ch;
27     if (callback_ch != NULL)  {
28         callback_c = (callback) cvcamPlayAVI_chdl_funarg;
29     }
30     retval = cvcamPlayAVI(file, window, width, height, callback_c);
31     Ch_VaEnd(interp, ap);
32     return retval;
33 }
34
35 static void cvcamPlayAVI_chdl_funarg(void* arg)   {
36   Ch_CallFuncByAddr(interp,cvcamPlayAVI_chdl_funptr,NULL,arg);
37 }