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

bool CVideoDevice::SelectVideoInput ( int  number  ) 

Select a new input channel.

This function will program the card/chip to use the selected input channel. Return TRUE if the call succeeded, otherwise FALSE.

Definition at line 1005 of file VideoDevice.cc.

References ChangedVideoInput().

Referenced by CVideoDeviceInput::Select().

{
   struct video_channel arg;
   bool ret;

   ret = FALSE;
   if (CamFD >= 0 && (number >= 0 && number < (int)VideoInputs.count())) {
     arg.channel = number;
     if (ioctl(CamFD, VIDIOCGCHAN, &arg) == 0) {
       if (ioctl(CamFD, VIDIOCSCHAN, &arg) == 0) {
         CurrentVideoInput = number;
         emit ChangedVideoInput(number);
         ret = TRUE;
       }
#ifdef TRACE_VIDEODEV_IOCTL  
       else
         perror("SCHAN");
#endif   
     }
#ifdef TRACE_VIDEODEV_IOCTL  
     else
       perror("GCHAN");
#endif   
   }
   return ret;
}


Generated by  Doxygen 1.6.0   Back to index