Instrument Neutral Distributed Interface INDI
2.0.2
|
#include <v4l2_base.h>
Classes | |
struct | buffer |
Public Types | |
enum | io_method { IO_METHOD_READ , IO_METHOD_MMAP , IO_METHOD_USERPTR } |
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 () |
void | setNative (bool value) |
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 * | getMJPEGBuffer (int &size) |
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 std::map< std::string, std::string > | enumerate () |
static int | video_dev_file_select (const dirent *entry) |
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 |
WPF * | callback |
void * | uptr |
char | dev_name [64] |
const char * | path |
bool | m_Native {false} |
io_method | io |
int | fd |
struct buffer * | buffers |
unsigned int | n_buffers |
bool | reallocate_buffers |
struct v4l2_fract | frameRate |
int | xmax |
int | xmin |
int | ymax |
int | ymin |
int | selectCallBackID |
V4L2_Decode * | v4l2_decode |
V4L2_Decoder * | decoder |
bool | dodecode |
int | bpp |
char | deviceName [MAXINDIDEVICE] |
Friends | |
class | ::V4L2_Driver |
Definition at line 58 of file v4l2_base.h.
Enumerator | |
---|---|
IO_METHOD_READ | |
IO_METHOD_MMAP | |
IO_METHOD_USERPTR |
Definition at line 64 of file v4l2_base.h.
INDI::V4L2_Base::V4L2_Base | ( | ) |
Definition at line 135 of file v4l2_base.cpp.
|
virtual |
Definition at line 185 of file v4l2_base.cpp.
void INDI::V4L2_Base::callFrame | ( | void * | p | ) |
|
protected |
Definition at line 970 of file v4l2_base.cpp.
|
protected |
Definition at line 1335 of file v4l2_base.cpp.
|
virtual |
Definition at line 365 of file v4l2_base.cpp.
|
virtual |
Definition at line 389 of file v4l2_base.cpp.
void INDI::V4L2_Base::doDecode | ( | bool | d | ) |
Definition at line 360 of file v4l2_base.cpp.
|
static |
Find all /dev/videoXXX devices and open them one by one to query the common of the device. We use this later to match against the device label so that we can automatically open the desired device automatically without having to manually set the device port manually. return a map of pairs common_name:device_path (e.g. {"Logitech D9000", "/dev/video3"})
Definition at line 2991 of file v4l2_base.cpp.
void INDI::V4L2_Base::enumerate_ctrl | ( | ) |
Definition at line 2018 of file v4l2_base.cpp.
bool INDI::V4L2_Base::enumerate_ext_ctrl | ( | ) |
Definition at line 2709 of file v4l2_base.cpp.
void INDI::V4L2_Base::enumerate_menu | ( | ) |
Definition at line 2095 of file v4l2_base.cpp.
|
protected |
Definition at line 349 of file v4l2_base.cpp.
|
protected |
Definition at line 1979 of file v4l2_base.cpp.
int INDI::V4L2_Base::getBpp | ( | ) |
Definition at line 1825 of file v4l2_base.cpp.
void INDI::V4L2_Base::getcaptureformats | ( | ISwitchVectorProperty * | captureformatssp | ) |
Definition at line 1458 of file v4l2_base.cpp.
void INDI::V4L2_Base::getcapturesizes | ( | ISwitchVectorProperty * | capturesizessp, |
INumberVectorProperty * | capturesizenp | ||
) |
Definition at line 1533 of file v4l2_base.cpp.
int INDI::V4L2_Base::getControl | ( | unsigned int | ctrl_id, |
double * | value, | ||
char * | errmsg | ||
) |
Definition at line 2624 of file v4l2_base.cpp.
struct v4l2_rect INDI::V4L2_Base::getcroprect | ( | ) |
Definition at line 1830 of file v4l2_base.cpp.
char * INDI::V4L2_Base::getDeviceName | ( | ) |
Definition at line 1895 of file v4l2_base.cpp.
int INDI::V4L2_Base::getFormat | ( | ) |
Definition at line 1830 of file v4l2_base.cpp.
void INDI::V4L2_Base::getframerates | ( | ISwitchVectorProperty * | frameratessp, |
INumberVectorProperty * | frameratenp | ||
) |
Definition at line 1622 of file v4l2_base.cpp.
int INDI::V4L2_Base::getHeight | ( | ) |
Definition at line 1817 of file v4l2_base.cpp.
void INDI::V4L2_Base::getinputs | ( | ISwitchVectorProperty * | inputssp | ) |
Definition at line 1386 of file v4l2_base.cpp.
float * INDI::V4L2_Base::getLinearY | ( | ) |
Definition at line 1968 of file v4l2_base.cpp.
|
inline |
Definition at line 145 of file v4l2_base.h.
|
virtual |
Definition at line 1900 of file v4l2_base.cpp.
unsigned char * INDI::V4L2_Base::getMJPEGBuffer | ( | int & | size | ) |
Definition at line 1958 of file v4l2_base.cpp.
unsigned char * INDI::V4L2_Base::getRGBBuffer | ( | ) |
Definition at line 1963 of file v4l2_base.cpp.
unsigned char * INDI::V4L2_Base::getU | ( | ) |
Definition at line 1948 of file v4l2_base.cpp.
unsigned char * INDI::V4L2_Base::getV | ( | ) |
Definition at line 1953 of file v4l2_base.cpp.
int INDI::V4L2_Base::getWidth | ( | ) |
Definition at line 1809 of file v4l2_base.cpp.
unsigned char * INDI::V4L2_Base::getY | ( | ) |
Definition at line 1943 of file v4l2_base.cpp.
|
protected |
Definition at line 1310 of file v4l2_base.cpp.
|
protected |
Definition at line 860 of file v4l2_base.cpp.
|
protected |
Definition at line 840 of file v4l2_base.cpp.
|
protected |
Definition at line 925 of file v4l2_base.cpp.
|
protected |
Definition at line 289 of file v4l2_base.cpp.
|
protected |
Helper indicating whether current pixel format is compressed or not.
This function is used in read_frame to check for corrupted frames.
Definition at line 201 of file v4l2_base.cpp.
bool INDI::V4L2_Base::isLXmodCapable | ( | ) |
Definition at line 407 of file v4l2_base.cpp.
|
inline |
Definition at line 149 of file v4l2_base.h.
|
static |
Definition at line 808 of file v4l2_base.cpp.
|
protected |
Definition at line 1346 of file v4l2_base.cpp.
|
protected |
Definition at line 1861 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 2133 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 2179 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 2759 of file v4l2_base.cpp.
int INDI::V4L2_Base::queryINTControls | ( | INumberVectorProperty * | nvp | ) |
Definition at line 2511 of file v4l2_base.cpp.
|
protected |
Definition at line 469 of file v4l2_base.cpp.
void INDI::V4L2_Base::registerCallback | ( | WPF * | fp, |
void * | ud | ||
) |
Definition at line 1973 of file v4l2_base.cpp.
int INDI::V4L2_Base::setcaptureformat | ( | unsigned int | captureformatindex, |
char * | errmsg | ||
) |
Definition at line 1522 of file v4l2_base.cpp.
int INDI::V4L2_Base::setcapturesize | ( | unsigned int | w, |
unsigned int | h, | ||
char * | errmsg | ||
) |
Definition at line 1612 of file v4l2_base.cpp.
void INDI::V4L2_Base::setColorProcessing | ( | bool | quantization, |
bool | colorconvert, | ||
bool | linearization | ||
) |
Definition at line 1935 of file v4l2_base.cpp.
int INDI::V4L2_Base::setcroprect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
char * | errmsg | ||
) |
Definition at line 1694 of file v4l2_base.cpp.
void INDI::V4L2_Base::setDeviceName | ( | const char * | name | ) |
Definition at line 2978 of file v4l2_base.cpp.
int INDI::V4L2_Base::setinput | ( | unsigned int | inputindex, |
char * | errmsg | ||
) |
Definition at line 1428 of file v4l2_base.cpp.
int INDI::V4L2_Base::setINTControl | ( | unsigned int | ctrl_id, |
double | new_value, | ||
char * | errmsg | ||
) |
Definition at line 2637 of file v4l2_base.cpp.
|
inline |
Definition at line 140 of file v4l2_base.h.
|
inline |
Definition at line 91 of file v4l2_base.h.
int INDI::V4L2_Base::setOPTControl | ( | unsigned int | ctrl_id, |
unsigned int | new_value, | ||
char * | errmsg | ||
) |
Definition at line 2673 of file v4l2_base.cpp.
|
virtual |
Definition at line 1914 of file v4l2_base.cpp.
int INDI::V4L2_Base::start_capturing | ( | char * | errmsg | ) |
Definition at line 740 of file v4l2_base.cpp.
|
protected |
Definition at line 1861 of file v4l2_base.cpp.
|
protected |
Definition at line 1840 of file v4l2_base.cpp.
int INDI::V4L2_Base::stop_capturing | ( | char * | errmsg | ) |
Definition at line 705 of file v4l2_base.cpp.
|
protected |
Definition at line 815 of file v4l2_base.cpp.
|
static |
Definition at line 3041 of file v4l2_base.cpp.
|
protected |
Definition at line 245 of file v4l2_base.cpp.
|
friend |
Definition at line 228 of file v4l2_base.h.
|
protected |
Definition at line 226 of file v4l2_base.h.
|
protected |
Definition at line 179 of file v4l2_base.h.
|
protected |
Definition at line 210 of file v4l2_base.h.
|
protected |
Definition at line 203 of file v4l2_base.h.
|
protected |
Definition at line 189 of file v4l2_base.h.
|
protected |
Definition at line 191 of file v4l2_base.h.
|
protected |
Definition at line 179 of file v4l2_base.h.
|
protected |
Definition at line 179 of file v4l2_base.h.
|
protected |
Definition at line 179 of file v4l2_base.h.
|
protected |
Definition at line 190 of file v4l2_base.h.
|
protected |
Definition at line 223 of file v4l2_base.h.
|
protected |
Definition at line 205 of file v4l2_base.h.
|
protected |
Definition at line 230 of file v4l2_base.h.
|
protected |
Definition at line 224 of file v4l2_base.h.
|
protected |
Definition at line 175 of file v4l2_base.h.
|
protected |
Definition at line 174 of file v4l2_base.h.
|
protected |
Definition at line 209 of file v4l2_base.h.
|
protected |
Definition at line 179 of file v4l2_base.h.
|
protected |
Definition at line 212 of file v4l2_base.h.
struct v4l2_fract(V4L2_Base::* INDI::V4L2_Base::getframerate) () |
Definition at line 96 of file v4l2_base.h.
|
protected |
Definition at line 199 of file v4l2_base.h.
|
protected |
Definition at line 179 of file v4l2_base.h.
|
protected |
Definition at line 208 of file v4l2_base.h.
|
protected |
Definition at line 195 of file v4l2_base.h.
|
protected |
Definition at line 207 of file v4l2_base.h.
|
protected |
Definition at line 211 of file v4l2_base.h.
|
protected |
Definition at line 206 of file v4l2_base.h.
|
protected |
Definition at line 195 of file v4l2_base.h.
|
protected |
Definition at line 195 of file v4l2_base.h.
|
protected |
Definition at line 212 of file v4l2_base.h.
|
protected |
Definition at line 219 of file v4l2_base.h.
int(V4L2_Base::* INDI::V4L2_Base::setframerate) (struct v4l2_fract frate, char *errmsg) |
Definition at line 96 of file v4l2_base.h.
|
protected |
Definition at line 193 of file v4l2_base.h.
|
protected |
Definition at line 192 of file v4l2_base.h.
|
protected |
Definition at line 204 of file v4l2_base.h.
|
protected |
Definition at line 222 of file v4l2_base.h.
|
protected |
Definition at line 218 of file v4l2_base.h.
|
protected |
Definition at line 218 of file v4l2_base.h.
|
protected |
Definition at line 218 of file v4l2_base.h.
|
protected |
Definition at line 218 of file v4l2_base.h.