FACT++  1.0
Int_t MVideo::SetChannel ( Int_t  chan)

Definition at line 820 of file MVideo.cc.

References video_channel::channel, video_capability::channels, fCaps, fChannel, gLog, Ioctl(), VIDIOCGCHAN, and VIDIOCSCHAN.

821 {
822  return kSKIP;
823 
824  if (fChannel.channel==chan)
825  return kSKIP;
826 
827  if (chan<0 || chan>=fCaps.channels)
828  {
829  gLog << err << "ERROR - Set channel " << chan << " out of range." << endl;
830  return kFALSE;
831  }
832 
833  // Switch to channel
834  struct video_channel ch = { chan, "", 0, 0, 0, 0 };
835  if (Ioctl(VIDIOCSCHAN, &ch)==-1)
836  {
837  gLog << err << "ERROR - Couldn't switch to channel " << chan << "." << endl;
838  gLog << " You might need a bttv version > 0.5.13" << endl;
839  return kFALSE;
840  }
841 
842  // Get information about channel
843  if (Ioctl(VIDIOCGCHAN, &ch)==-1)
844  {
845  gLog << err << "ERROR - Getting information for channel " << chan << " failed." << endl;
846  return kFALSE;
847  }
848 
849  memcpy(&fChannel, &ch, sizeof(fChannel));
850 
851  gLog << all << "Switched to channel " << chan << endl;
852 
853  return kTRUE;
854 }
int Ioctl(int req, void *opt, bool allowirq=true, bool force=false) const
Definition: MVideo.cc:108
struct video_capability fCaps
Definition: MVideo.h:59
#define gLog
Definition: fits.h:36
struct video_channel fChannel
Definition: MVideo.h:60
#define VIDIOCGCHAN
Definition: videodev.h:231
#define VIDIOCSCHAN
Definition: videodev.h:232

+ Here is the call graph for this function: