Exemplo n.º 1
0
void *update_thread(void*dummy)
{
    unsigned char pic[XRES*YRES];
    int capture=open("/dev/dbox/capture0", O_RDONLY);
    int x, y;

    capture_stop(capture);
    capture_set_input_pos(capture, 0, 0);
    capture_set_input_size(capture, 720, 576);
    capture_set_output_size(capture, XRES, YRES*2);
    stride = capture_start(capture);

    printf("Capture driver reports stride=%d\n", stride);

    while (1)
    {
        read_frame(pic, capture);
        for (y=0; y<65; y++)
        {
            for (x=0; x<120; x++)
                image[LCD_COLS*y+x]=pic[y*XRES+x];
        }
    }

    capture_stop(capture);
    close(capture);
}
Exemplo n.º 2
0
void CCAPTURE::set_output_size (int w, int h)
{
#ifdef __v4l_capture

	struct v4l2_format format;

	out_w = w;
	out_h = h;
	format.fmt.pix.width = w;
	format.fmt.pix.height = h;

	if (ioctl(fd, VIDIOC_S_FMT, &format) < 0) 
		perror ("error VIDIOC_S_FMT");

#else

	out_w = w;
	out_h = h;
	capture_set_output_size(fd, w, h);	

#endif
}