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:
widthNew width of frame
heightNew height of frame

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

Definition at line 808 of file videoio.cxx.

Referenced by PVideoInputDevice_BeOSVideo::SetFrameSize(), PVideoInputDevice_VideoForWindows::SetFrameSize(), PVideoOutputDeviceRGB::SetFrameSize(), PVideoInputDevice_FakeVideo::SetFrameSize(), PVideoInputDevice_V4L2::SetFrameSize(), PVideoInputDevice_V4L::SetFrameSize(), PVideoInputDevice_BSDCAPTURE::SetFrameSize(), 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;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index