Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 267 → Rev 266

/shark/trunk/drivers/bttv/fg.c
39,15 → 39,13
if (vmm.frame == 0) {
vmm.frame = 1;
fbuf_pointer = btv.fbuffer;
/* *(BYTE *)fbuf_pointer = 255;
* *(BYTE *)(fbuf_pointer+1) = 0;
*/
*(BYTE *)fbuf_pointer = 255;
*(BYTE *)(fbuf_pointer+1) = 0;
} else {
vmm.frame = 0;
fbuf_pointer = btv.fbuffer+gbufsize;
/* *(BYTE *)fbuf_pointer = 0;
* *(BYTE *)(fbuf_pointer+1) = 255;
*/
*(BYTE *)fbuf_pointer = 0;
*(BYTE *)(fbuf_pointer+1) = 255;
}
 
task_testcancel();
79,7 → 77,6
 
refresh_PID = task_create("FG_refresh", FG_refresh, &ht_refresh, NULL);
if (refresh_PID == -1) {
cprintf("could not create task, err no=%d\n",errno);
sys_end();
}
86,26 → 83,16
bttv_start(&btv);
 
err = bttv_ioctl(&btv, VIDIOCGWIN, &vw);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCGWIN Error: %d)",err);
sys_end();
}
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
vw.x = 0;
vw.y = 0;
vw.width = width;
vw.height = height;
err = bttv_ioctl(&btv, VIDIOCSWIN, &vw);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCSWIN Error: %d)",err);
sys_end();
}
 
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
err = bttv_ioctl(&btv, VIDIOCGPICT, &p);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCGPICT Error: %d)",err);
sys_end();
}
 
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
if (color == FG_RGB24) {
p.palette = VIDEO_PALETTE_RGB24;
p.depth = 24;
114,30 → 101,15
p.palette = VIDEO_PALETTE_GREY;
p.depth = 8;
}
if (color == FG_YUYV) {
p.palette = VIDEO_PALETTE_YUYV;
p.depth = 16;
}
err = bttv_ioctl(&btv, VIDIOCSPICT, &p);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
 
err = bttv_ioctl(&btv, VIDIOCSPICT, &p);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCSPICT Error: %d)",err);
sys_end();
}
err = bttv_ioctl(&btv, VIDIOCGCHAN, &ch);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
ch.channel = channel;
err = bttv_ioctl(&btv, VIDIOCGCHAN, &ch);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCGCHAN Error: %d)",err);
sys_end();
}
ch.norm = VIDEO_MODE_PAL;
ch.type = VIDEO_TYPE_CAMERA;
ch.norm = 3;
err = bttv_ioctl(&btv, VIDIOCSCHAN, &ch);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCSCHAN Error: %d)",err);
sys_end();
}
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
vmm.frame = 0;
vmm.height = vw.height;
144,10 → 116,8
vmm.width = vw.width;
vmm.format = p.palette;
err = bttv_ioctl(&btv, VIDIOCMCAPTURE, &vmm);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCMCAPTURE Error: %d)",err);
sys_end();
}
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
 
elaborate_frame_hook = dummy_elaborate_frame;
sleep(1);
167,8 → 137,7
{
 
task_kill(refresh_PID);
/* sleep(1);
*/
sleep(1);
bttv_close(&btv);
}