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

BOOL PVideoInputDevice_V4L::GetFrameData ( BYTE *  buffer,
PINDEX *  bytesReturned 
) [virtual]

Grab a frame, after a delay as specified by the frame rate.

Implements PVideoInputDevice.

Definition at line 1036 of file vidinput_v4l.cxx.

References GetFrameDataNoDelay(), and PTimeInterval::GetMilliSeconds().

{
  if(frameRate>0) {
    frameTimeError += msBetweenFrames;
   
    do {
      if ( !GetFrameDataNoDelay(buffer, bytesReturned))
      {
        return FALSE;  
      }    
      PTime now;
      PTimeInterval delay = now - previousFrameTime;
      frameTimeError -= (int)delay.GetMilliSeconds();
      previousFrameTime = now;
    }  while(frameTimeError > 0) ;

    return TRUE;
  }  
  return GetFrameDataNoDelay(buffer, bytesReturned);
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index