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

BOOL PVideoDevice::SetChannel ( int  channelNumber  )  [virtual, inherited]

Set the video channel to be used on the device. The channel number is an integer from 0 to GetNumChannels()-1. The special value of -1 will find the first working channel number.

Default behaviour sets the value of the channelNumber variable and then returns TRUE.

channelNumber  New channel number for device.

Reimplemented in PVideoInput1394DcDevice, PVideoInputDevice_1394AVC, PVideoInputDevice_1394DC, and PVideoInputDevice_FakeVideo.

Definition at line 456 of file videoio.cxx.

References PVideoDevice::GetNumChannels().

Referenced by PVideoDevice::OpenFull(), PVideoInputDevice_FakeVideo::SetChannel(), PVideoInputDevice_1394DC::SetChannel(), PVideoInputDevice_1394AVC::SetChannel(), and PVideoDevice::SetVideoChannelFormat().

  if (channelNum < 0) { // Seek out the first available channel
    for (int c = 0; c < GetNumChannels(); c++) {
      if (SetChannel(c))
        return TRUE;
    return FALSE;

  if (channelNum >= GetNumChannels())
    return FALSE;

  channelNumber = channelNum;
  return TRUE;

Generated by  Doxygen 1.6.0   Back to index