00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __v4l_h__
00020 #define __v4l_h__
00021
00022
00023 typedef unsigned long int ulong;
00024
00025
00026 #include <linux/types.h>
00027 #include <linux/videodev.h>
00028 #include <context.h>
00029
00030 class V4lGrabber: public Layer {
00031 private:
00032 int dev;
00033 int input;
00034 int norm;
00035 int _band;
00036 int _freq;
00037 uint32_t palette;
00038
00039 struct video_capability grab_cap;
00040
00041 struct video_mbuf grab_map;
00042 struct video_mmap grab_buf[32];
00043 int cur_frame;
00044 int ok_frame;
00045 int num_frame;
00046
00047 struct video_channel grab_chan;
00048 struct video_picture grab_pic;
00049 struct video_tuner grab_tuner;
00050
00051 bool grab24;
00052 bool have_tuner;
00053
00054 int channels;
00055
00056 void *get_buffer();
00057
00058
00059
00060
00061 void *rgb_surface;
00062
00063
00064 public:
00065 V4lGrabber();
00066 ~V4lGrabber();
00067 bool open(const char *devfile);
00068
00069 void *feed();
00070 void close();
00071
00072 void set_chan(int ch);
00073 void set_band(int b);
00074 void set_freq(int f);
00075
00076 unsigned char *v4l_buffer;
00077
00078 protected:
00079 bool _init() { return true; };
00080
00081 };
00082
00083 #endif