FACT++  1.0
Int_t MVideo::CaptureWait ( unsigned int  frame,
unsigned char **  ptr = 0 
) const

Definition at line 782 of file MVideo.cc.

References fBuffers, first, gLog, and Ioctl().

Referenced by Camera::Thread().

783 {
784  frame %= fBuffers.size();
785 
786  if (ptr)
787  *ptr = NULL;
788 
789 // const int SYNC_TIMEOUT = 1;
790 
791 //#ifdef DEBUG
792 // cout << "*** CaptureWait " << frame << endl;
793 //#endif
794 
795  //alarm(SYNC_TIMEOUT);
796  const Int_t rc = Ioctl(VIDIOC_DQBUF, const_cast<v4l2_buffer*>(&fBuffers[frame].first), false);
797  if (rc==-4)
798  {
799  //cout << "ERROR - Waiting for frame " << frame << " timed out." << endl;
800  return kSKIP;
801  }
802  //alarm(0);
803 
804  if (rc==-1)
805  {
806  gLog << err << "ERROR - Waiting for " << frame << " frame failed." << endl;
807  return kFALSE;
808  }
809 
810  if (ptr)
811  *ptr = static_cast<unsigned char*>(fBuffers[frame].second);
812 
813  return kTRUE;
814 }
int Ioctl(int req, void *opt, bool allowirq=true, bool force=false) const
Definition: MVideo.cc:108
int64_t first
Size of this column in the tile.
Definition: zofits.h:26
#define gLog
Definition: fits.h:36
std::vector< std::pair< v4l2_buffer, void * > > fBuffers
Definition: MVideo.h:69

+ Here is the call graph for this function:

+ Here is the caller graph for this function: