• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _MSM_VENC_H_
20 #define _MSM_VENC_H_
21 #include <linux/types.h>
22 #define VENC_MAX_RECON_BUFFERS 2
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define VENC_FLAG_EOS 0x00000001
25 #define VENC_FLAG_END_OF_FRAME 0x00000010
26 #define VENC_FLAG_SYNC_FRAME 0x00000020
27 #define VENC_FLAG_EXTRA_DATA 0x00000040
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #define VENC_FLAG_CODEC_CONFIG 0x00000080
30 enum venc_flush_type {
31  VENC_FLUSH_INPUT,
32  VENC_FLUSH_OUTPUT,
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34  VENC_FLUSH_ALL
35 };
36 enum venc_state_type {
37  VENC_STATE_PAUSE = 0x1,
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39  VENC_STATE_START = 0x2,
40  VENC_STATE_STOP = 0x4
41 };
42 enum venc_event_type_enum {
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  VENC_EVENT_START_STATUS,
45  VENC_EVENT_STOP_STATUS,
46  VENC_EVENT_SUSPEND_STATUS,
47  VENC_EVENT_RESUME_STATUS,
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  VENC_EVENT_FLUSH_STATUS,
50  VENC_EVENT_RELEASE_INPUT,
51  VENC_EVENT_DELIVER_OUTPUT,
52  VENC_EVENT_UNKNOWN_STATUS
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 };
55 enum venc_status_code {
56  VENC_STATUS_SUCCESS,
57  VENC_STATUS_ERROR,
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  VENC_STATUS_INVALID_STATE,
60  VENC_STATUS_FLUSHING,
61  VENC_STATUS_INVALID_PARAM,
62  VENC_STATUS_CMD_QUEUE_FULL,
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  VENC_STATUS_CRITICAL,
65  VENC_STATUS_INSUFFICIENT_RESOURCES,
66  VENC_STATUS_TIMEOUT
67 };
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 enum venc_msg_code {
70  VENC_MSG_INDICATION,
71  VENC_MSG_INPUT_BUFFER_DONE,
72  VENC_MSG_OUTPUT_BUFFER_DONE,
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74  VENC_MSG_NEED_OUTPUT_BUFFER,
75  VENC_MSG_FLUSH,
76  VENC_MSG_START,
77  VENC_MSG_STOP,
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79  VENC_MSG_PAUSE,
80  VENC_MSG_RESUME,
81  VENC_MSG_STOP_READING_MSG
82 };
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 enum venc_error_code {
85  VENC_S_SUCCESS,
86  VENC_S_EFAIL,
87  VENC_S_EFATAL,
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89  VENC_S_EBADPARAM,
90  VENC_S_EINVALSTATE,
91  VENC_S_ENOSWRES,
92  VENC_S_ENOHWRES,
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94  VENC_S_EBUFFREQ,
95  VENC_S_EINVALCMD,
96  VENC_S_ETIMEOUT,
97  VENC_S_ENOREATMPT,
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99  VENC_S_ENOPREREQ,
100  VENC_S_ECMDQFULL,
101  VENC_S_ENOTSUPP,
102  VENC_S_ENOTIMPL,
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104  VENC_S_ENOTPMEM,
105  VENC_S_EFLUSHED,
106  VENC_S_EINSUFBUF,
107  VENC_S_ESAMESTATE,
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109  VENC_S_EINVALTRANS
110 };
111 enum venc_mem_region_enum {
112  VENC_PMEM_EBI1,
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114  VENC_PMEM_SMI
115 };
116 struct venc_buf_type {
117  unsigned int region;
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119  unsigned int phys;
120  unsigned int size;
121  int offset;
122 };
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 struct venc_qp_range {
125  unsigned int min_qp;
126  unsigned int max_qp;
127 };
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 struct venc_frame_rate {
130  unsigned int frame_rate_num;
131  unsigned int frame_rate_den;
132 };
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 struct venc_slice_info {
135  unsigned int slice_mode;
136  unsigned int units_per_slice;
137 };
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 struct venc_extra_data {
140  unsigned int slice_extra_data_flag;
141  unsigned int slice_client_data1;
142  unsigned int slice_client_data2;
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144  unsigned int slice_client_data3;
145  unsigned int none_extra_data_flag;
146  unsigned int none_client_data1;
147  unsigned int none_client_data2;
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149  unsigned int none_client_data3;
150 };
151 struct venc_common_config {
152  unsigned int standard;
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  unsigned int input_frame_height;
155  unsigned int input_frame_width;
156  unsigned int output_frame_height;
157  unsigned int output_frame_width;
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159  unsigned int rotation_angle;
160  unsigned int intra_period;
161  unsigned int rate_control;
162  struct venc_frame_rate frame_rate;
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164  unsigned int bitrate;
165  struct venc_qp_range qp_range;
166  unsigned int iframe_qp;
167  unsigned int pframe_qp;
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169  struct venc_slice_info slice_config;
170  struct venc_extra_data extra_data;
171 };
172 struct venc_nonio_buf_config {
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174  struct venc_buf_type recon_buf1;
175  struct venc_buf_type recon_buf2;
176  struct venc_buf_type wb_buf;
177  struct venc_buf_type cmd_buf;
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179  struct venc_buf_type vlc_buf;
180 };
181 struct venc_mpeg4_config {
182  unsigned int profile;
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  unsigned int level;
185  unsigned int time_resolution;
186  unsigned int ac_prediction;
187  unsigned int hec_interval;
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189  unsigned int data_partition;
190  unsigned int short_header;
191  unsigned int rvlc_enable;
192 };
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194 struct venc_h263_config {
195  unsigned int profile;
196  unsigned int level;
197 };
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 struct venc_h264_config {
200  unsigned int profile;
201  unsigned int level;
202  unsigned int max_nal;
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204  unsigned int idr_period;
205 };
206 struct venc_pmem {
207  int src;
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209  int fd;
210  unsigned int offset;
211  void *virt;
212  void *phys;
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214  unsigned int size;
215 };
216 struct venc_buffer {
217  unsigned char *ptr_buffer;
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219  unsigned int size;
220  unsigned int len;
221  unsigned int offset;
222  long long time_stamp;
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224  unsigned int flags;
225  unsigned int client_data;
226 };
227 struct venc_buffers {
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229  struct venc_pmem recon_buf[VENC_MAX_RECON_BUFFERS];
230  struct venc_pmem wb_buf;
231  struct venc_pmem cmd_buf;
232  struct venc_pmem vlc_buf;
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 };
235 struct venc_buffer_flush {
236  unsigned int flush_mode;
237 };
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 union venc_msg_data {
240  struct venc_buffer buf;
241  struct venc_buffer_flush flush_ret;
242 };
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 struct venc_msg {
245  unsigned int status_code;
246  unsigned int msg_code;
247  union venc_msg_data msg_data;
248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249  unsigned int msg_data_size;
250 };
251 union venc_codec_config {
252  struct venc_mpeg4_config mpeg4_params;
253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254  struct venc_h263_config h263_params;
255  struct venc_h264_config h264_params;
256 };
257 struct venc_q6_config {
258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259  struct venc_common_config config_params;
260  union venc_codec_config codec_params;
261  struct venc_nonio_buf_config buf_params;
262  void *callback_event;
263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264 };
265 struct venc_hdr_config {
266  struct venc_common_config config_params;
267  union venc_codec_config codec_params;
268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269 };
270 struct venc_init_config {
271  struct venc_q6_config q6_config;
272  struct venc_buffers q6_bufs;
273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274 };
275 struct venc_seq_config {
276  int size;
277  struct venc_pmem buf;
278 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279  struct venc_q6_config q6_config;
280 };
281 #define VENC_IOCTL_MAGIC 'V'
282 #define VENC_IOCTL_CMD_READ_NEXT_MSG   _IOWR(VENC_IOCTL_MAGIC, 1, struct venc_msg)
283 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284 #define VENC_IOCTL_CMD_STOP_READ_MSG _IO(VENC_IOCTL_MAGIC, 2)
285 #define VENC_IOCTL_SET_INPUT_BUFFER   _IOW(VENC_IOCTL_MAGIC, 3, struct venc_pmem)
286 #define VENC_IOCTL_SET_OUTPUT_BUFFER   _IOW(VENC_IOCTL_MAGIC, 4, struct venc_pmem)
287 #define VENC_IOCTL_CMD_START _IOW(VENC_IOCTL_MAGIC, 5, struct venc_init_config)
288 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289 #define VENC_IOCTL_CMD_ENCODE_FRAME   _IOW(VENC_IOCTL_MAGIC, 6, struct venc_buffer)
290 #define VENC_IOCTL_CMD_FILL_OUTPUT_BUFFER   _IOW(VENC_IOCTL_MAGIC, 7, struct venc_buffer)
291 #define VENC_IOCTL_CMD_FLUSH   _IOW(VENC_IOCTL_MAGIC, 8, struct venc_buffer_flush)
292 #define VENC_IOCTL_CMD_PAUSE _IO(VENC_IOCTL_MAGIC, 9)
293 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294 #define VENC_IOCTL_CMD_RESUME _IO(VENC_IOCTL_MAGIC, 10)
295 #define VENC_IOCTL_CMD_STOP _IO(VENC_IOCTL_MAGIC, 11)
296 #define VENC_IOCTL_SET_INTRA_PERIOD   _IOW(VENC_IOCTL_MAGIC, 12, int)
297 #define VENC_IOCTL_CMD_REQUEST_IFRAME _IO(VENC_IOCTL_MAGIC, 13)
298 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299 #define VENC_IOCTL_GET_SEQUENCE_HDR   _IOWR(VENC_IOCTL_MAGIC, 14, struct venc_seq_config)
300 #define VENC_IOCTL_SET_INTRA_REFRESH   _IOW(VENC_IOCTL_MAGIC, 15, int)
301 #define VENC_IOCTL_SET_FRAME_RATE   _IOW(VENC_IOCTL_MAGIC, 16, struct venc_frame_rate)
302 #define VENC_IOCTL_SET_TARGET_BITRATE   _IOW(VENC_IOCTL_MAGIC, 17, int)
303 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304 #define VENC_IOCTL_SET_QP_RANGE   _IOW(VENC_IOCTL_MAGIC, 18, struct venc_qp_range)
305 #endif
306