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_window (int x, int y, int w, int h)
{
#ifdef __v4l_capture

	struct v4l2_crop crop;

	crop.c.left = x;	
	crop.c.top = y;
	crop.c.width = w;
	crop.c.height = h;
	if( ioctl(fd, VIDIOC_S_CROP, &crop) < 0) 
		perror ("error VIDIOC_S_CROP");

#else

	capture_set_input_pos(fd, x, y);
	capture_set_input_size(fd, w, h);

#endif
}