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>


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
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
bool dodecode
int bpp
char deviceName [MAXINDIDEVICE]


class ::V4L2_Driver

Detailed Description

Definition at line 56 of file v4l2_base.h.

Member Enumeration Documentation


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 ( )

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)

Definition at line 963 of file v4l2_base.cpp.

void INDI::V4L2_Base::close_device ( )

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 

Definition at line 359 of file v4l2_base.cpp.

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

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 

Definition at line 343 of file v4l2_base.cpp.

void INDI::V4L2_Base::findMinMax ( )

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 ( )

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 

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)

Definition at line 1303 of file v4l2_base.cpp.

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

Definition at line 853 of file v4l2_base.cpp.

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

Definition at line 833 of file v4l2_base.cpp.

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

Definition at line 918 of file v4l2_base.cpp.

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

Definition at line 283 of file v4l2_base.cpp.

bool INDI::V4L2_Base::is_compressed ( ) const

Helper indicating whether current pixel format is compressed or not.

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

true if pixel format is considered compressed by the driver, else false.
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 ( )

Definition at line 140 of file v4l2_base.h.

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

Definition at line 801 of file v4l2_base.cpp.

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

Definition at line 1339 of file v4l2_base.cpp.

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

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)

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)

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 

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 ( )

Definition at line 1809 of file v4l2_base.cpp.

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

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)

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 

Definition at line 240 of file v4l2_base.cpp.

Friends And Related Function Documentation

friend class ::V4L2_Driver

Definition at line 215 of file v4l2_base.h.

Member Data Documentation

int INDI::V4L2_Base::bpp

Definition at line 213 of file v4l2_base.h.

struct v4l2_buffer INDI::V4L2_Base::buf

Definition at line 175 of file v4l2_base.h.

struct buffer* INDI::V4L2_Base::buffers

Definition at line 197 of file v4l2_base.h.

WPF* INDI::V4L2_Base::callback

Definition at line 191 of file v4l2_base.h.

bool INDI::V4L2_Base::cancrop

Definition at line 177 of file v4l2_base.h.

bool INDI::V4L2_Base::cansetrate

Definition at line 179 of file v4l2_base.h.

struct v4l2_capability INDI::V4L2_Base::cap

Definition at line 170 of file v4l2_base.h.

struct v4l2_crop INDI::V4L2_Base::crop

Definition at line 172 of file v4l2_base.h.

struct v4l2_cropcap INDI::V4L2_Base::cropcap

Definition at line 171 of file v4l2_base.h.

bool INDI::V4L2_Base::cropset

Definition at line 178 of file v4l2_base.h.

V4L2_Decoder* INDI::V4L2_Base::decoder

Definition at line 210 of file v4l2_base.h.

char INDI::V4L2_Base::dev_name[64]

Definition at line 193 of file v4l2_base.h.

char INDI::V4L2_Base::deviceName[MAXINDIDEVICE]

Definition at line 217 of file v4l2_base.h.

bool INDI::V4L2_Base::dodecode

Definition at line 211 of file v4l2_base.h.

int INDI::V4L2_Base::enumeratedCaptureFormats

Definition at line 163 of file v4l2_base.h.

int INDI::V4L2_Base::enumeratedInputs

Definition at line 162 of file v4l2_base.h.

int INDI::V4L2_Base::fd

Definition at line 196 of file v4l2_base.h.

struct v4l2_format INDI::V4L2_Base::fmt

Definition at line 173 of file v4l2_base.h.

struct v4l2_fract INDI::V4L2_Base::frameRate

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

Definition at line 187 of file v4l2_base.h.

struct v4l2_input INDI::V4L2_Base::input

Definition at line 174 of file v4l2_base.h.

io_method INDI::V4L2_Base::io

Definition at line 195 of file v4l2_base.h.

short INDI::V4L2_Base::lxstate

Definition at line 183 of file v4l2_base.h.

unsigned int INDI::V4L2_Base::n_buffers

Definition at line 198 of file v4l2_base.h.

const char* INDI::V4L2_Base::path

Definition at line 194 of file v4l2_base.h.

struct v4l2_queryctrl INDI::V4L2_Base::queryctrl

Definition at line 185 of file v4l2_base.h.

struct v4l2_querymenu INDI::V4L2_Base::querymenu

Definition at line 186 of file v4l2_base.h.

bool INDI::V4L2_Base::reallocate_buffers

Definition at line 199 of file v4l2_base.h.

int INDI::V4L2_Base::selectCallBackID

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

Definition at line 181 of file v4l2_base.h.

bool INDI::V4L2_Base::streamedonce

Definition at line 180 of file v4l2_base.h.

void* INDI::V4L2_Base::uptr

Definition at line 192 of file v4l2_base.h.

V4L2_Decode* INDI::V4L2_Base::v4l2_decode

Definition at line 209 of file v4l2_base.h.

int INDI::V4L2_Base::xmax

Definition at line 205 of file v4l2_base.h.

int INDI::V4L2_Base::xmin

Definition at line 205 of file v4l2_base.h.

int INDI::V4L2_Base::ymax

Definition at line 205 of file v4l2_base.h.

int INDI::V4L2_Base::ymin

Definition at line 205 of file v4l2_base.h.

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