Rev 174 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
170 | giacomo | 1 | Project: S.Ha.R.K. |
2 | |||
3 | Frame Grabber support from BTTV linux driver |
||
4 | |||
5 | Coordinators: |
||
6 | |||
7 | Giorgio Buttazzo <giorgio@sssup.it> |
||
8 | Paolo Gai <pj@gandalf.sssup.it> |
||
9 | |||
10 | Authors: |
||
11 | |||
12 | Giacomo Guidi <giacomo@gandalf.sssup.it> |
||
13 | |||
14 | This is the first version of BTTV driver under shark. |
||
15 | It's a strongly hacked driver for all the frame grabbers |
||
174 | giacomo | 16 | with bt848/878 actually supported by linux. |
17 | The audio sub-device is not supported. |
||
170 | giacomo | 18 | |
174 | giacomo | 19 | New features (related with the old PXC driver): |
170 | giacomo | 20 | |
21 | - No more DOS external init |
||
22 | |||
23 | - Color grabbing (bpp 8,16,24) |
||
24 | |||
25 | - Changing resolution and grabbing period (periodic hard task... see fg.c) |
||
26 | |||
27 | - BTTV linux-like driver interface (bttv_open, bttv_ioctl, ecc) |
||
28 | |||
177 | giacomo | 29 | For a fast use of this driver: |
170 | giacomo | 30 | |
31 | makefile symbol: __BTTV__ |
||
32 | |||
33 | #include <drivers/fg.h> |
||
34 | |||
177 | giacomo | 35 | FG_init(<grabbing period>,<grabbing wcet>,<grabbing width>,<grabbing height>,<color mode>); //Initialize FG |
170 | giacomo | 36 | |
177 | giacomo | 37 | <color mode> could be FG_MONO or FG_RGB24 |
38 | |||
170 | giacomo | 39 | fgptr = FG_getbuffer(); //Get the image pointer |
40 | |||
177 | giacomo | 41 | Now fgptr is a pointer to the grabbed image, but to elaborate an |
42 | image is better to define a function like |
||
170 | giacomo | 43 | |
174 | giacomo | 44 | elaborate_image(void *imageptr); |
45 | |||
46 | and with |
||
47 | |||
48 | FG_set_hook(elaborate_image); |
||
49 | |||
50 | this function will be periodically called when a grabbed |
||
51 | image is ready. A Double Buffer is implemented so the elaborated |
||
52 | image is always complete and consistent. See fg.c for the code details. |
||
53 | |||
177 | giacomo | 54 | FG_start_grabbing(); to start the frame grabber |
170 | giacomo | 55 | |
177 | giacomo | 56 | FG_close(); To close the FG |
57 | |||
58 | For an example see BTTVDEMO |
||
59 |