Operator Console
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Typedefs | Functions | Variables
escapi.cpp File Reference
#include <windows.h>
#include "escapi.h"
Include dependency graph for escapi.cpp:

Typedefs

typedef void(* initCOMProc )()
 

Functions

int setupESCAPI ()
 

Variables

countCaptureDevicesProc countCaptureDevices
 
initCaptureProc initCapture
 
deinitCaptureProc deinitCapture
 
doCaptureProc doCapture
 
isCaptureDoneProc isCaptureDone
 
getCaptureDeviceNameProc getCaptureDeviceName
 
ESCAPIDLLVersionProc ESCAPIDLLVersion
 
initCOMProc initCOM
 

Typedef Documentation

typedef void(* initCOMProc)()

Function Documentation

int setupESCAPI ( )

References countCaptureDevices, deinitCapture, doCapture, ESCAPIDLLVersion, getCaptureDeviceName, initCapture, initCOM, and isCaptureDone.

Referenced by SimpleDirectShowAcq::Open().

17 {
18  /* Load DLL dynamically */
19  HMODULE capdll = LoadLibrary("escapi.dll");
20  if (capdll == NULL)
21  return 0;
22 
23  /* Fetch function entry points */
24  countCaptureDevices = (countCaptureDevicesProc)GetProcAddress(capdll, "countCaptureDevices");
25  initCapture = (initCaptureProc)GetProcAddress(capdll, "initCapture");
26  deinitCapture = (deinitCaptureProc)GetProcAddress(capdll, "deinitCapture");
27  doCapture = (doCaptureProc)GetProcAddress(capdll, "doCapture");
28  isCaptureDone = (isCaptureDoneProc)GetProcAddress(capdll, "isCaptureDone");
29  initCOM = (initCOMProc)GetProcAddress(capdll, "initCOM");
30  getCaptureDeviceName = (getCaptureDeviceNameProc)GetProcAddress(capdll, "getCaptureDeviceName");
31  ESCAPIDLLVersion = (ESCAPIDLLVersionProc)GetProcAddress(capdll, "ESCAPIDLLVersion");
32 
33  /* Check that we got all the entry points */
34  if (initCOM == NULL ||
35  ESCAPIDLLVersion == NULL ||
36  getCaptureDeviceName == NULL ||
37  countCaptureDevices == NULL ||
38  initCapture == NULL ||
39  deinitCapture == NULL ||
40  doCapture == NULL ||
41  isCaptureDone == NULL)
42  return 0;
43 
44  /* Verify DLL version */
45  if (ESCAPIDLLVersion() != 0x200)
46  return 0;
47 
48  /* Initialize COM.. */
49  initCOM();
50 
51  /* and return the number of capture devices found. */
52  return countCaptureDevices();
53 }
int(* isCaptureDoneProc)(unsigned int deviceno)
Definition: escapi.h:42
int(* initCaptureProc)(unsigned int deviceno, struct SimpleCapParams *aParams)
Definition: escapi.h:30
initCOMProc initCOM
Definition: escapi.cpp:14
void(* deinitCaptureProc)(unsigned int deviceno)
Definition: escapi.h:34
ESCAPIDLLVersionProc ESCAPIDLLVersion
Definition: escapi.cpp:10
int(* countCaptureDevicesProc)()
Definition: escapi.h:21
void(* getCaptureDeviceNameProc)(unsigned int deviceno, char *namebuffer, int bufferlength)
Definition: escapi.h:46
deinitCaptureProc deinitCapture
Definition: escapi.cpp:6
getCaptureDeviceNameProc getCaptureDeviceName
Definition: escapi.cpp:9
doCaptureProc doCapture
Definition: escapi.cpp:7
initCaptureProc initCapture
Definition: escapi.cpp:5
countCaptureDevicesProc countCaptureDevices
Definition: escapi.cpp:4
void(* initCOMProc)()
Definition: escapi.cpp:13
int(* ESCAPIDLLVersionProc)()
Definition: escapi.h:50
void(* doCaptureProc)(unsigned int deviceno)
Definition: escapi.h:38
isCaptureDoneProc isCaptureDone
Definition: escapi.cpp:8

Here is the caller graph for this function:

Variable Documentation

countCaptureDevicesProc countCaptureDevices

Referenced by setupESCAPI().

deinitCaptureProc deinitCapture
doCaptureProc doCapture
ESCAPIDLLVersionProc ESCAPIDLLVersion

Referenced by setupESCAPI().

getCaptureDeviceNameProc getCaptureDeviceName

Referenced by setupESCAPI().

initCaptureProc initCapture
initCOMProc initCOM

Referenced by setupESCAPI().

isCaptureDoneProc isCaptureDone