00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __TLDIGITIZERV4L_H__
00018 #define __TLDIGITIZERV4L_H__
00019
00020
00021 #if !LINUX
00022 #error THIS IS A LINUX VERSION
00023 #endif
00024
00025 #define TLDIGITIZER_V4L_BASE_NAME "/dev/video"
00026
00027 #include <sys/types.h>
00028 #include <linux/videodev.h>
00029
00030 #include "tlVision.h"
00031 #include "tlDigitizer.h"
00032
00033
00034
00035 class tlDigitizerV4L : public tlDigitizer
00036 {
00037 private:
00038 int ifd;
00039 unsigned char *mmbuf;
00040 struct video_mbuf mbuf;
00041 struct video_mmap vbuf;
00042 unsigned char *rgbImage;
00043 struct video_capability vcap;
00044 int grabQueuedInit;
00045
00046 public:
00047 tlDigitizerV4L ();
00048 tlDigitizerV4L (int width, int height);
00049 tlDigitizerV4L (int width, int height, int channel, unsigned short input = TL_SOURCE_AUTO);
00050 virtual ~tlDigitizerV4L ();
00051
00052 virtual int open (int index = 0);
00053 virtual int open (int width, int height, int index = 0);
00054 int open (int width, int height, int index, int channel, unsigned short input = TL_SOURCE_AUTO);
00055 virtual int close ();
00056
00057 virtual int setChannel (int channel, unsigned short input);
00058 virtual int setInput (unsigned short input);
00059 virtual int setFrameRate (int fps);
00060 virtual int setSize (int width, int height);
00061
00062 virtual int grab (tlImage *image);
00063 virtual int grab (tlImage *image, tlRect *rect);
00064 virtual int grabQueued (tlImage *image);
00065 virtual int grabQueued (tlImage *image, tlRect *rect);
00066 };
00067
00068
00069 #endif
00070