]> rtime.felk.cvut.cz Git - frescor/frsh.git/blob - demo/dcamera/capture_v4l.h
Added distributed camera demo
[frescor/frsh.git] / demo / dcamera / capture_v4l.h
1 /*==========================================================================
2   $Id$
3   capture_v4l.h: Header file for capturing image using Video4Linux.
4   Written by Naoyuki Ichimura, AIST, 2001.
5 ==========================================================================*/
6
7 #include <stdio.h> 
8 #include <stdlib.h>
9 #include <math.h>
10 #include <string.h>
11
12 #include <sys/types.h>          /* for open() */
13 #include <sys/stat.h>
14 #include <fcntl.h>
15
16 #include <sys/ioctl.h>          /* for ioctl() */
17
18 #include <unistd.h>             /* for mmap() */
19 #include <sys/mman.h>
20
21 #include <linux/videodev.h>     /* for V4L */
22
23 /*=====================================================
24   Definitions for Video4Linux
25 =====================================================*/
26 #define DEFAULT_DEVICE_NAME     "/dev/video0"   /* device file name */
27 #define MAX_NO_CHANNEL          10              /* maximum number of channel of frame grabber */
28 #define CAPTURE_IMAGE_WIDTH     640             /* image width */       
29 #define CAPTURE_IMAGE_HEIGHT    480             /* image height */
30
31 #define RGB                     3               /* number of bit plane */
32
33 #define COMPOSITE1              0               /* for IO-DATA GV-VCP2M/PCI */
34 #define COMPOSITE2              1
35 #define S_VIDEO                 2
36
37 #define DOWN_SAMPLING_RATE      2               /* to remove even number field */
38
39 #define IMAGE_WIDTH_DS          CAPTURE_IMAGE_WIDTH/DOWN_SAMPLING_RATE  /* image size after down sampling */
40 #define IMAGE_HEIGHT_DS         CAPTURE_IMAGE_HEIGHT/DOWN_SAMPLING_RATE
41
42 /*=====================================================
43   Function Prototypes
44 =====================================================*/
45 int CaptureV4LOpen( char *device_name );
46 int CaptureV4LGetDeviceCapability( int fd , struct video_capability *vcap );
47 void CaptureV4LDisplayDeviceCapability( struct video_capability vcap );
48 int CaptureV4LGetChannelInfo( int fd , struct video_channel vch[MAX_NO_CHANNEL] , int no_channel );
49 void CaptureV4LDisplayChannelInfo( struct video_channel vch[MAX_NO_CHANNEL] , int no_channel );
50 int CaptureV4LGetPictureInfo( int fd , struct video_picture *vp );
51 void CaptureV4LDisplayPictureInfo( struct video_picture vp );
52 int CaptureV4LGetMemoryMapInfo( int fd , struct video_mbuf *vm );
53 void CaptureV4LDisplayMemoryMapInfo( struct video_mbuf vm );
54
55 int CaptureV4LSelectChannel( int fd , struct video_channel vch[MAX_NO_CHANNEL] , int channel_no );
56 int CaptureV4LMemoryMapping( int fd , struct video_mbuf vm );
57
58 int CaptureV4LSimpleCapture( int fd , struct video_mmap *vmap );
59 int CaptureV4LDoubleBufferingInitCapture( int fd , struct video_mmap *vmap );
60 int CaptureV4LDoubleBufferingCaptureWait( int fd , struct video_mmap *vmap ) ;
61 int CaptureV4LDoubleBufferingCaptureNextFrame( int fd , struct video_mmap *vmap );
62
63 unsigned char *CaptureV4LSetImage( struct video_mmap vmap , struct video_mbuf vm );
64 void CaptureV4LSetImageDownSamplingForOpenGL( struct video_mmap vmap , struct video_mbuf vm , int down_sampling_rate , unsigned char *image , unsigned char *disp_image );
65
66