summaryrefslogtreecommitdiffstats
path: root/libc/kernel/common/linux/msm_q6vdec.h
blob: ebcfc1bdb0859ce0eeb59205ad4f7454863a29b1 (plain)
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
/****************************************************************************
 ****************************************************************************
 ***
 ***   This header was automatically generated from a Linux kernel header
 ***   of the same name, to make information necessary for userspace to
 ***   call into the kernel available to libc.  It contains only constants,
 ***   structures, and macros generated from the original header, and thus,
 ***   contains no copyrightable information.
 ***
 ****************************************************************************
 ****************************************************************************/
#ifndef _MSM_VDEC_H_
#define _MSM_VDEC_H_

#include <linux/types.h>

#define VDEC_IOCTL_MAGIC 'v'

#define VDEC_IOCTL_INITIALIZE _IOWR(VDEC_IOCTL_MAGIC, 1, struct vdec_init)
#define VDEC_IOCTL_SETBUFFERS _IOW(VDEC_IOCTL_MAGIC, 2, struct vdec_buffer)
#define VDEC_IOCTL_QUEUE _IOWR(VDEC_IOCTL_MAGIC, 3,   struct vdec_input_buf)
#define VDEC_IOCTL_REUSEFRAMEBUFFER _IOW(VDEC_IOCTL_MAGIC, 4, unsigned int)
#define VDEC_IOCTL_FLUSH _IOW(VDEC_IOCTL_MAGIC, 5, unsigned int)
#define VDEC_IOCTL_EOS _IO(VDEC_IOCTL_MAGIC, 6)
#define VDEC_IOCTL_GETMSG _IOR(VDEC_IOCTL_MAGIC, 7, struct vdec_msg)
#define VDEC_IOCTL_CLOSE _IO(VDEC_IOCTL_MAGIC, 8)
#define VDEC_IOCTL_FREEBUFFERS _IOW(VDEC_IOCTL_MAGIC, 9, struct vdec_buf_info)
#define VDEC_IOCTL_GETDECATTRIBUTES _IOR(VDEC_IOCTL_MAGIC, 10,   struct vdec_dec_attributes)
#define VDEC_IOCTL_INITIALIZE_V3 _IOWR(VDEC_IOCTL_MAGIC, 11,   struct vdec_init_v3)
#define VDEC_IOCTL_SETBUFFERS_V3 _IOW(VDEC_IOCTL_MAGIC, 12,  struct vdec_buffer_v3)
#define VDEC_IOCTL_FREEBUFFERS_V3 _IOW(VDEC_IOCTL_MAGIC, 13,  struct vdec_buffer_v3)
#define VDEC_IOCTL_GETDECATTRIBUTES_V3 _IOR(VDEC_IOCTL_MAGIC, 14,   struct vdec_dec_attributes)
#define VDEC_IOCTL_GETINTERNALBUFREQ _IOWR(VDEC_IOCTL_MAGIC, 15,   struct vdec_intbuf_req)
#define VDEC_IOCTL_GETPROPERTY _IOR(VDEC_IOCTL_MAGIC, 16,   union vdec_property)
#define VDEC_IOCTL_SETPROPERTY _IOW(VDEC_IOCTL_MAGIC, 17,   union vdec_property)

enum {
 VDEC_FRAME_DECODE_OK,
 VDEC_FRAME_DECODE_ERR,
 VDEC_FATAL_ERR,
 VDEC_FLUSH_FINISH,
 VDEC_EOS,
 VDEC_FRAME_FLUSH,
 VDEC_STREAM_SWITCH,
 VDEC_SUSPEND_FINISH,
 VDEC_BUFFER_CONSUMED
};

enum {
 VDEC_FLUSH_INPUT,
 VDEC_FLUSH_OUTPUT,
 VDEC_FLUSH_ALL
};

enum {
 VDEC_BUFFER_TYPE_INPUT,
 VDEC_BUFFER_TYPE_OUTPUT,
 VDEC_BUFFER_TYPE_INTERNAL1,
 VDEC_BUFFER_TYPE_INTERNAL2,
 VDEC_BUFFER_TYPE_INTERNAL = VDEC_BUFFER_TYPE_INTERNAL1,
 VDEC_BUFFER_TYPE_LUMA,
 VDEC_BUFFER_TYPE_CHROMA
};

enum {
 VDEC_QUEUE_SUCCESS,
 VDEC_QUEUE_FAILED,
 VDEC_QUEUE_BADSTATE,
};

enum {
 VDEC_PROPERTY_FOURCC,
 VDEC_PROPERTY_PROFILE,
 VDEC_PROPERTY_LEVEL,
 VDEC_PROPERTY_DIMENSION,
 VDEC_PROPERTY_CWIN,
 VDEC_PROPERTY_INPUT_BUF_REQ,
 VDEC_PROPERTY_OUTPUT_BUF_REQ,
 VDEC_LUMA_CHROMA_STRIDE
};

enum{
 VDEC_COLOR_FORMAT_NV21 = 0x01,
 VDEC_COLOR_FORMAT_NV21_YAMOTO = 0x02
 };

struct vdec_input_buf_info {
 u32 offset;
 u32 data;
 u32 size;
 int timestamp_lo;
 int timestamp_hi;
 int avsync_state;
 u32 flags;
};

struct vdec_buf_desc {
 u32 bufsize;
 u32 num_min_buffers;
 u32 num_max_buffers;
};

struct vdec_buf_req {
 u32 max_input_queue_size;
 struct vdec_buf_desc input;
 struct vdec_buf_desc output;
 struct vdec_buf_desc dec_req1;
 struct vdec_buf_desc dec_req2;
};

struct vdec_buf_req_v3 {
 u32 max_input_queue_size;
 struct vdec_buf_desc input;
 struct vdec_buf_desc output;
 u32 num_internal_buffers;
};

struct vdec_region_info {
 u32 src_id;
 u32 offset;
 u32 size;
};

struct vdec_config {
 u32 fourcc;
 u32 width;
 u32 height;
 u32 order;
 u32 notify_enable;
 u32 vc1_rowbase;
 u32 h264_startcode_detect;
 u32 h264_nal_len_size;
 u32 postproc_flag;
 u32 fruc_enable;
 u32 reserved;
};

struct vdec_config_v3 {
 u32 fourcc;
 u32 width;
 u32 height;
 u32 order;
 u32 notify_enable;
 u32 vc1_rowbase;
 u32 h264_startcode_detect;
 u32 h264_nal_len_size;
 u32 postproc_flag;
 u32 fruc_enable;
 struct vdec_region_info seq_hdr;
 u32 seq_hdr_len;
 u32 color_format;
 u32 reserved;
};

struct vdec_vc1_panscan_regions {
 int num;
 int width[4];
 int height[4];
 int xoffset[4];
 int yoffset[4];
};

struct vdec_cropping_window {
 u32 x1;
 u32 y1;
 u32 x2;
 u32 y2;
};

struct vdec_rectangle {
 u32 width;
 u32 height;
};

struct vdec_stridetype {
 u32 luma;
 u32 chroma;
};

struct vdec_frame_info {
 u32 status;
 u32 offset;
 u32 data1;
 u32 data2;
 int timestamp_lo;
 int timestamp_hi;
 int cal_timestamp_lo;
 int cal_timestamp_hi;
 u32 dec_width;
 u32 dec_height;
 struct vdec_cropping_window cwin;
 u32 picture_type[2];
 u32 picture_format;
 u32 vc1_rangeY;
 u32 vc1_rangeUV;
 u32 picture_resolution;
 u32 frame_disp_repeat;
 u32 repeat_first_field;
 u32 top_field_first;
 u32 interframe_interp;
 struct vdec_vc1_panscan_regions panscan;
 u32 concealed_macblk_num;
 u32 flags;
 u32 performance_stats;
 u32 data3;
 u32 chroma_addr;
 struct vdec_stridetype stride;
 u32 reserved;
};

struct vdec_buf_info {
 u32 buf_type;
 struct vdec_region_info region;
 u32 num_buf;
 u32 islast;
};

struct vdec_buf_info_v3 {
 u32 buf_type;
 u32 index;
 struct vdec_region_info region;
 u32 num_buf;
 u32 islast;
};

struct vdec_buffer {
 u32 pmem_id;
 struct vdec_buf_info buf;
};

struct vdec_buffer_v3 {
 u32 pmem_id;
 struct vdec_buf_info_v3 buf;
};

struct vdec_sequence {
 u8 *header;
 u32 len;
};

struct vdec_config_sps {
 struct vdec_config cfg;
 struct vdec_sequence seq;
};
struct vdec_config_sps_v3 {
 struct vdec_config_v3 cfg;
 int seq_fd;
};

#define VDEC_MSG_REUSEINPUTBUFFER 1
#define VDEC_MSG_FRAMEDONE 2

struct vdec_msg {
 u32 id;

 union {

 u32 buf_id;

 struct vdec_frame_info vfr_info;
 };
};

struct vdec_init {
 struct vdec_config_sps sps_cfg;
 struct vdec_buf_req *buf_req;
};

struct vdec_init_v3 {
 struct vdec_config_sps_v3 sps_cfg;
 struct vdec_buf_req_v3 *buf_req;
};

struct vdec_input_buf {
 u32 pmem_id;
 struct vdec_input_buf_info buffer;
 struct vdec_queue_status *queue_status;
};

struct vdec_queue_status {
 u32 status;
};

struct vdec_dec_attributes {
 u32 fourcc;
 u32 profile;
 u32 level;
 u32 dec_pic_width;
 u32 dec_pic_height;
 struct vdec_buf_desc input;
 struct vdec_buf_desc output;
 struct vdec_buf_desc dec_req1;
 struct vdec_buf_desc dec_req2;
};
struct vdec_dec_attributes_v3 {
 u32 fourcc;
 u32 profile;
 u32 level;
 u32 dec_pic_width;
 u32 dec_pic_height;
 struct vdec_cropping_window cwin;
 struct vdec_buf_desc input;
 struct vdec_buf_desc output;
};

union vdec_property {
 u32 fourcc;
 u32 profile;
 u32 level;
 struct vdec_rectangle dim;
 struct vdec_cropping_window cwin;
 struct vdec_buf_desc input;
 struct vdec_buf_desc output;
 struct vdec_stridetype stride;
 u32 def_type;
};

struct vdec_intbuf_desc {
 u32 num_actual_internal_buf;
 u32 internal_buf_req_length;
};
struct vdec_intbuf_req {
 u32 num_internal_buf;
 struct vdec_intbuf_desc *buf_desc;
 struct vdec_buf_desc *internal_buf_req;
};

#endif