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

BOOL PVideoInputDevice_1394DC::SetFrameSizeConverter ( unsigned  width,
unsigned  height,
BOOL  bScaleNotCrop 
) [virtual]

Set the frame size to be used, trying converters if available.

If the device does not support the size, a set of alternate resolutions are attempted. A converter is setup if possible.

Parameters:
heightNew width of frame
bScaleNotCropNew height of frame Scale or crop/pad preference

Reimplemented from PVideoDevice.

Definition at line 788 of file video4dc1394.cxx.

References PColourConverter::Create(), SetFrameSize(), and PColourConverter::SetSrcFrameSize().

Referenced by SetColourFormatConverter().

{
  if (width == CIFWidth && height == CIFHeight && (supportedFormat & DC1394_FORMAT_320x240))
    SetFrameSize(320, 240);
  else if (width == QCIFWidth && height == QCIFHeight && (supportedFormat & DC1394_FORMAT_160x120))
    SetFrameSize(160, 120);
  else if (width == QCIFWidth && height == QCIFHeight && (supportedFormat & DC1394_FORMAT_320x240))
    SetFrameSize(320, 240);
  else if (width == CIFWidth && height == CIFHeight && (supportedFormat & DC1394_FORMAT_160x120))
    SetFrameSize(160, 120);
  else {
    PTRACE(1, width << "x" << height << " is not supported.");
    return FALSE;
  }

  if (converter != NULL) 
    delete converter;
  
  desiredFrameWidth = width;
  desiredFrameHeight = height;

  converter = PColourConverter::Create(colourFormat, desiredColourFormat, width, height);
  if (converter == NULL) {
    PTRACE(1, "Failed to make a converter.");
    return FALSE;
  }
  if (converter->SetSrcFrameSize(frameWidth, frameHeight) == FALSE) {
    PTRACE(1, "Failed to set source frame size of a converter.");
    return FALSE;
  }
  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index