FACT++  1.0
Int_t MVideo::Close ( )

Definition at line 695 of file MVideo.cc.

References fBuffers, fFileDesc, fPath, gLog, and Reset().

Referenced by Open().

696 {
697  // if (!IsOpen())
698  // return kTRUE;
699 /*
700  if (Ioctl(VIDIOC_STREAMON, &fBuffers[0])==-1)
701  {
702  gLog << err << "ERROR - Couldn't start capturing." << endl;
703  return kFALSE;
704  }
705 */
706  Bool_t rc = kTRUE;
707 
708  gLog << all << "Closing " << fPath << " (" << fFileDesc << ")... " << flush;
709  if (fFileDesc != -1)
710  {
711  if (close(fFileDesc)<0)
712  {
713  gLog << err << "ERROR!" << endl;
714  rc = kFALSE;
715  }
716  fFileDesc = -1;
717  }
718  gLog << "done." << endl;
719 
720  // unmap device memory
721  for (vector<pair<v4l2_buffer,void*> >::iterator it=fBuffers.begin(); it!=fBuffers.end(); it++)
722  {
723  munmap(it->second, it->first.length);
724  fBuffers.erase(it);
725  }
726 
727  Reset();
728 
729  return rc;
730 }
int fFileDesc
Definition: MVideo.h:54
TString fPath
Definition: MVideo.h:52
#define gLog
Definition: fits.h:36
std::vector< std::pair< v4l2_buffer, void * > > fBuffers
Definition: MVideo.h:69
void Reset()
Definition: MVideo.cc:86

+ Here is the call graph for this function:

+ Here is the caller graph for this function: