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