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



_______________________________________________
Video4linux-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/video4linux-list

Reply via email to