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

BOOL PVideoDevice::SetFrameSize ( unsigned  width,
unsigned  height 
) [virtual, inherited]

Set the frame size to be used.

Note that devices may not be able to produce the requested size, and this function will fail. See SetFrameSizeConverter().

Default behaviour sets the frameWidth and frameHeight variables and returns TRUE.

Parameters:
width  New width of frame
height  New height of frame

Reimplemented in PVideoInputDevice_BeOSVideo, PVideoOutputDeviceRGB, PVideoInput1394DcDevice, PVideoInputDevice_1394AVC, PVideoInputDevice_1394DC, PVideoInputDevice_FakeVideo, PVideoInputDevice_VideoForWindows, and PVideoOutputDevice_Window.

Definition at line 808 of file videoio.cxx.

References PVideoDevice::GetFrameSizeLimits(), PColourConverter::SetDstFrameSize(), and PColourConverter::SetSrcFrameSize().

Referenced by PVideoDevice::OpenFull(), PVideoInputDevice_BeOSVideo::SetFrameSize(), PVideoInputDevice_VideoForWindows::SetFrameSize(), PVideoOutputDeviceRGB::SetFrameSize(), PVideoInputDevice_FakeVideo::SetFrameSize(), PVideoDevice::SetFrameSizeConverter(), PVideoChannel::SetGrabberFrameSize(), and PVideoChannel::SetRenderFrameSize().

{
#if PTRACING
  unsigned oldWidth = frameWidth;
  unsigned oldHeight = frameHeight;
#endif

  unsigned minWidth, minHeight, maxWidth, maxHeight;
  GetFrameSizeLimits(minWidth, minHeight, maxWidth, maxHeight);

  if (width < minWidth)
    frameWidth = minWidth;
  else if (width > maxWidth)
    frameWidth = maxWidth;
  else
    frameWidth = width;

  if (height < minHeight)
    frameHeight = minHeight;
  else if (height > maxHeight)
    frameHeight = maxHeight;
  else
    frameHeight = height;

  if (converter != NULL) {
    if (!converter->SetSrcFrameSize(width, height) ||
        !converter->SetDstFrameSize(width, height, FALSE)) {
      PTRACE(1, "PVidDev\tSetFrameSize with converter failed with " << width << 'x' << height);
      return FALSE;
    }
  }

  PTRACE_IF(2, oldWidth != frameWidth || oldHeight != frameHeight,
            "PVidDev\tSetFrameSize to " << frameWidth << 'x' << frameHeight);
  return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index