forked from beihuijie/carrier-rtsp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimp-common.h
executable file
·229 lines (197 loc) · 6.06 KB
/
imp-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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
/*
* sample-common.h
*
* Copyright (C) 2014 Ingenic Semiconductor Co.,Ltd
*/
#ifndef __SAMPLE_COMMON_H__
#define __SAMPLE_COMMON_H__
#include <imp/imp_common.h>
#include <imp/imp_osd.h>
#include <imp/imp_framesource.h>
#include <imp/imp_isp.h>
#include <unistd.h>
#ifdef __cplusplus
#if __cplusplus
extern "C"
{
#endif
#endif /* __cplusplus */
#define SENSOR_FRAME_RATE_NUM 25
#define SENSOR_FRAME_RATE_DEN 1
#define SENSOR_OV9732
#if defined SENSOR_AR0141
#define SENSOR_NAME "ar0141"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x10
#define SENSOR_WIDTH 1280
#define SENSOR_HEIGHT 720
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_OV7725
#define SENSOR_NAME "ov7725"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x21
#define SENSOR_WIDTH 640
#define SENSOR_HEIGHT 480
#define CHN0_EN 1
#define CHN1_EN 0
#define CROP_EN 0
#elif defined SENSOR_OV9732
#define SENSOR_NAME "ov9732"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x36
#define SENSOR_WIDTH 1280
#define SENSOR_HEIGHT 720
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_OV9750
#define SENSOR_NAME "ov9750"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x36
#define SENSOR_WIDTH 1280
#define SENSOR_HEIGHT 720
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_OV9712
#define SENSOR_NAME "ov9712"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x30
#define SENSOR_WIDTH 1280
#define SENSOR_HEIGHT 720
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_GC1004
#define SENSOR_NAME "gc1004"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x3c
#define SENSOR_WIDTH 1280
#define SENSOR_HEIGHT 720
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_JXH42
#define SENSOR_NAME "jxh42"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x30
#define SENSOR_WIDTH 1280
#define SENSOR_HEIGHT 720
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_SC1035
#define SENSOR_NAME "sc1035"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x30
#define SENSOR_WIDTH 1280
#define SENSOR_HEIGHT 960
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_OV2710
#define SENSOR_NAME "ov2710"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x36
#define SENSOR_WIDTH 1920
#define SENSOR_HEIGHT 1080
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_SC2135
#define SENSOR_NAME "sc2135"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x30
#define SENSOR_WIDTH 1920
#define SENSOR_HEIGHT 1080
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_OV2735B
#define SENSOR_NAME "ov2735b"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x3c
#define SENSOR_WIDTH 1920
#define SENSOR_HEIGHT 1080
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_OV2735
#define SENSOR_NAME "ov2735"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x3c
#define SENSOR_WIDTH 1920
#define SENSOR_HEIGHT 1080
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#elif defined SENSOR_JXF22
#define SENSOR_NAME "jxf22"
#define SENSOR_CUBS_TYPE TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR 0x40
#define SENSOR_WIDTH 1920
#define SENSOR_HEIGHT 1080
#define CHN0_EN 1
#define CHN1_EN 1
#define CROP_EN 1
#endif
#define SENSOR_WIDTH_SECOND 640
#define SENSOR_HEIGHT_SECOND 360
#define NR_FRAMES_TO_SAVE 1000
#define STREAM_BUFFER_SIZE (1 * 1024 * 1024)
#define ENC_H264_CHANNEL 0
#define ENC_JPEG_CHANNEL 1
#define STREAM_FILE_PATH_PREFIX "/tmp"
#define SNAP_FILE_PATH_PREFIX "/tmp"
#define OSD_REGION_WIDTH 16
#define OSD_REGION_HEIGHT 34
#define OSD_REGION_WIDTH_SEC 8
#define OSD_REGION_HEIGHT_SEC 18
#define SLEEP_TIME 1
#define FS_CHN_NUM 2 //MIN 1,MAX 2
#define IVS_CHN_ID 1
#define CH0_INDEX 0
#define CH1_INDEX 1
#define CHN_ENABLE 1
#define CHN_DISABLE 0
/*#define SUPPORT_RGB555LE*/
struct chn_conf{
unsigned int index;//0 for main channel ,1 for second channel
unsigned int enable;
IMPFSChnAttr fs_chn_attr;
IMPCell framesource_chn;
IMPCell imp_encoder;
};
#define CHN_NUM ARRAY_SIZE(chn)
int sample_system_init();
int sample_system_exit();
int sample_framesource_streamon();
int sample_framesource_streamoff();
int sample_framesource_ext_hsv_streamon();
int sample_framesource_ext_hsv_streamoff();
int sample_framesource_ext_bgra_streamon();
int sample_framesource_ext_bgra_streamoff();
int sample_framesource_init();
int sample_framesource_exit();
int sample_framesource_ext_hsv_init();
int sample_framesource_ext_hsv_exit();
int sample_framesource_ext_bgra_init();
int sample_framesource_ext_bgra_exit();
int sample_encoder_init();
int sample_jpeg_init();
int sample_encoder_exit(void);
IMPRgnHandle *sample_osd_init(int grpNum);
int sample_osd_exit(IMPRgnHandle *prHandle,int grpNum);
int sample_do_get_h264_stream(int nr_frames);
int sample_get_h264_stream();
int sample_do_get_jpeg_snap(void);
int sample_get_jpeg_snap();
void *sample_soft_photosensitive_ctrl(void *p);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __SAMPLE_COMMON_H__ */