Logo Search packages:      
Sourcecode: camstream version File versions  Download package

int CVideoDevice::MCapture ( int  buf  )  [private]

Do ioctl(MCAPTURE), start grabbing frame in buffer.

buf The mmap buffer (will be set modulo total buffers)
This function will start the capture of an image into buffer buf with the current width & height

Definition at line 339 of file VideoDevice.cc.

Referenced by ReadImage(), and SetSize().

   struct video_mmap vm;
   if (VMBuf.size == 0)
     return 0; // ignore call

   ASSERT(buf >= 0 && buf <= Buffers);
   vm.frame = buf;
   vm.format = Palette;
   vm.width = image_w;
   vm.height = image_h;
   qDebug("CVideoDevice::MCapture(): buffer %d, format %d, size (%dx%d)", buf, Palette, image_w, image_h);
   if (ioctl(CamFD, VIDIOCMCAPTURE, &vm) < 0) {
     perror("CVideoDevice::MCapture() ioctl");
     return -errno;
   return 0;

Generated by  Doxygen 1.6.0   Back to index