Instrument Neutral Distributed Interface INDI  1.6.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
INDI::V4L2_Base Class Reference

#include <v4l2_base.h>

Classes

struct  buffer
 

Public Types

Public Member Functions

 V4L2_Base ()
 
virtual ~V4L2_Base ()
 
virtual int connectCam (const char *devpath, char *errmsg, int pixelFormat=-1, int width=-1, int height=-1)
 
virtual void disconnectCam (bool stopcapture)
 
char * getDeviceName ()
 
void setDeviceName (const char *name)
 
bool isLXmodCapable ()
 
void callFrame (void *p)
 
int getFormat ()
 
int getWidth ()
 
int getHeight ()
 
int getBpp ()
 
virtual int setSize (int x, int y)
 
virtual void getMaxMinSize (int &x_max, int &y_max, int &x_min, int &y_min)
 
unsigned char * getY ()
 
unsigned char * getU ()
 
unsigned char * getV ()
 
unsigned char * getRGBBuffer ()
 
float * getLinearY ()
 
void registerCallback (WPF *fp, void *ud)
 
int start_capturing (char *errmsg)
 
int stop_capturing (char *errmsg)
 
void enumerate_ctrl ()
 
void enumerate_menu ()
 
bool enumerate_ext_ctrl ()
 
int queryINTControls (INumberVectorProperty *nvp)
 
bool queryExtControls (INumberVectorProperty *nvp, unsigned int *nnumber, ISwitchVectorProperty **options, unsigned int *noptions, const char *dev, const char *group)
 
void queryControls (INumberVectorProperty *nvp, unsigned int *nnumber, ISwitchVectorProperty **options, unsigned int *noptions, const char *dev, const char *group)
 
int getControl (unsigned int ctrl_id, double *value, char *errmsg)
 
int setINTControl (unsigned int ctrl_id, double new_value, char *errmsg)
 
int setOPTControl (unsigned int ctrl_id, unsigned int new_value, char *errmsg)
 
int query_ctrl (unsigned int ctrl_id, double &ctrl_min, double &ctrl_max, double &ctrl_step, double &ctrl_value, char *errmsg)
 
void getinputs (ISwitchVectorProperty *inputssp)
 
int setinput (unsigned int inputindex, char *errmsg)
 
void getcaptureformats (ISwitchVectorProperty *captureformatssp)
 
int setcaptureformat (unsigned int captureformatindex, char *errmsg)
 
void getcapturesizes (ISwitchVectorProperty *capturesizessp, INumberVectorProperty *capturesizenp)
 
int setcapturesize (unsigned int w, unsigned int h, char *errmsg)
 
void getframerates (ISwitchVectorProperty *frameratessp, INumberVectorProperty *frameratenp)
 
int setcroprect (int x, int y, int w, int h, char *errmsg)
 
struct v4l2_rect getcroprect ()
 
void setColorProcessing (bool quantization, bool colorconvert, bool linearization)
 
void setlxstate (short s)
 
short getlxstate ()
 
bool isstreamactive ()
 
void doDecode (bool)
 

Static Public Member Functions

static void newFrame (int fd, void *p)
 

Public Attributes

int(V4L2_Base::* setframerate )(struct v4l2_fract frate, char *errmsg)
 
struct v4l2_fract(V4L2_Base::* getframerate )()
 

Protected Member Functions

int xioctl (int fd, int request, void *arg, char const *const request_str)
 
int ioctl_set_format (struct v4l2_format new_fmt, char *errmsg)
 
int read_frame (char *errsg)
 
int uninit_device (char *errmsg)
 
int open_device (const char *devpath, char *errmsg)
 
int check_device (char *errmsg)
 
int init_device (char *errmsg)
 
int init_mmap (char *errmsg)
 
int errno_exit (const char *s, char *errmsg)
 
void close_device ()
 
void init_userp (unsigned int buffer_size)
 
void init_read (unsigned int buffer_size)
 
void findMinMax ()
 
int stdsetframerate (struct v4l2_fract frate, char *errmsg)
 
int pwcsetframerate (struct v4l2_fract frate, char *errmsg)
 
struct v4l2_fract stdgetframerate ()
 
bool is_compressed () const
 Helper indicating whether current pixel format is compressed or not. More...
 

Protected Attributes

int enumeratedInputs
 
int enumeratedCaptureFormats
 
struct v4l2_capability cap
 
struct v4l2_cropcap cropcap
 
struct v4l2_crop crop
 
struct v4l2_format fmt
 
struct v4l2_input input
 
struct v4l2_buffer buf
 
bool cancrop
 
bool cropset
 
bool cansetrate
 
bool streamedonce
 
bool streamactive
 
short lxstate
 
struct v4l2_queryctrl queryctrl
 
struct v4l2_querymenu querymenu
 
bool has_ext_pix_format
 
WPFcallback
 
void * uptr
 
char dev_name [64]
 
const char * path
 
io_method io
 
int fd
 
struct bufferbuffers
 
unsigned int n_buffers
 
bool reallocate_buffers
 
struct v4l2_fract frameRate
 
int xmax
 
int xmin
 
int ymax
 
int ymin
 
int selectCallBackID
 
V4L2_Decodev4l2_decode
 
V4L2_Decoderdecoder
 
bool dodecode
 
int bpp
 
char deviceName [MAXINDIDEVICE]
 

Friends

class ::V4L2_Driver
 

Detailed Description

Definition at line 56 of file v4l2_base.h.

Member Enumeration Documentation

Enumerator
IO_METHOD_READ 
IO_METHOD_MMAP 
IO_METHOD_USERPTR 

Definition at line 62 of file v4l2_base.h.

Constructor & Destructor Documentation

INDI::V4L2_Base::V4L2_Base ( )

Definition at line 130 of file v4l2_base.cpp.

INDI::V4L2_Base::~V4L2_Base ( )
virtual

Definition at line 180 of file v4l2_base.cpp.

Member Function Documentation

void INDI::V4L2_Base::callFrame ( void *  p)
int INDI::V4L2_Base::check_device ( char *  errmsg)
protected

Definition at line 963 of file v4l2_base.cpp.

void INDI::V4L2_Base::close_device ( )
protected

Definition at line 1328 of file v4l2_base.cpp.

int INDI::V4L2_Base::connectCam ( const char *  devpath,
char *  errmsg,
int  pixelFormat = -1,
int  width = -1,
int  height = -1 
)
virtual

Definition at line 359 of file v4l2_base.cpp.

void INDI::V4L2_Base::disconnectCam ( bool  stopcapture)
virtual

Definition at line 383 of file v4l2_base.cpp.

void INDI::V4L2_Base::doDecode ( bool  d)

Definition at line 354 of file v4l2_base.cpp.

void INDI::V4L2_Base::enumerate_ctrl ( )

Definition at line 1951 of file v4l2_base.cpp.

bool INDI::V4L2_Base::enumerate_ext_ctrl ( )

Definition at line 2642 of file v4l2_base.cpp.

void INDI::V4L2_Base::enumerate_menu ( )

Definition at line 2028 of file v4l2_base.cpp.

int INDI::V4L2_Base::errno_exit ( const char *  s,
char *  errmsg 
)
protected

Definition at line 343 of file v4l2_base.cpp.

void INDI::V4L2_Base::findMinMax ( )
protected

Definition at line 1912 of file v4l2_base.cpp.

int INDI::V4L2_Base::getBpp ( )

Definition at line 1758 of file v4l2_base.cpp.

void INDI::V4L2_Base::getcaptureformats ( ISwitchVectorProperty captureformatssp)

Definition at line 1451 of file v4l2_base.cpp.

void INDI::V4L2_Base::getcapturesizes ( ISwitchVectorProperty capturesizessp,
INumberVectorProperty capturesizenp 
)

Definition at line 1526 of file v4l2_base.cpp.

int INDI::V4L2_Base::getControl ( unsigned int  ctrl_id,
double *  value,
char *  errmsg 
)

Definition at line 2557 of file v4l2_base.cpp.

struct v4l2_rect INDI::V4L2_Base::getcroprect ( )

Definition at line 1768 of file v4l2_base.cpp.

char * INDI::V4L2_Base::getDeviceName ( )

Definition at line 1828 of file v4l2_base.cpp.

int INDI::V4L2_Base::getFormat ( )

Definition at line 1763 of file v4l2_base.cpp.

void INDI::V4L2_Base::getframerates ( ISwitchVectorProperty frameratessp,
INumberVectorProperty frameratenp 
)

Definition at line 1611 of file v4l2_base.cpp.

int INDI::V4L2_Base::getHeight ( )

Definition at line 1750 of file v4l2_base.cpp.

void INDI::V4L2_Base::getinputs ( ISwitchVectorProperty inputssp)

Definition at line 1379 of file v4l2_base.cpp.

float * INDI::V4L2_Base::getLinearY ( )

Definition at line 1901 of file v4l2_base.cpp.

short INDI::V4L2_Base::getlxstate ( )
inline

Definition at line 139 of file v4l2_base.h.

void INDI::V4L2_Base::getMaxMinSize ( int &  x_max,
int &  y_max,
int &  x_min,
int &  y_min 
)
virtual

Definition at line 1833 of file v4l2_base.cpp.

unsigned char * INDI::V4L2_Base::getRGBBuffer ( )

Definition at line 1896 of file v4l2_base.cpp.

unsigned char * INDI::V4L2_Base::getU ( )

Definition at line 1881 of file v4l2_base.cpp.

unsigned char * INDI::V4L2_Base::getV ( )

Definition at line 1886 of file v4l2_base.cpp.

int INDI::V4L2_Base::getWidth ( )

Definition at line 1742 of file v4l2_base.cpp.

unsigned char * INDI::V4L2_Base::getY ( )

Definition at line 1876 of file v4l2_base.cpp.

int INDI::V4L2_Base::init_device ( char *  errmsg)
protected

Definition at line 1303 of file v4l2_base.cpp.

int INDI::V4L2_Base::init_mmap ( char *  errmsg)
protected

Definition at line 853 of file v4l2_base.cpp.

void INDI::V4L2_Base::init_read ( unsigned int  buffer_size)
protected

Definition at line 833 of file v4l2_base.cpp.

void INDI::V4L2_Base::init_userp ( unsigned int  buffer_size)
protected

Definition at line 918 of file v4l2_base.cpp.

int INDI::V4L2_Base::ioctl_set_format ( struct v4l2_format  new_fmt,
char *  errmsg 
)
protected

Definition at line 283 of file v4l2_base.cpp.

bool INDI::V4L2_Base::is_compressed ( ) const
protected

Helper indicating whether current pixel format is compressed or not.

This function is used in read_frame to check for corrupted frames.

Returns
true if pixel format is considered compressed by the driver, else false.
Warning
If kernel headers 3.17 or later are available, this function will rely on field 'flags', else will compare the current pixel format against an arbitrary list of known format codes.

Definition at line 196 of file v4l2_base.cpp.

bool INDI::V4L2_Base::isLXmodCapable ( )

Definition at line 400 of file v4l2_base.cpp.

bool INDI::V4L2_Base::isstreamactive ( )
inline

Definition at line 140 of file v4l2_base.h.

void INDI::V4L2_Base::newFrame ( int  fd,
void *  p 
)
static

Definition at line 801 of file v4l2_base.cpp.

int INDI::V4L2_Base::open_device ( const char *  devpath,
char *  errmsg 
)
protected

Definition at line 1339 of file v4l2_base.cpp.

int INDI::V4L2_Base::pwcsetframerate ( struct v4l2_fract  frate,
char *  errmsg 
)
protected

Definition at line 1794 of file v4l2_base.cpp.

int INDI::V4L2_Base::query_ctrl ( unsigned int  ctrl_id,
double &  ctrl_min,
double &  ctrl_max,
double &  ctrl_step,
double &  ctrl_value,
char *  errmsg 
)

Definition at line 2066 of file v4l2_base.cpp.

void INDI::V4L2_Base::queryControls ( INumberVectorProperty nvp,
unsigned int *  nnumber,
ISwitchVectorProperty **  options,
unsigned int *  noptions,
const char *  dev,
const char *  group 
)

Definition at line 2112 of file v4l2_base.cpp.

bool INDI::V4L2_Base::queryExtControls ( INumberVectorProperty nvp,
unsigned int *  nnumber,
ISwitchVectorProperty **  options,
unsigned int *  noptions,
const char *  dev,
const char *  group 
)

Definition at line 2692 of file v4l2_base.cpp.

int INDI::V4L2_Base::queryINTControls ( INumberVectorProperty nvp)

Definition at line 2444 of file v4l2_base.cpp.

int INDI::V4L2_Base::read_frame ( char *  errsg)
protected

Definition at line 462 of file v4l2_base.cpp.

void INDI::V4L2_Base::registerCallback ( WPF fp,
void *  ud 
)

Definition at line 1906 of file v4l2_base.cpp.

int INDI::V4L2_Base::setcaptureformat ( unsigned int  captureformatindex,
char *  errmsg 
)

Definition at line 1515 of file v4l2_base.cpp.

int INDI::V4L2_Base::setcapturesize ( unsigned int  w,
unsigned int  h,
char *  errmsg 
)

Definition at line 1601 of file v4l2_base.cpp.

void INDI::V4L2_Base::setColorProcessing ( bool  quantization,
bool  colorconvert,
bool  linearization 
)

Definition at line 1868 of file v4l2_base.cpp.

int INDI::V4L2_Base::setcroprect ( int  x,
int  y,
int  w,
int  h,
char *  errmsg 
)

Definition at line 1683 of file v4l2_base.cpp.

void INDI::V4L2_Base::setDeviceName ( const char *  name)

Definition at line 2911 of file v4l2_base.cpp.

int INDI::V4L2_Base::setinput ( unsigned int  inputindex,
char *  errmsg 
)

Definition at line 1421 of file v4l2_base.cpp.

int INDI::V4L2_Base::setINTControl ( unsigned int  ctrl_id,
double  new_value,
char *  errmsg 
)

Definition at line 2570 of file v4l2_base.cpp.

void INDI::V4L2_Base::setlxstate ( short  s)
inline

Definition at line 134 of file v4l2_base.h.

int INDI::V4L2_Base::setOPTControl ( unsigned int  ctrl_id,
unsigned int  new_value,
char *  errmsg 
)

Definition at line 2606 of file v4l2_base.cpp.

int INDI::V4L2_Base::setSize ( int  x,
int  y 
)
virtual

Definition at line 1847 of file v4l2_base.cpp.

int INDI::V4L2_Base::start_capturing ( char *  errmsg)

Definition at line 733 of file v4l2_base.cpp.

struct v4l2_fract INDI::V4L2_Base::stdgetframerate ( )
protected

Definition at line 1809 of file v4l2_base.cpp.

int INDI::V4L2_Base::stdsetframerate ( struct v4l2_fract  frate,
char *  errmsg 
)
protected

Definition at line 1773 of file v4l2_base.cpp.

int INDI::V4L2_Base::stop_capturing ( char *  errmsg)

Definition at line 698 of file v4l2_base.cpp.

int INDI::V4L2_Base::uninit_device ( char *  errmsg)
protected

Definition at line 808 of file v4l2_base.cpp.

int INDI::V4L2_Base::xioctl ( int  fd,
int  request,
void *  arg,
char const *const  request_str 
)
protected

Definition at line 240 of file v4l2_base.cpp.

Friends And Related Function Documentation

friend class ::V4L2_Driver
friend

Definition at line 215 of file v4l2_base.h.

Member Data Documentation

int INDI::V4L2_Base::bpp
protected

Definition at line 213 of file v4l2_base.h.

struct v4l2_buffer INDI::V4L2_Base::buf
protected

Definition at line 175 of file v4l2_base.h.

struct buffer* INDI::V4L2_Base::buffers
protected

Definition at line 197 of file v4l2_base.h.

WPF* INDI::V4L2_Base::callback
protected

Definition at line 191 of file v4l2_base.h.

bool INDI::V4L2_Base::cancrop
protected

Definition at line 177 of file v4l2_base.h.

bool INDI::V4L2_Base::cansetrate
protected

Definition at line 179 of file v4l2_base.h.

struct v4l2_capability INDI::V4L2_Base::cap
protected

Definition at line 170 of file v4l2_base.h.

struct v4l2_crop INDI::V4L2_Base::crop
protected

Definition at line 172 of file v4l2_base.h.

struct v4l2_cropcap INDI::V4L2_Base::cropcap
protected

Definition at line 171 of file v4l2_base.h.

bool INDI::V4L2_Base::cropset
protected

Definition at line 178 of file v4l2_base.h.

V4L2_Decoder* INDI::V4L2_Base::decoder
protected

Definition at line 210 of file v4l2_base.h.

char INDI::V4L2_Base::dev_name[64]
protected

Definition at line 193 of file v4l2_base.h.

char INDI::V4L2_Base::deviceName[MAXINDIDEVICE]
protected

Definition at line 217 of file v4l2_base.h.

bool INDI::V4L2_Base::dodecode
protected

Definition at line 211 of file v4l2_base.h.

int INDI::V4L2_Base::enumeratedCaptureFormats
protected

Definition at line 163 of file v4l2_base.h.

int INDI::V4L2_Base::enumeratedInputs
protected

Definition at line 162 of file v4l2_base.h.

int INDI::V4L2_Base::fd
protected

Definition at line 196 of file v4l2_base.h.

struct v4l2_format INDI::V4L2_Base::fmt
protected

Definition at line 173 of file v4l2_base.h.

struct v4l2_fract INDI::V4L2_Base::frameRate
protected

Definition at line 204 of file v4l2_base.h.

struct v4l2_fract(V4L2_Base::* INDI::V4L2_Base::getframerate) ()

Definition at line 90 of file v4l2_base.h.

bool INDI::V4L2_Base::has_ext_pix_format
protected

Definition at line 187 of file v4l2_base.h.

struct v4l2_input INDI::V4L2_Base::input
protected

Definition at line 174 of file v4l2_base.h.

io_method INDI::V4L2_Base::io
protected

Definition at line 195 of file v4l2_base.h.

short INDI::V4L2_Base::lxstate
protected

Definition at line 183 of file v4l2_base.h.

unsigned int INDI::V4L2_Base::n_buffers
protected

Definition at line 198 of file v4l2_base.h.

const char* INDI::V4L2_Base::path
protected

Definition at line 194 of file v4l2_base.h.

struct v4l2_queryctrl INDI::V4L2_Base::queryctrl
protected

Definition at line 185 of file v4l2_base.h.

struct v4l2_querymenu INDI::V4L2_Base::querymenu
protected

Definition at line 186 of file v4l2_base.h.

bool INDI::V4L2_Base::reallocate_buffers
protected

Definition at line 199 of file v4l2_base.h.

int INDI::V4L2_Base::selectCallBackID
protected

Definition at line 206 of file v4l2_base.h.

int(V4L2_Base::* INDI::V4L2_Base::setframerate) (struct v4l2_fract frate, char *errmsg)

Definition at line 89 of file v4l2_base.h.

bool INDI::V4L2_Base::streamactive
protected

Definition at line 181 of file v4l2_base.h.

bool INDI::V4L2_Base::streamedonce
protected

Definition at line 180 of file v4l2_base.h.

void* INDI::V4L2_Base::uptr
protected

Definition at line 192 of file v4l2_base.h.

V4L2_Decode* INDI::V4L2_Base::v4l2_decode
protected

Definition at line 209 of file v4l2_base.h.

int INDI::V4L2_Base::xmax
protected

Definition at line 205 of file v4l2_base.h.

int INDI::V4L2_Base::xmin
protected

Definition at line 205 of file v4l2_base.h.

int INDI::V4L2_Base::ymax
protected

Definition at line 205 of file v4l2_base.h.

int INDI::V4L2_Base::ymin
protected

Definition at line 205 of file v4l2_base.h.


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