7 * \brief This is header file v4l device (camera).
21 #include <linux/types.h>
22 #include <linux/videodev.h>
24 #include <sys/ioctl.h>
26 #include <sys/types.h>
29 #define DWIDTH 320 ///>Default width
30 #define DHEIGHT 240 ///>Default height
32 /* Input data output Palette define here */
33 #define VIDEO_PALETTE_RGB565 3 /* 16bit RGB */
34 #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
35 #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
36 #define VIDEO_PALETTE_YUV420P 15 /* YUV 420P */
37 #define VIDEO_PALETTE_RAW_JPEG 20
41 * Camera type format date
54 * Struct represents input capture device
57 int fd; // file descriptor
58 char *videodevice ; //name of camera
60 struct video_mmap vmmap;
61 struct video_capability videocap;
63 struct video_mbuf videombuf;
64 struct video_picture videopict;
65 struct video_window videowin;
66 struct video_channel videochan;
68 unsigned int format ; /* Format asked by apps for this frame */
69 int cameratype ; /* native in frame format */
77 int grabMethod ; ///> Grab Methode 1=mmap 0=read
78 unsigned char *pFramebuffer;
79 unsigned char *pixTmp;
96 //Camera type jpeg yuvy yyuv yuyv grey gbrg
97 static struct palette_list Plist[] ={
110 * Fuction for initialization v4l device.
112 * \param vd Video device pointer
114 * \return 0 if succesful or error number -1
116 int init_v4l ( struct vdIn *vd );
119 * Fuction for initialization v4l device.
121 * \param vd Video device pointer
123 * \return 0 if succesful or error number -1
125 int grab (struct vdIn *vd );
128 * Fuction close v4l device.
130 * \param vd Video device pointer
133 int close_v4l (struct vdIn *vd);
136 * Fuction sets color pallete video device.
138 * \param vd Video device pointer
142 int setPalette (struct vdIn *vd);
145 * Fuction change size of image array video device.
147 * \param vd Video device pointer
151 int changeSize (struct vdIn *vd);
155 * Fuction get brightness from the camera.
157 * \param vd Video device pointer
161 __u8 getBrightness ( struct vdIn *vd);
164 * Fuction set brightness to the camera.
166 * \param vd Video device pointer
167 * \param bright New brightness value
169 void setBrightness ( struct vdIn *vd, __u8 bright);
172 * Fuction get contrast from the camera.
174 * \param vd Video device pointer
178 __u8 getContrast ( struct vdIn *vd);
181 * Fuction set contrast to the camera.
183 * \param vd Video device pointer
184 * \param contrast New contrast value
186 void setContrast ( struct vdIn *vd, __u8 contrast);
189 * Fuction get colors from the camera.
191 * \param vd Video device pointer
195 __u8 getColors ( struct vdIn *vd);
198 * Fuction set colors to the camera.
200 * \param vd Video device pointer
201 * \param colors New colors value
203 void setColors ( struct vdIn *vd, __u8 colors);
206 * Fuction get norme from the camera.
208 * \param vd Video device pointer
212 __u8 getNorme ( struct vdIn *vd);
215 * Fuction set norme to the camera.
217 * \param vd Video device pointer
218 * \param norme New norme value
220 void setNorme (struct vdIn *vd,__u8 norme);
223 * Fuction get channel from the camera.
225 * \param vd Video device pointer
229 __u8 getChannel (struct vdIn *vd);
232 * Fuction set channels to the camera.
234 * \param vd Video device pointer
235 * \param channel New channel value
237 void setChannel( struct vdIn * vd,__u8 channel);