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.

channelNumberNew channel number for device.

Reimplemented in PVideoInput1394DcDevice, PVideoInputDevice_1394AVC, PVideoInputDevice_BSDCAPTURE, PVideoInputDevice_1394DC, PVideoInputDevice_V4L, PVideoInputDevice_V4L2, and PVideoInputDevice_FakeVideo.

Definition at line 456 of file videoio.cxx.

Referenced by VidTest::Main(), PVideoInputDevice_V4L2::SetChannel(), PVideoInputDevice_V4L::SetChannel(), PVideoInputDevice_1394DC::SetChannel(), PVideoInputDevice_BSDCAPTURE::SetChannel(), PVideoInputDevice_1394AVC::SetChannel(), and PVideoInputDevice_V4L::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;

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index