-
Notifications
You must be signed in to change notification settings - Fork 6
/
type_camera.h
174 lines (152 loc) · 3.86 KB
/
type_camera.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
#ifndef __LIB__CAMERA__TYPE__H__
#define __LIB__CAMERA__TYPE__H__
typedef struct PREVIEWINFO_t
{
int left;
int top;
int width; // preview width
int height; // preview height
}PREVIEWINFO_t, RECT_t;
typedef struct V4L2BUF_t
{
unsigned int addrPhyY; // physical Y address of this frame
unsigned int addrPhyC; // physical Y address of this frame
unsigned int addrVirY; // virtual Y address of this frame
unsigned int addrVirC; // virtual Y address of this frame
unsigned int width;
unsigned int height;
int index; // DQUE id number
long long timeStamp; // time stamp of this frame
RECT_t crop_rect;
int format;
void* overlay_info;
// thumb
unsigned char isThumbAvailable;
unsigned char thumbUsedForPreview;
unsigned char thumbUsedForPhoto;
unsigned char thumbUsedForVideo;
unsigned int thumbAddrPhyY; // physical Y address of thumb buffer
unsigned int thumbAddrVirY; // virtual Y address of thumb buffer
unsigned int thumbWidth;
unsigned int thumbHeight;
RECT_t thumb_crop_rect;
int thumbFormat;
int refCnt; // used for releasing this frame
}V4L2BUF_t;
typedef enum MEDIA_SRC_MODE
{
MEDIA_SRC_PUSH_MODE,
MEDIA_SRC_PULL_MODE
}MEDIA_SRC_MODE;
typedef struct VIDEOINFO_t
{
int video_source;
int src_height;
int src_width;
int height; // camcorder video frame height
int width; // camcorder video frame width
int frameRate; // camcorder video frame rate
int bitRate; // camcorder video bitrate
short profileIdc;
short levelIdc;
int geo_available;
int latitudex10000;
int longitudex10000;
// rotate
int rotate_degree; // only support 0, 90, 180 and 270
// for video encoder
unsigned int picEncmode; //0 for frame encoding 1: for field encoding 2:field used for frame encoding
unsigned int qp_max;
unsigned int qp_min;
}VIDEOINFO_t;
typedef enum AUDIO_ENCODER_TYPE
{
AUDIO_ENCODER_AAC_TYPE,
AUDIO_ENCODER_LPCM_TYPE
}AUDIO_ENCODER_TYPE;
typedef struct AUDIOINFO_t
{
int sampleRate;
int channels;
int bitRate;
int bitsPerSample;
int audioEncType; // 0: aac, 1: LPCM
}AUDIOINFO_t;
typedef struct ENCEXTRADATAINFO_t //don't touch it, because it also defined in type.h
{
char *data;
int length;
}ENCEXTRADATAINFO_t;
typedef struct ENC_BUFFER_t
{
int addrY;
int addrCb;
int addrCr;
int width;
int height;
RECT_t crop_rect;
int force_keyframe;
void* overlay_info;
int format;
}ENC_BUFFER_t;
typedef enum JPEG_COLOR_FORMAT
{
JPEG_COLOR_YUV444,
JPEG_COLOR_YUV422,
JPEG_COLOR_YUV420,
JPEG_COLOR_YUV411,
JPEG_COLOR_YUV420_NV12,
JPEG_COLOR_YUV420_NV21,
JPEG_COLOR_TILE_32X32,
JPEG_COLOR_CSIARGB,
JPEG_COLOR_CSIRGBA,
JPEG_COLOR_CSIABGR,
JPEG_COLOR_CSIBGRA
}JPEG_COLOR_FORMAT;
typedef struct JPEG_ENC_t
{
int src_w;
int src_h;
int pic_w;
int pic_h;
int addrY;
int addrC;
int colorFormat;
int quality;
int rotate;
int scale_factor;
double focal_length;
int thumbWidth;
int thumbHeight;
unsigned char enable_crop;
int crop_x;
int crop_y;
int crop_w;
int crop_h;
// gps exif
unsigned char enable_gps;
double gps_latitude;
double gps_longitude;
long gps_altitude;
long gps_timestamp;
char gps_processing_method[100];
int whitebalance;
char CameraMake[64];//for the cameraMake name
char CameraModel[64];//for the cameraMode
char DateTime[21];//for the data and time
void* pover_overlay;
}JPEG_ENC_t;
typedef struct thumb_buffer
{
int id;
unsigned int width;
unsigned int height;
unsigned char* y_vir;
unsigned char* uv_vir;
unsigned int y_phy;
unsigned int uv_phy;
int size_y;
int size_uv;
long long pts;
}thumb_buffer;
#endif // __LIB__CAMERA__TYPE__H__