Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1470 → Rev 1471

/demos/trunk/bttvdemo/bttv.c
117,6 → 117,9
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSWIN,(unsigned long)&win);
 
/* Set the buffer */
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSFBUF,(unsigned long)(fbuf));
 
/* IMPORTANT: Set the aperiodic elaboration task
* This is a SHARK change on VIDIOCSYNC. When the
* new frame is ready, the task elaborate_task_PID
127,6 → 130,8
 
}
 
/* Check if the frame grabber is ready */
int ready_to_grab = 1;
 
/* Elaboration task, it is called when the frame
grabber buffer is ready */
143,6 → 148,8
*(unsigned int *)(fbuf->base+50*320*3+50*3));
*/
 
ready_to_grab = 1;
 
task_testcancel();
task_endcycle();
 
155,17 → 162,24
/* Send the grab command */
TASK grab_task(void *arg) {
 
struct video_buffer *fbuf = (struct video_buffer *)(arg);
int on;
 
while(1) {
 
if (ready_to_grab) {
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCSFBUF,(unsigned long)(fbuf));
/* Grab */
on = 1;
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCCAPTURE,(unsigned long)&on);
/* Grab */
on = 1;
VIDEODEV26_ioctl(FRAME_GRABBER_NUMBER,VIDIOCCAPTURE,(unsigned long)&on);
 
ready_to_grab = 0;
 
} else {
 
/* Frame skipped */
 
}
 
task_testcancel();
task_endcycle();
233,8 → 247,7
hard_task_default_model(gt);
hard_task_def_mit(gt,40000);
hard_task_def_arg(gt,(void *)(&fbuf));
hard_task_def_wcet(gt,3000);
hard_task_def_wcet(gt,4000);
hard_task_def_ctrl_jet(gt);
grab_task_pid = task_create("GrabTask",grab_task,&gt,NULL);
269,6 → 282,7
 
start_frame_grabber(elaborate_task_pid,channel,&fbuf);
 
/* Activate periodic grabbing */
task_activate(grab_task_pid);
 
while(keyb_getch(BLOCK) != ESC);