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

QSize CVideoDevice::GetSize (  ) 

Return current size from the driver.

Returns:
An object of type QSize. Returns the current image size as reported by the device. Returns a size of (0, 0) when the device is closed or an error occured.

Definition at line 750 of file VideoDevice.cc.

Referenced by CDeltaPanel::CDeltaPanel(), CImagePanelRGB::CImagePanelRGB(), CImagePanelYUV::CImagePanelYUV(), Init(), and SetSize().

{
   struct video_window vwin;

   image_w = 0;
   image_h = 0;
   if (CamFD >= 0 && ioctl(CamFD, VIDIOCGWIN, &vwin) == 0) {
     image_w = vwin.width;
     image_h = vwin.height;
   }

//qDebug("CVideoDevice::GetSize() returns %dx%d", image_w, image_h);
//   yuv_image_size = image_w * image_h * 2; // for yuyv; yuv420p takes 1.5
//   rgb_image_size = image_w * image_h * 4;
   return QSize(image_w, image_h);
}


Generated by  Doxygen 1.6.0   Back to index