forked from Motion-Project/motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
video_common.h
72 lines (62 loc) · 3.38 KB
/
video_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef _INCLUDE_VIDEO_COMMON_H
#define _INCLUDE_VIDEO_COMMON_H
struct vid_devctrl_ctx {
char *ctrl_name; /* The name as provided by the device */
char *ctrl_iddesc; /* A motion description of the ID number for the control*/
int ctrl_minimum; /* The minimum value permitted as reported by device*/
int ctrl_maximum; /* The maximum value permitted as reported by device*/
int ctrl_default; /* The default value for the control*/
int ctrl_currval; /* The current value the control was set to */
int ctrl_newval; /* The new value to set for the control */
unsigned int ctrl_id; /* The ID number for the control as provided by the device*/
unsigned int ctrl_type; /* The type of control as reported by the device*/
int ctrl_menuitem; /* bool for whether item is a menu item description */
};
struct video_dev {
struct video_dev *next;
int usage_count;
int fd_device;
const char *video_device;
int input;
int norm;
int width;
int height;
unsigned long frequency;
int fps;
int owner;
int frames;
int pixfmt_src;
int buffer_count;
pthread_mutex_t mutex;
pthread_mutexattr_t attr;
void *v4l2_private;
struct vid_devctrl_ctx *devctrl_array; /*Array of all the controls in the device*/
int devctrl_count; /*Count of the controls in the device*/
int starting; /*Bool for whether the device is just starting*/
int device_type; /*Camera, tuner, etc as provided by driver enum*/
int device_tuner; /*Tuner number if applicable from driver*/
/* BKTR Specific Items */
int bktr_method;
int bktr_bufsize;
const char *bktr_tuner;
int bktr_fdtuner;
unsigned char *bktr_buffers[2];
int bktr_curbuffer;
int bktr_maxbuffer;
};
int vid_start(struct context *cnt);
int vid_next(struct context *cnt, struct image_data *img_data);
void vid_close(struct context *cnt);
void vid_mutex_destroy(void);
void vid_mutex_init(void);
int vid_parms_parse(struct context *cnt);
void vid_yuv422to420p(unsigned char *map, unsigned char *cap_map, int width, int height);
void vid_yuv422pto420p(unsigned char *map, unsigned char *cap_map, int width, int height);
void vid_uyvyto420p(unsigned char *map, unsigned char *cap_map, int width, int height);
void vid_rgb24toyuv420p(unsigned char *map, unsigned char *cap_map, int width, int height);
void vid_bayer2rgb24(unsigned char *dst, unsigned char *src, long int width, long int height);
void vid_y10torgb24(unsigned char *map, unsigned char *cap_map, int width, int height, int shift);
void vid_greytoyuv420p(unsigned char *map, unsigned char *cap_map, int width, int height);
int vid_sonix_decompress(unsigned char *outp, unsigned char *inp, int width, int height);
int vid_mjpegtoyuv420p(unsigned char *map, unsigned char *cap_map, int width, int height, unsigned int size);
#endif