• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 Amlogic Corporation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 
19 /**
20 * @file amstream.h
21 * @brief  Porting from decoder driver for codec ioctl commands
22 * @author Tim Yao <timyao@amlogic.com>
23 * @version 1.0.0
24 * @date 2011-02-24
25 */
26 /* Copyright (C) 2007-2011, Amlogic Inc.
27 * All right reserved
28 *
29 */
30 
31 /*
32  * AMLOGIC Audio/Video streaming port driver.
33  *
34  * This program is free software; you can redistribute it and/or modify
35  * it under the terms of the GNU General Public License as published by
36  * the Free Software Foundation; either version 2 of the named License,
37  * or any later version.
38  *
39  * This program is distributed in the hope that it will be useful,
40  * but WITHOUT ANY WARRANTY; without even the implied warranty of
41  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42  * GNU General Public License for more details.
43  *
44  * You should have received a copy of the GNU General Public License
45  * along with this program; if not, write to the Free Software
46  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
47  *
48  * Author:  Tim Yao <timyao@amlogic.com>
49  *
50  */
51 
52 #ifndef AMSTREAM_H
53 #define AMSTREAM_H
54 
55 #include "amports/vformat.h"
56 #include "amports/aformat.h"
57 
58 #define PORT_FLAG_IN_USE    0x0001
59 #define PORT_FLAG_VFORMAT   0x0002
60 #define PORT_FLAG_AFORMAT   0x0004
61 #define PORT_FLAG_FORMAT    (PORT_FLAG_VFORMAT | PORT_FLAG_AFORMAT)
62 #define PORT_FLAG_VID       0x0008
63 #define PORT_FLAG_AID       0x0010
64 #define PORT_FLAG_ID        (PORT_FLAG_VID | PORT_FLAG_AID)
65 #define PORT_FLAG_INITED    0x100
66 
67 #define PORT_TYPE_VIDEO     0x01
68 #define PORT_TYPE_AUDIO     0x02
69 #define PORT_TYPE_MPTS      0x04
70 #define PORT_TYPE_MPPS      0x08
71 #define PORT_TYPE_ES        0x10
72 #define PORT_TYPE_RM        0x20
73 
74 #define AMSTREAM_IOC_MAGIC  'S'
75 #define AMSTREAM_IOC_VB_START   _IOW((AMSTREAM_IOC_MAGIC), 0x00, int)
76 #define AMSTREAM_IOC_VB_SIZE    _IOW((AMSTREAM_IOC_MAGIC), 0x01, int)
77 #define AMSTREAM_IOC_AB_START   _IOW((AMSTREAM_IOC_MAGIC), 0x02, int)
78 #define AMSTREAM_IOC_AB_SIZE    _IOW((AMSTREAM_IOC_MAGIC), 0x03, int)
79 #define AMSTREAM_IOC_VFORMAT    _IOW((AMSTREAM_IOC_MAGIC), 0x04, int)
80 #define AMSTREAM_IOC_AFORMAT    _IOW((AMSTREAM_IOC_MAGIC), 0x05, int)
81 #define AMSTREAM_IOC_VID        _IOW((AMSTREAM_IOC_MAGIC), 0x06, int)
82 #define AMSTREAM_IOC_AID        _IOW((AMSTREAM_IOC_MAGIC), 0x07, int)
83 #define AMSTREAM_IOC_VB_STATUS  _IOR((AMSTREAM_IOC_MAGIC), 0x08, int)
84 #define AMSTREAM_IOC_AB_STATUS  _IOR((AMSTREAM_IOC_MAGIC), 0x09, int)
85 #define AMSTREAM_IOC_SYSINFO    _IOW((AMSTREAM_IOC_MAGIC), 0x0a, int)
86 #define AMSTREAM_IOC_ACHANNEL   _IOW((AMSTREAM_IOC_MAGIC), 0x0b, int)
87 #define AMSTREAM_IOC_SAMPLERATE _IOW((AMSTREAM_IOC_MAGIC), 0x0c, int)
88 #define AMSTREAM_IOC_DATAWIDTH  _IOW((AMSTREAM_IOC_MAGIC), 0x0d, int)
89 #define AMSTREAM_IOC_TSTAMP     _IOW((AMSTREAM_IOC_MAGIC), 0x0e, int)
90 #define AMSTREAM_IOC_VDECSTAT   _IOR((AMSTREAM_IOC_MAGIC), 0x0f, int)
91 #define AMSTREAM_IOC_ADECSTAT   _IOR((AMSTREAM_IOC_MAGIC), 0x10, int)
92 
93 #define AMSTREAM_IOC_PORT_INIT   _IO((AMSTREAM_IOC_MAGIC), 0x11)
94 #define AMSTREAM_IOC_TRICKMODE  _IOW((AMSTREAM_IOC_MAGIC), 0x12, int)
95 
96 #define AMSTREAM_IOC_AUDIO_INFO _IOW((AMSTREAM_IOC_MAGIC), 0x13, int)
97 #define AMSTREAM_IOC_TRICK_STAT  _IOR((AMSTREAM_IOC_MAGIC), 0x14, int)
98 #define AMSTREAM_IOC_AUDIO_RESET _IO((AMSTREAM_IOC_MAGIC), 0x15)
99 #define AMSTREAM_IOC_SID         _IOW((AMSTREAM_IOC_MAGIC), 0x16, int)
100 #define AMSTREAM_IOC_VPAUSE      _IOW((AMSTREAM_IOC_MAGIC), 0x17, int)
101 #define AMSTREAM_IOC_AVTHRESH   _IOW((AMSTREAM_IOC_MAGIC), 0x18, int)
102 #define AMSTREAM_IOC_SYNCTHRESH _IOW((AMSTREAM_IOC_MAGIC), 0x19, int)
103 #define AMSTREAM_IOC_SUB_RESET   _IOW((AMSTREAM_IOC_MAGIC), 0x1a, int)
104 #define AMSTREAM_IOC_SUB_LENGTH  _IOR((AMSTREAM_IOC_MAGIC), 0x1b, int)
105 #define AMSTREAM_IOC_SET_DEC_RESET _IOW((AMSTREAM_IOC_MAGIC), 0x1c, int)
106 #define AMSTREAM_IOC_TS_SKIPBYTE _IOW((AMSTREAM_IOC_MAGIC), 0x1d, int)
107 #define AMSTREAM_IOC_SUB_TYPE    _IOW((AMSTREAM_IOC_MAGIC), 0x1e, int)
108 #define AMSTREAM_IOC_CLEAR_VIDEO _IOW((AMSTREAM_IOC_MAGIC), 0x1f, int)
109 
110 #define AMSTREAM_IOC_APTS             _IOR((AMSTREAM_IOC_MAGIC), 0x40, int)
111 #define AMSTREAM_IOC_VPTS             _IOR((AMSTREAM_IOC_MAGIC), 0x41, int)
112 #define AMSTREAM_IOC_PCRSCR           _IOR((AMSTREAM_IOC_MAGIC), 0x42, int)
113 #define AMSTREAM_IOC_SYNCENABLE      _IOW((AMSTREAM_IOC_MAGIC), 0x43, int)
114 #define AMSTREAM_IOC_GET_SYNC_ADISCON  _IOR((AMSTREAM_IOC_MAGIC), 0x44, int)
115 #define AMSTREAM_IOC_SET_SYNC_ADISCON  _IOW((AMSTREAM_IOC_MAGIC), 0x45, int)
116 #define AMSTREAM_IOC_GET_SYNC_VDISCON  _IOR((AMSTREAM_IOC_MAGIC), 0x46, int)
117 #define AMSTREAM_IOC_SET_SYNC_VDISCON  _IOW((AMSTREAM_IOC_MAGIC), 0x47, int)
118 #define AMSTREAM_IOC_GET_VIDEO_DISABLE  _IOR((AMSTREAM_IOC_MAGIC), 0x48, int)
119 #define AMSTREAM_IOC_SET_VIDEO_DISABLE  _IOW((AMSTREAM_IOC_MAGIC), 0x49, int)
120 #define AMSTREAM_IOC_SET_PCRSCR       _IOW((AMSTREAM_IOC_MAGIC), 0x4a, int)
121 #define AMSTREAM_IOC_GET_VIDEO_AXIS   _IOR((AMSTREAM_IOC_MAGIC), 0x4b, int)
122 #define AMSTREAM_IOC_SET_VIDEO_AXIS   _IOW((AMSTREAM_IOC_MAGIC), 0x4c, int)
123 #define AMSTREAM_IOC_GET_VIDEO_CROP   _IOR((AMSTREAM_IOC_MAGIC), 0x4d, int)
124 #define AMSTREAM_IOC_SET_VIDEO_CROP   _IOW((AMSTREAM_IOC_MAGIC), 0x4e, int)
125 #define AMSTREAM_IOC_PCRID        _IOW((AMSTREAM_IOC_MAGIC), 0x4f, int)
126 
127 /* VPP.3D IOCTL command list^M */
128 #define  AMSTREAM_IOC_SET_3D_TYPE  _IOW((AMSTREAM_IOC_MAGIC), 0x3c, unsigned int)
129 #define  AMSTREAM_IOC_GET_3D_TYPE  _IOW((AMSTREAM_IOC_MAGIC), 0x3d, unsigned int)
130 
131 #define AMSTREAM_IOC_SUB_NUM    _IOR((AMSTREAM_IOC_MAGIC), 0x50, int)
132 #define AMSTREAM_IOC_SUB_INFO   _IOR((AMSTREAM_IOC_MAGIC), 0x51, int)
133 #define AMSTREAM_IOC_GET_BLACKOUT_POLICY   _IOR((AMSTREAM_IOC_MAGIC), 0x52, int)
134 #define AMSTREAM_IOC_SET_BLACKOUT_POLICY   _IOW((AMSTREAM_IOC_MAGIC), 0x53, int)
135 #define AMSTREAM_IOC_UD_LENGTH _IOR((AMSTREAM_IOC_MAGIC), 0x54, int)
136 #define AMSTREAM_IOC_UD_POC _IOR((AMSTREAM_IOC_MAGIC), 0x55, int)
137 #define AMSTREAM_IOC_GET_SCREEN_MODE _IOR((AMSTREAM_IOC_MAGIC), 0x58, int)
138 #define AMSTREAM_IOC_SET_SCREEN_MODE _IOW((AMSTREAM_IOC_MAGIC), 0x59, int)
139 #define AMSTREAM_IOC_GET_VIDEO_DISCONTINUE_REPORT _IOR((AMSTREAM_IOC_MAGIC), 0x5a, int)
140 #define AMSTREAM_IOC_SET_VIDEO_DISCONTINUE_REPORT _IOW((AMSTREAM_IOC_MAGIC), 0x5b, int)
141 #define AMSTREAM_IOC_VF_STATUS  _IOR((AMSTREAM_IOC_MAGIC), 0x60, int)
142 #define AMSTREAM_IOC_CLEAR_VBUF _IO((AMSTREAM_IOC_MAGIC), 0x80)
143 
144 #define AMSTREAM_IOC_APTS_LOOKUP    _IOR((AMSTREAM_IOC_MAGIC), 0x81, int)
145 #define GET_FIRST_APTS_FLAG    _IOR((AMSTREAM_IOC_MAGIC), 0x82, int)
146 #define AMSTREAM_IOC_GET_SYNC_ADISCON_DIFF  _IOR((AMSTREAM_IOC_MAGIC), 0x83, int)
147 #define AMSTREAM_IOC_GET_SYNC_VDISCON_DIFF  _IOR((AMSTREAM_IOC_MAGIC), 0x84, int)
148 #define AMSTREAM_IOC_SET_SYNC_ADISCON_DIFF  _IOW((AMSTREAM_IOC_MAGIC), 0x85, int)
149 #define AMSTREAM_IOC_SET_SYNC_VDISCON_DIFF  _IOW((AMSTREAM_IOC_MAGIC), 0x86, int)
150 #define AMSTREAM_IOC_GET_FREERUN_MODE  _IOR((AMSTREAM_IOC_MAGIC), 0x87, int)
151 #define AMSTREAM_IOC_SET_FREERUN_MODE  _IOW((AMSTREAM_IOC_MAGIC), 0x88, int)
152 #define AMSTREAM_IOC_SET_VSYNC_UPINT   _IOW((AMSTREAM_IOC_MAGIC), 0x89, int)
153 #define AMSTREAM_IOC_GET_VSYNC_SLOW_FACTOR   _IOW((AMSTREAM_IOC_MAGIC), 0x8a, int)
154 #define AMSTREAM_IOC_SET_VSYNC_SLOW_FACTOR   _IOW((AMSTREAM_IOC_MAGIC), 0x8b, int)
155 #define AMSTREAM_IOC_SET_DEMUX  _IOW((AMSTREAM_IOC_MAGIC), 0x90, int)
156 #define AMSTREAM_IOC_SET_DRMMODE _IOW((AMSTREAM_IOC_MAGIC), 0x91, int)
157 #define AMSTREAM_IOC_TSTAMP_uS64 _IOW((AMSTREAM_IOC_MAGIC), 0x95, int)
158 
159 #define AMSTREAM_IOC_SET_VIDEO_DELAY_LIMIT_MS _IOW((AMSTREAM_IOC_MAGIC), 0xa0, int)
160 #define AMSTREAM_IOC_GET_VIDEO_DELAY_LIMIT_MS _IOR((AMSTREAM_IOC_MAGIC), 0xa1, int)
161 #define AMSTREAM_IOC_SET_AUDIO_DELAY_LIMIT_MS _IOW((AMSTREAM_IOC_MAGIC), 0xa2, int)
162 #define AMSTREAM_IOC_GET_AUDIO_DELAY_LIMIT_MS _IOR((AMSTREAM_IOC_MAGIC), 0xa3, int)
163 #define AMSTREAM_IOC_GET_AUDIO_CUR_DELAY_MS _IOR((AMSTREAM_IOC_MAGIC), 0xa4, int)
164 #define AMSTREAM_IOC_GET_VIDEO_CUR_DELAY_MS _IOR((AMSTREAM_IOC_MAGIC), 0xa5, int)
165 #define AMSTREAM_IOC_GET_AUDIO_AVG_BITRATE_BPS _IOR((AMSTREAM_IOC_MAGIC), 0xa6, int)
166 #define AMSTREAM_IOC_GET_VIDEO_AVG_BITRATE_BPS _IOR((AMSTREAM_IOC_MAGIC), 0xa7, int)
167 #define AMSTREAM_IOC_SET_APTS  _IOW((AMSTREAM_IOC_MAGIC), 0xa8, int)
168 #define AMSTREAM_IOC_GET_LAST_CHECKIN_APTS _IOR((AMSTREAM_IOC_MAGIC), 0xa9, int)
169 #define AMSTREAM_IOC_GET_LAST_CHECKIN_VPTS _IOR((AMSTREAM_IOC_MAGIC), 0xaa, int)
170 #define AMSTREAM_IOC_GET_LAST_CHECKOUT_APTS _IOR((AMSTREAM_IOC_MAGIC), 0xab, int)
171 #define AMSTREAM_IOC_GET_LAST_CHECKOUT_VPTS _IOR((AMSTREAM_IOC_MAGIC), 0xac, int)
172 /* subtitle.c get/set subtitle info */
173 #define AMSTREAM_IOC_GET_SUBTITLE_INFO _IOR((AMSTREAM_IOC_MAGIC), 0xad, int)
174 #define AMSTREAM_IOC_SET_SUBTITLE_INFO _IOW((AMSTREAM_IOC_MAGIC), 0xae, int)
175 #define AMSTREAM_IOC_SET_OMX_VPTS _IOW((AMSTREAM_IOC_MAGIC), 0xaf, int)
176 #define AMSTREAM_IOC_GET_OMX_VPTS _IOW((AMSTREAM_IOC_MAGIC), 0xb0, int)
177 
178 #define AMSTREAM_IOC_GET_TRICK_VPTS _IOR((AMSTREAM_IOC_MAGIC), 0xf0, int)
179 #define AMSTREAM_IOC_DISABLE_SLOW_SYNC _IOW((AMSTREAM_IOC_MAGIC), 0xf1, int)
180 
181 #define AMSTREAM_IOC_GET_AUDIO_CHECKIN_BITRATE_BPS _IOR(AMSTREAM_IOC_MAGIC, 0xf2, int)
182 #define AMSTREAM_IOC_GET_VIDEO_CHECKIN_BITRATE_BPS _IOR(AMSTREAM_IOC_MAGIC, 0xf3, int)
183 
184 #define AMSTREAM_IOC_GET_VERSION _IOR((AMSTREAM_IOC_MAGIC), 0xc0, int)
185 #define AMSTREAM_IOC_GET _IOWR((AMSTREAM_IOC_MAGIC), 0xc1, struct am_ioctl_parm)
186 #define AMSTREAM_IOC_SET _IOW((AMSTREAM_IOC_MAGIC), 0xc2, struct am_ioctl_parm)
187 #define AMSTREAM_IOC_GET_EX _IOWR((AMSTREAM_IOC_MAGIC), 0xc3, struct am_ioctl_parm_ex)
188 #define AMSTREAM_IOC_SET_EX _IOW((AMSTREAM_IOC_MAGIC), 0xc4, struct am_ioctl_parm_ex)
189 #define AMSTREAM_IOC_GET_PTR _IOWR((AMSTREAM_IOC_MAGIC), 0xc5, struct am_ioctl_parm_ptr)
190 #define AMSTREAM_IOC_SET_PTR _IOW((AMSTREAM_IOC_MAGIC), 0xc6, struct am_ioctl_parm_ptr)
191 
192 #define AMAUDIO_IOC_MAGIC  'A'
193 #define AMAUDIO_IOC_SET_RESAMPLE_ENA        _IOW(AMAUDIO_IOC_MAGIC, 0x19, unsigned long)
194 #define AMAUDIO_IOC_GET_RESAMPLE_ENA        _IOR(AMAUDIO_IOC_MAGIC, 0x1a, unsigned long)
195 #define AMAUDIO_IOC_SET_RESAMPLE_TYPE       _IOW(AMAUDIO_IOC_MAGIC, 0x1b, unsigned long)
196 #define AMAUDIO_IOC_GET_RESAMPLE_TYPE       _IOR(AMAUDIO_IOC_MAGIC, 0x1c, unsigned long)
197 #define AMAUDIO_IOC_SET_RESAMPLE_DELTA      _IOW(AMAUDIO_IOC_MAGIC, 0x1d, unsigned long)
198 
199 enum FRAME_BASE_VIDEO_PATH {
200     FRAME_BASE_PATH_IONVIDEO = 0,
201     FRAME_BASE_PATH_AMLVIDEO_AMVIDEO,
202     FRAME_BASE_PATH_AMLVIDEO1_AMVIDEO2,
203     FRAME_BASE_PATH_DI_AMVIDEO,
204     FRAME_BASE_PATH_AMVIDEO,
205     FRAME_BASE_PATH_AMVIDEO2,
206     FRAME_BASE_PATH_V4L_VIDEO,
207     FRAME_BASE_PATH_TUNNEL_MODE,
208     FRAME_BASE_PATH_V4L_OSD,
209     FRAME_BASE_PATH_DI_V4LVIDEO,
210     FRAME_BASE_PATH_PIP_TUNNEL_MODE,
211     FRAME_BASE_PATH_MAX
212 };
213 
214 struct buf_status {
215     int size;
216     int data_len;
217     int free_len;
218     unsigned int read_pointer;
219     unsigned int write_pointer;
220 };
221 
222 /*struct vdec_status.status*/
223 #define STAT_TIMER_INIT     0x01
224 #define STAT_MC_LOAD        0x02
225 #define STAT_ISR_REG        0x04
226 #define STAT_VF_HOOK        0x08
227 #define STAT_TIMER_ARM      0x10
228 #define STAT_VDEC_RUN       0x20
229 //-/*struct vdec_status.status on error*/
230 
231 #define PARSER_FATAL_ERROR              (0x10<<16)
232 #define DECODER_ERROR_VLC_DECODE_TBL    (0x20<<16)
233 #define PARSER_ERROR_WRONG_HEAD_VER     (0x40<<16)
234 #define PARSER_ERROR_WRONG_PACKAGE_SIZE (0x80<<16)
235 #define DECODER_FATAL_ERROR_SIZE_OVERFLOW     (0x100<<16)
236 #define DECODER_FATAL_ERROR_UNKNOW             (0x200<<16)
237 #define DECODER_FATAL_ERROR_NO_MEM		(0x400<<16)
238 
239 
240 #define DECODER_ERROR_MASK  (0xffff<<16)
241 
242 enum E_ASPECT_RATIO {
243     ASPECT_RATIO_4_3,
244     ASPECT_RATIO_16_9,
245     ASPECT_UNDEFINED = 255
246 };
247 
248 struct vdec_status {
249     unsigned int width;
250     unsigned int height;
251     unsigned int fps;
252     unsigned int error_count;
253     unsigned int status;
254 	enum E_ASPECT_RATIO euAspectRatio;
255 };
256 
257 struct adec_status {
258     unsigned int channels;
259     unsigned int sample_rate;
260     unsigned int resolution;
261     unsigned int error_count;
262     unsigned int status;
263 };
264 
265 struct am_io_param {
266     union {
267         int data;
268         int id;//get bufstatus? //or others
269     };
270 
271     int len; //buffer size;
272 
273     union {
274         char buf[1];
275         struct buf_status status;
276         struct vdec_status vstatus;
277         struct adec_status astatus;
278     };
279 };
280 struct subtitle_info {
281 
282     unsigned char id;
283 
284     unsigned char width;
285 
286     unsigned char height;
287 
288     unsigned char type;
289 };
290 
291 struct userdata_poc_info_t {
292 
293     unsigned int poc_info;
294 
295     unsigned int poc_number;
296 };
297 
298 /*******************************************************************
299 * 0x100~~0x1FF : set cmd
300 * 0x200~~0x2FF : set ex cmd
301 * 0x300~~0x3FF : set ptr cmd
302 * 0x400~~0x7FF : set reserved cmd
303 * 0x800~~0x8FF : get cmd
304 * 0x900~~0x9FF : get ex cmd
305 * 0xA00~~0xAFF : get ptr cmd
306 * 0xBFF~~0xFFF : get reserved cmd
307 * 0xX00~~0xX5F : amstream cmd(X: cmd type)
308 * 0xX60~~0xXAF : video cmd(X: cmd type)
309 * 0xXAF~~0xXFF : reserved cmd(X: cmd type)
310 *******************************************************************/
311 /*  amstream set cmd */
312 #define AMSTREAM_SET_VB_START 0x101
313 #define AMSTREAM_SET_VB_SIZE 0x102
314 #define AMSTREAM_SET_AB_START 0x103
315 #define AMSTREAM_SET_AB_SIZE 0x104
316 #define AMSTREAM_SET_VFORMAT 0x105
317 #define AMSTREAM_SET_AFORMAT 0x106
318 #define AMSTREAM_SET_VID 0x107
319 #define AMSTREAM_SET_AID 0x108
320 #define AMSTREAM_SET_SID 0x109
321 #define AMSTREAM_SET_PCRID 0x10A
322 #define AMSTREAM_SET_ACHANNEL 0x10B
323 #define AMSTREAM_SET_SAMPLERATE 0x10C
324 #define AMSTREAM_SET_DATAWIDTH 0x10D
325 #define AMSTREAM_SET_TSTAMP 0x10E
326 #define AMSTREAM_SET_TSTAMP_US64 0x10F
327 #define AMSTREAM_SET_APTS 0x110
328 #define AMSTREAM_PORT_INIT 0x111
329 #define AMSTREAM_SET_TRICKMODE 0x112 /* amstream,video */
330 #define AMSTREAM_AUDIO_RESET 0x013
331 #define AMSTREAM_SUB_RESET 0x114
332 #define AMSTREAM_DEC_RESET 0x115
333 #define AMSTREAM_SET_TS_SKIPBYTE 0x116
334 #define AMSTREAM_SET_SUB_TYPE 0x117
335 #define AMSTREAM_SET_PCRSCR 0x118
336 #define AMSTREAM_SET_DEMUX 0x119
337 #define AMSTREAM_SET_VIDEO_DELAY_LIMIT_MS 0x11A
338 #define AMSTREAM_SET_AUDIO_DELAY_LIMIT_MS 0x11B
339 #define AMSTREAM_SET_DRMMODE 0x11C
340 /*  video set   cmd */
341 #define AMSTREAM_SET_OMX_VPTS 0x160
342 #define AMSTREAM_SET_VPAUSE 0x161
343 #define AMSTREAM_SET_AVTHRESH 0x162
344 #define AMSTREAM_SET_SYNCTHRESH 0x163
345 #define AMSTREAM_SET_SYNCENABLE 0x164
346 #define AMSTREAM_SET_SYNC_ADISCON 0x165
347 #define AMSTREAM_SET_SYNC_VDISCON 0x166
348 #define AMSTREAM_SET_SYNC_ADISCON_DIFF 0x167
349 #define AMSTREAM_SET_SYNC_VDISCON_DIFF 0x168
350 #define AMSTREAM_SET_VIDEO_DISABLE 0x169
351 #define AMSTREAM_SET_VIDEO_DISCONTINUE_REPORT 0x16A
352 #define AMSTREAM_SET_SCREEN_MODE 0x16B
353 #define AMSTREAM_SET_BLACKOUT_POLICY 0x16C
354 #define AMSTREAM_CLEAR_VBUF 0x16D
355 #define AMSTREAM_SET_CLEAR_VIDEO 0x16E
356 #define AMSTREAM_SET_FREERUN_MODE 0x16F
357 #define AMSTREAM_SET_DISABLE_SLOW_SYNC 0x170
358 #define AMSTREAM_SET_3D_TYPE 0x171
359 #define AMSTREAM_SET_VSYNC_UPINT 0x172
360 #define AMSTREAM_SET_VSYNC_SLOW_FACTOR 0x173
361 #define AMSTREAM_SET_FRAME_BASE_PATH 0x174
362 #define AMSTREAM_SET_EOS 0x175
363 #define AMSTREAM_SET_RECEIVE_ID 0x176
364 #define AMSTREAM_SET_IS_RESET 0x177
365 
366 #define AMSTREAM_SET_NO_POWERDOWN 0x178
367 #define AMSTREAM_SET_DVMETAWITHEL 0x179
368 
369 
370 /*  video set ex cmd */
371 #define AMSTREAM_SET_EX_VIDEO_AXIS 0x260
372 #define AMSTREAM_SET_EX_VIDEO_CROP 0x261
373 /*  amstream set ptr cmd */
374 #define AMSTREAM_SET_PTR_AUDIO_INFO 0x300
375 #define AMSTREAM_SET_PTR_CONFIGS 0x301
376 
377 /*  amstream get cmd */
378 #define AMSTREAM_GET_SUB_LENGTH 0x800
379 #define AMSTREAM_GET_UD_LENGTH 0x801
380 #define AMSTREAM_GET_APTS_LOOKUP 0x802
381 #define AMSTREAM_GET_FIRST_APTS_FLAG 0x803
382 #define AMSTREAM_GET_APTS 0x804
383 #define AMSTREAM_GET_VPTS 0x805
384 #define AMSTREAM_GET_PCRSCR 0x806
385 #define AMSTREAM_GET_LAST_CHECKIN_APTS 0x807
386 #define AMSTREAM_GET_LAST_CHECKIN_VPTS 0x808
387 #define AMSTREAM_GET_LAST_CHECKOUT_APTS 0x809
388 #define AMSTREAM_GET_LAST_CHECKOUT_VPTS 0x80A
389 #define AMSTREAM_GET_SUB_NUM 0x80B
390 #define AMSTREAM_GET_VIDEO_DELAY_LIMIT_MS 0x80C
391 #define AMSTREAM_GET_AUDIO_DELAY_LIMIT_MS 0x80D
392 #define AMSTREAM_GET_AUDIO_CUR_DELAY_MS 0x80E
393 #define AMSTREAM_GET_VIDEO_CUR_DELAY_MS 0x80F
394 #define AMSTREAM_GET_AUDIO_AVG_BITRATE_BPS 0x810
395 #define AMSTREAM_GET_VIDEO_AVG_BITRATE_BPS 0x811
396 /*  video get cmd */
397 #define AMSTREAM_GET_OMX_VPTS 0x860
398 #define AMSTREAM_GET_TRICK_STAT 0x861
399 #define AMSTREAM_GET_TRICK_VPTS 0x862
400 #define AMSTREAM_GET_SYNC_ADISCON 0x863
401 #define AMSTREAM_GET_SYNC_VDISCON 0x864
402 #define AMSTREAM_GET_SYNC_ADISCON_DIFF 0x865
403 #define AMSTREAM_GET_SYNC_VDISCON_DIFF 0x866
404 #define AMSTREAM_GET_VIDEO_DISABLE 0x867
405 #define AMSTREAM_GET_VIDEO_DISCONTINUE_REPORT 0x868
406 #define AMSTREAM_GET_SCREEN_MODE 0x869
407 #define AMSTREAM_GET_BLACKOUT_POLICY 0x86A
408 #define AMSTREAM_GET_FREERUN_MODE 0x86B
409 #define AMSTREAM_GET_3D_TYPE 0x86C
410 #define AMSTREAM_GET_VSYNC_SLOW_FACTOR 0x86D
411 /*  amstream get ex cmd */
412 #define AMSTREAM_GET_EX_VB_STATUS 0x900
413 #define AMSTREAM_GET_EX_AB_STATUS 0x901
414 #define AMSTREAM_GET_EX_VDECSTAT 0x902
415 #define AMSTREAM_GET_EX_ADECSTAT 0x903
416 #define AMSTREAM_GET_EX_UD_POC 0x904
417 /*  video get ex cmd */
418 #define AMSTREAM_GET_EX_VF_STATUS 0x960
419 #define AMSTREAM_GET_EX_VIDEO_AXIS 0x961
420 #define AMSTREAM_GET_EX_VIDEO_CROP 0x962
421 /*  amstream get ptr cmd */
422 #define AMSTREAM_GET_PTR_SUB_INFO 0xA00
423 
424 struct am_ioctl_parm {
425     union {
426         unsigned int data_32;
427         unsigned long long data_64;
428         vformat_t data_vformat;
429         aformat_t data_aformat;
430         char data[8];
431     };
432     unsigned int cmd;
433     char reserved[4];
434 };
435 
436 struct am_ioctl_parm_ex {
437     union {
438         struct buf_status status;
439         struct vdec_status vstatus;
440         struct adec_status astatus;
441 
442         struct userdata_poc_info_t data_userdata_info;
443         char data[24];
444 
445     };
446     unsigned int cmd;
447     char reserved[4];
448 };
449 
450 struct am_ioctl_parm_ptr {
451     union {
452         struct audio_info *pdata_audio_info;
453         struct subtitle_info *pdata_sub_info;
454         void *pointer;
455         char data[8];
456     };
457     unsigned int cmd;
458     unsigned int len;
459 };
460 
461 void set_vdec_func(int (*vdec_func)(struct vdec_status *));
462 void set_adec_func(int (*adec_func)(struct adec_status *));
463 
464 #endif /* AMSTREAM_H */
465 
466