Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 1173 → Rev 1174

/demos/trunk/bttvdemo/bttv.c
35,7 → 35,7
 
#include "kernel/kern.h"
#include <drivers/fg.h>
#include <drivers/vga.h>
#include <drivers/glib.h>
#include <drivers/keyb.h>
#include <unistd.h>
#include <stdlib.h>
43,8 → 43,6
#define WIDTH 640
#define HEIGHT 480
#define BYTES_PP 2
#define INITSTR G640x480x64K //SVGAlib standard mode definitions
#define CARD VESA //Video driver
 
unsigned char *video_buf = NULL; //Video Buffer
unsigned long int VMEMLONG = WIDTH * HEIGHT * BYTES_PP / 4; // Used by copy_videomem_16to16
57,33 → 55,23
 
unsigned int color = FG_MONO;
 
static int screen(int mode)
extern DWORD flbaddr;
 
static void screen()
{
 
vga_modeinfo *minf;
/* graphic card Initialization */
if (grx_init() < 1) {
sys_abort(1);
}
 
vga_setmode(mode,CARD);
minf = vga_getmodeinfo(mode);
if(! (minf->flags & CAPABLE_LINEAR)){
vga_setmode(TEXT,CARD);
printk(KERN_INFO "The mode %d is not capable of linear\n",mode);
return 1;
if (grx_open(640, 480, 16) < 0) {
cprintf("GRX Err\n");
sys_abort(1);
}
vga_setpage(0);
if(vga_setlinearaddressing() == -1) {
vga_setmode(TEXT,CARD);
printk(KERN_INFO "Could not set linear addressing for mode %d\n",mode);
return 1;
}
video_buf = vga_getgraphmem();
video_buf = (unsigned char *)flbaddr;
memset(video_buf, 0, RGB565MEM);
grx_setbuffer(video_buf, WIDTH, HEIGHT); //Init of RGBA version of grx functions
//created to work with Mesa buffer
return 0;
}
 
void program_end(void *arg)
91,7 → 79,7
 
FG_close();
vga_setmode(TEXT,CARD);
grx_close();
sys_end();
 
134,8 → 122,8
 
}
 
printf_xy(0,0,WHITE,"Grabbed = %08lx",*(DWORD *)(imageptr + 50*FG_W + 50));
printf_xy(0,1,WHITE,"Grabbed = %08lx",*(DWORD *)(imageptr + 51*FG_W + 50));
//printf_xy(0,0,WHITE,"Grabbed = %08lx",*(DWORD *)(imageptr + 50*FG_W + 50));
//printf_xy(0,1,WHITE,"Grabbed = %08lx",*(DWORD *)(imageptr + 51*FG_W + 50));
}
 
160,9 → 148,10
keyb_hook(k,program_key_end);
}
 
//screen(INITSTR);
video_buf = malloc(RGB565MEM);
 
screen();
//video_buf = malloc(RGB565MEM);
 
sleep(1);
FG_init(FG_PERIOD, FG_WCET, FG_W, FG_H, color, channel);
/demos/trunk/bttvdemo/readme.txt
7,10 → 7,17
 
Last update 27/05/2003
--------------------------------------
Ex:
 
x bttv [channel number]
 
if the channel is not specified 0 is taken.
If you don't see a grabbed image, you
can try to set a channel number from 1 to 4.
 
This is a simple demo for the BTTV driver.
It starts the frame grabber at 25 fps 320x200.
The SVGA driver (default VESA) is used to
The GRX driver is used to
visualize the grabbed images.
 
See also drivers/bttv/readme
/demos/trunk/bttvdemo/makefile
12,5 → 12,5
include $(BASE)/config/example.mk
 
bttv:
make -f $(SUBMAKE) APP=bttv INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __SVGA__ __BTTV__"
make -f $(SUBMAKE) APP=bttv INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__ __BTTV__"