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

int CVideoDevice::GetFramerate (  )  const

Returns the current framerate.

Returns:
The framerate in frames per second.
This applies to some webcams that allow setting of a framerate. In case of a device that does not support select() we use the framerate to set the timer. By default the framerate is set to 10.

Returns -1 in case of error.

Definition at line 863 of file VideoDevice.cc.

{
   struct video_window vwin;

   if (CamFD < 0)
     return -1;
   if (HasFramerate) {
     if (ioctl(CamFD, VIDIOCGWIN, &vwin) < 0)
       return -1;
#if defined(PWC_FPS_SHIFT)       
     return (vwin.flags & PWC_FPS_FRMASK) >> PWC_FPS_SHIFT;
#endif     
   }
   return FrameRate;
}


Generated by  Doxygen 1.6.0   Back to index