72,14 → 72,17 |
|
task_nopreempt(); |
|
/* Open VideoDev */ |
VIDEODEV26_open(0); |
|
|
/* Select input channel */ |
VIDEODEV26_ioctl(0,VIDIOCGCHAN,(unsigned long)&chan); |
|
chan.channel = (int)(arg); |
|
VIDEODEV26_ioctl(0,VIDIOCSCHAN,(unsigned long)&chan); |
|
|
/* Select palette and depth */ |
VIDEODEV26_ioctl(0,VIDIOCGPICT,(unsigned long)&vpic); |
|
vpic.palette = VIDEO_PALETTE_GREY; |
87,6 → 90,8 |
|
VIDEODEV26_ioctl(0,VIDIOCSPICT,(unsigned long)&vpic); |
|
/* Double Buffering Strategy */ |
|
fbuf[0].base = malloc(320*200); |
fbuf[0].height = 200; |
fbuf[0].width = 320; |
102,6 → 107,7 |
VIDEODEV26_ioctl(0,VIDIOCSFBUF,(unsigned long)&(fbuf[0])); |
VIDEODEV26_ioctl(0,VIDIOCSFBUF,(unsigned long)&(fbuf[1])); |
|
/* Set grabbing window */ |
VIDEODEV26_ioctl(0,VIDIOCGWIN,(unsigned long)&win); |
|
win.x = 0; |
120,8 → 126,11 |
|
task_nopreempt(); |
|
/* Set the current buffer */ |
VIDEODEV26_ioctl(0,VIDIOCSFBUF,(unsigned long)&(fbuf[save])); |
|
|
/* Start grabbing */ |
on = 1; |
VIDEODEV26_ioctl(0,VIDIOCCAPTURE,(unsigned long)&on); |
|
129,6 → 138,7 |
|
elaborate_image(fbuf[display].base); |
|
/* Buffer switch */ |
temp = display; |
display = save; |
save = temp; |