00001
00020 #ifndef _DC1394_H
00021 #define _DC1394_H
00022
00023
00024 #include <cc++2/cc++/thread.h>
00025
00026 #include <cc++2/cc++/config.h>
00027 #include <cc++2/cc++/exception.h>
00028 #include <pthread.h>
00029 #include <semaphore.h>
00030 #include <time.h>
00031 #include <signal.h>
00032 #include <unistd.h>
00033 #include <libraw1394/raw1394.h>
00034 #include <libdc1394/dc1394_control.h>
00035 #include <openvidia/LBuffer.h>
00036
00037 using namespace std;
00038 using namespace ost;
00039
00040
00095
00096 class Dc1394 : public Thread, public LBuffer, public Semaphore
00097 {
00098 private:
00099
00100 void TellRWMHeCanUseImage(int numBufs, const char *dma_bufs_[] );
00101 const static int DefaultCaptureWidth=320;
00102 const static int DefaultCaptureHeight=240;
00103 int CaptureWidth,CaptureHeight;
00104
00105 dc1394_cameracapture cameras[8];
00106 raw1394handle_t handles[8];
00107 nodeid_t *camera_nodes;
00108
00109 int bufferUsed;
00110 int numCamsToUse;
00111 int numCamsUsed;
00112 char *bufs[8] ;
00113 bool noDMA;
00114
00115 bool doOHCI();
00116
00117
00118 void tellThreadDoneWithBuffer();
00119
00120 void releaseBarrier();
00121
00125 void run();
00126 public:
00129
00130
00132 Dc1394( int W=320,
00133 int H=240
00134 );
00135 ~Dc1394();
00136
00137
00138 };
00139
00140 #endif
00141