I am trying to grab pictures from my Labtec Webcam in RedHat Ent 4. Firstly I have installed spcaview, and during sturtup it finds my camera and does all other stuff. Now I took a soure code to write a gimple own grabber exactly for my cam. And some code from spcaview doesn't want to work in my program. Here is a pice of code:
Code:
#include <linux/videodev.h>
#include <sys/ioctl.h>
//...
struct video_capability videocap;
int fd;
if ((fd = open ("/dev/video0", O_RDWR)) == -1) {
perror ("ERROR opening V4L interface \n");
exit (1);
}
// ok here
if (ioctl (fd, VIDIOCGCAP, &videocap) == -1) {
printf ("wrong device\n");
exit (1);
}
A on a display I have "wrong device" message. ioctl returns an error while spcaview didn't! What can cause this problem?