EyaVideoPreview Class Reference

Video preview class. More...

#include <eyasetuptab.h>

Collaboration diagram for EyaVideoPreview:

Collaboration graph
[legend]

List of all members.

Public Slots

void slotStartCapture ()
 Function called by pressing the start capture button.
void slotStopCapture ()
 Function called by pressing the stop capture button (the same button as start capture).

Public Member Functions

 EyaVideoPreview (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructor.
 ~EyaVideoPreview ()
 Destructor.
virtual void paintEvent (QPaintEvent *e)
void setVideoDevice (QString)
 This function sets the camera device used as input.

Private Types

enum  VIDEO_STATUS { NONE, OPEN_DEVICE, INIT_DEVICE, START_CAPTURE }

Private Slots

void read_frame ()
 To get the acquired frame v4l2.
void read_frameV4L1 ()
 To get the acquired frame v4l1.

Private Member Functions

int xioctl (int, int, void *)
 ioctl used by v4l2
bool start_capturingV4L1 ()
 It starts v4l1 capture.
bool start_capturing ()
 It starts v4l2 capture.
bool stop_capturingV4L1 ()
 It stops v4l1 capture.
bool stop_capturing ()
 It stops v4l2 capture.
bool uninit_device ()
 Uninit v4l2 device.
bool uninit_deviceV4L1 ()
 Uninit v4l1 device.
bool init_mmap ()
 Memory mapping for v4l2 device.
bool init_device ()
 Init v4l2 device.
bool init_deviceV4L1 ()
 Init v4l1 device.
bool open_device ()
bool close_device ()
void process_image (const void *)
 This functions converts the image from yuv to rgb format v4l2.
void process_imageV4L1 (const unsigned char *)
 This functions converts the image from yuv to rgb format v4l1.
bool checkPixelFormat ()
 Check the current pixel format.
bool checkV4LVersion ()
 Search for the v4lx version.
QRgb yuv2rgb (int, int, int)
 yuv to rgb conversion
int clamp (double)
 This functions saturates the pixels values.

Private Attributes

QString deviceName
 The name of the video device.
QImage * imageToShow
 This is the frame to be shown.
int fd
unsigned int n_buffers
int read_video_width
int read_video_height
struct bufferbuffers
 Frames buffer.
QTimer * refreshTimer
 Timer to refresh the captured image.
int status
uint32_t currentPixelFormat
 This identifies the pixel format used.
bool isV4L1
 Flag to signal video4linux1.
struct video_capability capV4L1
 v4l1 video capabilities
struct video_window winV4L1
struct video_picture vpicV4L1
unsigned char * bufferV4L1
int bppV4L1

Static Private Attributes

static uint32_t supportedPixelFormat [NUM_FORMATS]
 List of supported pixel formats.


Detailed Description

Video preview class.

This class provides the access to the v4l2 and v4l cameras. The class open the device, starts the acquisition, stops the acquisition and close the device.


Member Enumeration Documentation

Enumerator:
NONE 
OPEN_DEVICE 
INIT_DEVICE 
START_CAPTURE 


Constructor & Destructor Documentation

EyaVideoPreview::EyaVideoPreview ( QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

Constructor.

Video preview.

EyaVideoPreview::~EyaVideoPreview (  ) 

Destructor.


Member Function Documentation

bool EyaVideoPreview::checkPixelFormat (  )  [private]

Check the current pixel format.

bool EyaVideoPreview::checkV4LVersion (  )  [private]

Search for the v4lx version.

int EyaVideoPreview::clamp ( double  x  )  [inline, private]

This functions saturates the pixels values.

bool EyaVideoPreview::close_device (  )  [private]

bool EyaVideoPreview::init_device (  )  [private]

Init v4l2 device.

bool EyaVideoPreview::init_deviceV4L1 (  )  [private]

Init v4l1 device.

bool EyaVideoPreview::init_mmap (  )  [private]

Memory mapping for v4l2 device.

bool EyaVideoPreview::open_device (  )  [private]

void EyaVideoPreview::paintEvent ( QPaintEvent *  e  )  [virtual]

void EyaVideoPreview::process_image ( const void *  im  )  [private]

This functions converts the image from yuv to rgb format v4l2.

void EyaVideoPreview::process_imageV4L1 ( const unsigned char *  buf  )  [private]

This functions converts the image from yuv to rgb format v4l1.

void EyaVideoPreview::read_frame (  )  [private, slot]

To get the acquired frame v4l2.

void EyaVideoPreview::read_frameV4L1 (  )  [private, slot]

To get the acquired frame v4l1.

void EyaVideoPreview::setVideoDevice ( QString  dev  ) 

This function sets the camera device used as input.

void EyaVideoPreview::slotStartCapture (  )  [slot]

Function called by pressing the start capture button.

void EyaVideoPreview::slotStopCapture (  )  [slot]

Function called by pressing the stop capture button (the same button as start capture).

bool EyaVideoPreview::start_capturing (  )  [private]

It starts v4l2 capture.

bool EyaVideoPreview::start_capturingV4L1 (  )  [private]

It starts v4l1 capture.

bool EyaVideoPreview::stop_capturing (  )  [private]

It stops v4l2 capture.

bool EyaVideoPreview::stop_capturingV4L1 (  )  [private]

It stops v4l1 capture.

bool EyaVideoPreview::uninit_device (  )  [private]

Uninit v4l2 device.

bool EyaVideoPreview::uninit_deviceV4L1 (  )  [private]

Uninit v4l1 device.

int EyaVideoPreview::xioctl ( int  fd,
int  request,
void *  arg 
) [private]

ioctl used by v4l2

QRgb EyaVideoPreview::yuv2rgb ( int  Y1,
int  Cb,
int  Cr 
) [inline, private]

yuv to rgb conversion


Member Data Documentation

int EyaVideoPreview::bppV4L1 [private]

struct buffer* EyaVideoPreview::buffers [read, private]

Frames buffer.

unsigned char* EyaVideoPreview::bufferV4L1 [private]

struct video_capability EyaVideoPreview::capV4L1 [read, private]

v4l1 video capabilities

This identifies the pixel format used.

QString EyaVideoPreview::deviceName [private]

The name of the video device.

int EyaVideoPreview::fd [private]

QImage* EyaVideoPreview::imageToShow [private]

This is the frame to be shown.

bool EyaVideoPreview::isV4L1 [private]

Flag to signal video4linux1.

unsigned int EyaVideoPreview::n_buffers [private]

QTimer* EyaVideoPreview::refreshTimer [private]

Timer to refresh the captured image.

int EyaVideoPreview::status [private]

uint32_t EyaVideoPreview::supportedPixelFormat [static, private]

Initial value:

                                                                                                                                                {       V4L2_PIX_FMT_YUV420,
                                                                                                                                                        V4L2_PIX_FMT_YUYV,
                                                                                                                                                        V4L2_PIX_FMT_YUV422P }
List of supported pixel formats.

struct video_picture EyaVideoPreview::vpicV4L1 [read, private]

struct video_window EyaVideoPreview::winV4L1 [read, private]


The documentation for this class was generated from the following files:

Generated on Mon Aug 24 14:01:42 2009 for openeya by  doxygen 1.5.8