Re: frame buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi  Justin, I have some questions about your code:

> for(frame=0; frame<vm.frames; frame++);
> {
>     mm.frame = frame;
>     if(ioctl(fd, VIDIOCMCAPTURE, &mm)<0)
>     {
>         perror("VIDIOCMCAPTURE");
>         exit(-1);
>     }
> }

1. Why did you do this routine if you going to make a  MCAPTURE again in this
routine:

 mm.frame = frame;
    if(ioctl(fd, VIDIOCMCAPTURE, &mm)<0)
    {
        perror("VIDIOCMCAPTURE");
        exit(-1);
    }
    frame++;
    if (frame>=vm.frames) frame = 0;

2. Why did you make this routine to make SYNC (is it not enough with the ioctl
call??) and why didn't you put &mm but &frame???:

> {
>     i = -1;
>     while(i<0)
>     {
>          i = ioctl(cap_fd, VIDIOCSYNC, &frame);
>          if(i < 0 && errno == EINTR) continue;
>          if(i < 0)
>          {
>                perror("VIDIOCSYNC");
>                /* You may want to exit here, because something has gone
> pretty badly wrong... */
>          }
>          break;
>     }
>

Hope those are not stupid question... sorry.. I am not an expert..thanks in
advance.

Edgar





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux