Hi, I am using Philips Tou USB cam. I want to
capture the frames through video_mbuf and video_mmap. Here is part of my
code
if
(-1==ioctl(cam,VIDIOCGMBUF,&vidbuf)){perror("ioctl VIDIOCGMBUF");
exit(-1);} printf("------------------------------------\n"); printf("size -> %d\n",vidbuf.size); printf("frames -> %d\n",vidbuf.frames); printf("offsets -> %d\n",vidbuf.offsets); printf("------------------------------------\n"); mapbuf.width = COLS;
mapbuf.height = ROWS; mapbuf.format = VIDEO_PALETTE_RGB24; /* SET BUFFERS*/ for(frame=0;
frame<vidbuf.frames;frame++){ // turn on both of
the buffers
mapbuf.frame = frame; // to start capture process. if (ioctl(cam,VIDIOCMCAPTURE, &mapbuf)<0){ // Now they can store images. perror("VIDIOCMCAPTURE"); exit(-1);} } However, the frame grabbing is not working, and the
error message is VIDIOCMCAPTURE: Invalid argument. What is the problem?
thanks.
------------------------------------------------------------------
Li Tan Intelligent Robotics Lab, AME The University of Oklahoma 865 Asp Ave FH100 Norman OK 73019 Tel: 405-3250731 Fax: 405-3251088 Url: http://www.amerobotics.ou.edu ----------------------------------------------------------------- |