00001 #ifndef __xvdig1394_h
00002 #define __xvdig1394_h
00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015
00016
00017 #include <sys/types.h>
00018 #include <video1394.h>
00019 #include <libraw1394/raw1394.h>
00020 #include "dc1394_control.h"
00021 #include "Video.h"
00022 #include "Dig1394.h"
00023
00024 #define DC_DEVICE_NAME "/dev/video1394"
00025 #define DIG_DEF_NUMFRAMES 4
00026 #define DIG_DEF_INPUT 0
00027
00028 template <class PIXTYPE>
00029 class Dig1394:public Video<PIXTYPE>
00030 {
00031 int fd;
00032 int raw_fd;
00033 int node_id;
00034 int scale;
00035 int raw_rgb;
00036 raw1394handle_t handle;
00037 struct video1394_mmap v_mmap;
00038 unsigned char *mm_buf[DIG_DEF_NUMFRAMES];
00039 const char *device_name;
00040 dc1394_cameracapture camera;
00041 nodeid_t * camera_nodes;
00042 int yuv422torgb (unsigned char *YUV, XVImageRGB<PIXTYPE> &targ,
00043 int NumPixels);
00044 int rawtorgb (unsigned char *YUV, XVImageRGB<PIXTYPE> &targ,
00045 int NumPixels);
00046 public:
00047 Dig1394(const char *dev_name=DC_DEVICE_NAME,
00048 const char *parm_string=NULL);
00049 virtual ~Dig1394();
00050
00051 int open(const char *dev_name);
00052 void close(void);
00053 int set_params(char *param_string);
00054 int initiate_acquire(int frame);
00055 int wait_for_completion(int frame);
00056 };
00057
00058 #endif