Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1473 → Rev 1474

/demos/trunk/bttvdemo/bttv.c
41,6 → 41,8
#include "drivers/shark_videodev26.h"
#include "drivers/shark_fb26.h"
 
#include "tracer.h"
 
#define WIDTH 640
#define HEIGHT 480
#define BYTES_PP 2
52,7 → 54,7
#define FG_PERIOD 40000
#define FG_WCET 30000
#define FG_W 320
#define FG_H 200
#define FG_H 240
 
void program_end(void *arg)
{
69,29 → 71,34
struct video_channel chan;
struct video_tuner tuner;
struct video_picture vpic;
int res;
 
/* Init videodev driver */
VIDEODEV26_open(FRAME_GRABBER_NUMBER);
 
/* Select the input channel */
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCGCHAN,(unsigned long)&chan);
res = VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCGCHAN,(unsigned long)&chan);
//cprintf("res = %d\n",res);
 
chan.channel = channel;
chan.type = VIDEO_VC_TUNER;
chan.norm = VIDEO_TYPE_CAMERA;
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSCHAN,(unsigned long)&chan);
res = VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSCHAN,(unsigned long)&chan);
//cprintf("res = %d\n",res);
 
/* Enable the tuner */
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCGTUNER,(unsigned long)&tuner);
 
tuner.tuner = 0;
tuner.mode = VIDEO_MODE_PAL;
 
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSTUNER,(unsigned long)&tuner);
res = VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSTUNER,(unsigned long)&tuner);
//cprintf("res = %d\n",res);
 
/* Select palette and depth */
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCGPICT,(unsigned long)&vpic);
res = VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCGPICT,(unsigned long)&vpic);
//cprintf("res = %d\n",res);
 
#ifdef COLOR
vpic.palette = VIDEO_PALETTE_RGB24;
vpic.depth = 24;
105,20 → 112,23
vpic.contrast = 32000;
vpic.colour = 32000;
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSPICT,(unsigned long)&vpic);
res = VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSPICT,(unsigned long)&vpic);
//cprintf("res = %d\n",res);
 
/* Set grabbing window */
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCGWIN,(unsigned long)&win);
res = VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCGWIN,(unsigned long)&win);
//cprintf("res = %d\n",res);
win.x = 0;
win.y = 0;
win.width = FG_W;
win.height = FG_H;
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSWIN,(unsigned long)&win);
 
res = VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSWIN,(unsigned long)&win);
//cprintf("res = %d\n",res);
 
/* Set the buffer */
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSFBUF,(unsigned long)(fbuf));
res = VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSFBUF,(unsigned long)(fbuf));
//cprintf("res = %d\n",res);
 
/* IMPORTANT: Set the aperiodic elaboration task
* This is a SHARK change on VIDIOCSYNC. When the
/demos/trunk/bttvdemo/initfile.c
136,11 → 136,11
}
 
int device_drivers_close() {
/*
BTTV26_close();
 
FB26_close(FRAME_BUFFER_DEVICE);
*/
KEYB26_close();
INPUT26_close();