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

BOOL PVideoInputDevice_VideoForWindows::GetFrameDataNoDelay ( BYTE *  buffer,
PINDEX *  bytesReturned = NULL 
) [virtual]

Grab a frame. Do not delay according to the current frame rate parameter.

Parameters:
bytesReturnedBuffer to receive frame OPtional bytes returned.

Implements PVideoInputDevice.

Definition at line 928 of file vfw.cxx.

References PColourConverter::Convert(), PSync::Signal(), PSync::Wait(), and PSemaphore::Wait().

Referenced by GetFrameData().

{
  if (!frameAvailable.Wait(1000))
    return FALSE;

  bool retval = false;

  lastFrameMutex.Wait();

  if (lastFramePtr != NULL) {
    if (NULL != converter)
      retval = converter->Convert(lastFramePtr, buffer, bytesReturned);
    else {
      memcpy(buffer, lastFramePtr, lastFrameSize);
      if (bytesReturned != NULL)
        *bytesReturned = lastFrameSize;
      retval = true;
    }
  }

  lastFrameMutex.Signal();

#if STEP_GRAB_CAPTURE
  if (isCapturingNow)
    capGrabFrameNoStop(hCaptureWindow);
#endif

  return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index