42 #include <linux/videodev2.h>
44 #define VIDEO_COMPRESSION_LEVEL 4
73 virtual int connectCam(
const char *devpath,
char *errmsg,
int pixelFormat = -1,
int width = -1,
int height = -1);
83 static std::map<std::string, std::string>
enumerate();
92 virtual int setSize(
int x,
int y);
93 virtual void getMaxMinSize(
int &x_max,
int &y_max,
int &x_min,
int &y_min);
99 unsigned char *
getY();
100 unsigned char *
getU();
101 unsigned char *
getV();
110 static void
newFrame(int fd, void *p);
117 bool
queryExtControls(INumberVectorProperty *nvp, unsigned int *nnumber, ISwitchVectorProperty **options,
118 unsigned int *noptions, const char *dev, const char *group);
119 void
queryControls(INumberVectorProperty *nvp, unsigned int *nnumber, ISwitchVectorProperty **options,
120 unsigned int *noptions, const char *dev, const char *group);
122 int
getControl(unsigned int ctrl_id, double *value, char *errmsg);
123 int
setINTControl(unsigned int ctrl_id, double new_value, char *errmsg);
124 int
setOPTControl(unsigned int ctrl_id, unsigned int new_value, char *errmsg);
126 int
query_ctrl(unsigned int ctrl_id, double &ctrl_min, double &ctrl_max, double &ctrl_step, double &ctrl_value,
128 void
getinputs(ISwitchVectorProperty *inputssp);
129 int
setinput(unsigned int inputindex, char *errmsg);
132 void
getcapturesizes(ISwitchVectorProperty *capturesizessp, INumberVectorProperty *capturesizenp);
134 void
getframerates(ISwitchVectorProperty *frameratessp, INumberVectorProperty *frameratenp);
135 int
setcroprect(int x, int y, int w, int h, char *errmsg);
142 IDLog(
"setlexstate to %d\n", s);
157 int xioctl(
int fd,
int request,
void *arg,
char const *
const request_str);
162 int open_device(
const char *devpath,
char *errmsg);
170 void init_read(
unsigned int buffer_size);
182 struct v4l2_capability
cap;
184 struct v4l2_crop
crop;
185 struct v4l2_format
fmt;
186 struct v4l2_input
input;
187 struct v4l2_buffer
buf;
228 friend class ::V4L2_Driver;
void init_read(unsigned int buffer_size)
struct v4l2_querymenu querymenu
int read_frame(char *errsg)
char deviceName[MAXINDIDEVICE]
int stop_capturing(char *errmsg)
int check_device(char *errmsg)
int xioctl(int fd, int request, void *arg, char const *const request_str)
virtual void disconnectCam(bool stopcapture)
struct v4l2_queryctrl queryctrl
int(V4L2_Base::* setframerate)(struct v4l2_fract frate, char *errmsg)
struct v4l2_rect getcroprect()
int pwcsetframerate(struct v4l2_fract frate, char *errmsg)
static int video_dev_file_select(const dirent *entry)
bool enumerate_ext_ctrl()
int stdsetframerate(struct v4l2_fract frate, char *errmsg)
int open_device(const char *devpath, char *errmsg)
int setINTControl(unsigned int ctrl_id, double new_value, char *errmsg)
struct v4l2_capability cap
int query_ctrl(unsigned int ctrl_id, double &ctrl_min, double &ctrl_max, double &ctrl_step, double &ctrl_value, char *errmsg)
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 errno_exit(const char *s, char *errmsg)
void setColorProcessing(bool quantization, bool colorconvert, bool linearization)
void getframerates(ISwitchVectorProperty *frameratessp, INumberVectorProperty *frameratenp)
bool is_compressed() const
Helper indicating whether current pixel format is compressed or not.
void registerCallback(WPF *fp, void *ud)
V4L2_Decode * v4l2_decode
int uninit_device(char *errmsg)
void getcaptureformats(ISwitchVectorProperty *captureformatssp)
static void newFrame(int fd, void *p)
int start_capturing(char *errmsg)
struct v4l2_fract stdgetframerate()
void getcapturesizes(ISwitchVectorProperty *capturesizessp, INumberVectorProperty *capturesizenp)
unsigned char * getMJPEGBuffer(int &size)
void init_userp(unsigned int buffer_size)
struct v4l2_fract(V4L2_Base::* getframerate)()
void setDeviceName(const char *name)
int init_device(char *errmsg)
int setcapturesize(unsigned int w, unsigned int h, char *errmsg)
int setcaptureformat(unsigned int captureformatindex, char *errmsg)
struct v4l2_cropcap cropcap
int ioctl_set_format(struct v4l2_format new_fmt, char *errmsg)
static std::map< std::string, std::string > enumerate()
int enumeratedCaptureFormats
virtual void getMaxMinSize(int &x_max, int &y_max, int &x_min, int &y_min)
unsigned char * getRGBBuffer()
int setcroprect(int x, int y, int w, int h, char *errmsg)
bool queryExtControls(INumberVectorProperty *nvp, unsigned int *nnumber, ISwitchVectorProperty **options, unsigned int *noptions, const char *dev, const char *group)
struct v4l2_fract frameRate
int init_mmap(char *errmsg)
void getinputs(ISwitchVectorProperty *inputssp)
virtual int setSize(int x, int y)
void setNative(bool value)
int setinput(unsigned int inputindex, char *errmsg)
int setOPTControl(unsigned int ctrl_id, unsigned int new_value, char *errmsg)
int queryINTControls(INumberVectorProperty *nvp)
virtual int connectCam(const char *devpath, char *errmsg, int pixelFormat=-1, int width=-1, int height=-1)
Public interface to INDI's eventloop mechanism.
void() WPF(void *)
Signature of a work procedure function.
void IDLog(const char *fmt,...)
Interface to the reference INDI C API device implementation on the Device Driver side.
Namespace to encapsulate INDI client, drivers, and mediator classes.