gml_GrabberDriver.h

00001 /*
00002  * gml_GrabberDriver.h --
00003  *
00004  *  Declares the interface for registering video grabbers to the generic grabber code.
00005  *
00006  * Copyright (c) 2003 CLIPS-IMAG
00007  *
00008  * See the file "gml_LicenseTerms.txt" for information on usage and redistribution
00009  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  *
00011  *  Created on July 19, 2003 (F.B.)
00012  */
00013 
00014 #ifndef __GML_GRABBERDRIVER__
00015 #define __GML_GRABBERDRIVER__
00016 
00017 
00018 #include "gml/grabber/gml_Grabber.h"
00019 
00020 
00021 
00022 
00023 
00024 /*
00025  * gml_TGrabberDriverDescr function type definitions --
00026  *
00027  *  Function that a grabber driver must provide, their pointer is stored in a gml_TGrabberDriverDescr struct, see
00028  *    below.
00029 
00030  * gml_TGrabberDriverFunc_StartStop --
00031  *
00032  *  Starts or stops grabbing frames.
00033  *    <start>       if true (non 0), start grabbing. Otherwise stop.
00034  *
00035  * gml_TGrabberDriverFunc_GetBitmap --
00036  *
00037  *  See <gml_GrabberGetBitmap>.
00038  *
00039  * gml_TGrabberDriverFunc_BindNewFrame --
00040  *
00041  *  See <gml_GrabberBindOnNewFrame>.
00042  *
00043  * gml_TGrabberDriverFunc_SettingsDialog --
00044  *
00045  *  Open a system-level dialog window that allows the user to change the settings of the grabber, if
00046  *    one such window exists. If no such window exists, can be set to NULL.
00047  */
00048 
00049 typedef gml_TError   (gml_TGrabberDriverFunc_GrabberList)    (gml_TGrabberName**     names,
00050                                                               int*                   nb);
00051 typedef gml_TError   (gml_TGrabberDriverFunc_GetGrabber)     (gml_TGrabberName*      name,
00052                                                               gml_TGrabber*          grabber);
00053 typedef gml_TError   (gml_TGrabberDriverFunc_ReleaseGrabber) (gml_TGrabber           grabber);
00054 
00055 typedef gml_TError   (gml_TGrabberDriverFunc_StartStop)      (gml_TGrabber           grabber,
00056                                                               int                    start);
00057 typedef gml_TBitmap* (gml_TGrabberDriverFunc_GetBitmap)      (gml_TGrabber           grabber);
00058 typedef gml_TError   (gml_TGrabberDriverFunc_BindNewFrame)   (gml_TGrabber           grabber,
00059                                                               gml_TCallback          callback,
00060                                                               gml_TPointer           userParam);
00061 typedef gml_TError   (gml_TGrabberDriverFunc_GetOption)      (gml_TGrabber           grabber,
00062                                                               gml_TGrabberFeature*    feature);
00063 typedef gml_TError   (gml_TGrabberDriverFunc_SetOption)      (gml_TGrabber           grabber,
00064                                                               gml_TGrabberFeature*    feature);
00065 typedef gml_TError   (gml_TGrabberDriverFunc_GetName)        (gml_TGrabber           grabber,
00066                                                               gml_TGrabberName       name);
00067 typedef gml_TError   (gml_TGrabberDriverFunc_SettingsDialog) (gml_TGrabber           grabber);
00068 
00069 
00070 
00071 /*
00072  * gml_TGrabberDriverDescr --
00073  *
00074  *  A record containing all information that a grabber driver must provide.
00075  *  None of the function fields may be left NULL.
00076  *
00077  */
00078 
00079 typedef struct gml_TGrabberDriverDescr {
00080 
00081   /* the following fields must be set by each driver code */
00082 
00083   gml_TGrabberDriverFunc_GrabberList*     fFuncGrabberList;
00084   gml_TGrabberDriverFunc_GetGrabber*      fFuncGetGrabber;
00085   gml_TGrabberDriverFunc_ReleaseGrabber*  fFuncReleaseGrabber;
00086   gml_TGrabberDriverFunc_StartStop*       fFuncStartStop;
00087   gml_TGrabberDriverFunc_GetBitmap*       fFuncGetBitmap;
00088   gml_TGrabberDriverFunc_BindNewFrame*    fFuncBindNewFrame;
00089   gml_TGrabberDriverFunc_GetOption*       fFuncGetOption;
00090   gml_TGrabberDriverFunc_SetOption*       fFuncSetOption;
00091   gml_TGrabberDriverFunc_GetName*         fFuncGetName;
00092   gml_TGrabberDriverFunc_SettingsDialog*  fFuncSettingsDialog;
00093 
00094   /* the following fields are managed by the generic grabber code and should not be
00095       accessed by the driver code. */
00096 
00097   gml_TGrabberDriverDescr*                fNext;
00098   gml_TCallbackList*                      fCallbacks;
00099   gml_TList*                              fGrabbers;
00100 
00101 } gml_TGrabberDriverDescr;
00102 
00103 
00104 
00105 /*
00106  * gml_GrabberDriverRegister --
00107  *
00108  *   Called by a grabber driver to register itself to the grabber driver manager.
00109  */
00110 
00111 GML_EXTERN_C
00112 void gml_GrabberDriverRegister (gml_TGrabberDriverDescr* descr);
00113 
00114 
00115 
00116 /*
00117  * gml_GrabberDriverDeRegister --
00118  *
00119  *   Called by a grabber driver to un-register itself from the grabber driver manager.
00120  */
00121 
00122 GML_EXTERN_C
00123 void gml_GrabberDriverDeRegister (gml_TGrabberDriverDescr* descr);
00124 
00125 
00126 #endif /* ifndef __GML_GRABBERDRIVER__ */
00127 
Generated on Tue Jun 12 14:03:27 2007 for gml by Doxygen 1.5.2.