summaryrefslogtreecommitdiff
path: root/tvapi/libtv/include/amstream.h (plain)
blob: 434c028000b7523eceab5e807d2d6f74288fcce9
1#ifndef __AMSTREAM_H__
2#define __AMSTREAM_H__
3
4#include "ve.h"
5
6#define AMSTREAM_IOC_MAGIC 'S'
7
8#define AMSTREAM_IOC_VB_START _IOW(AMSTREAM_IOC_MAGIC, 0x00, int)
9#define AMSTREAM_IOC_VB_SIZE _IOW(AMSTREAM_IOC_MAGIC, 0x01, int)
10#define AMSTREAM_IOC_AB_START _IOW(AMSTREAM_IOC_MAGIC, 0x02, int)
11#define AMSTREAM_IOC_AB_SIZE _IOW(AMSTREAM_IOC_MAGIC, 0x03, int)
12#define AMSTREAM_IOC_VFORMAT _IOW(AMSTREAM_IOC_MAGIC, 0x04, int)
13#define AMSTREAM_IOC_AFORMAT _IOW(AMSTREAM_IOC_MAGIC, 0x05, int)
14#define AMSTREAM_IOC_VID _IOW(AMSTREAM_IOC_MAGIC, 0x06, int)
15#define AMSTREAM_IOC_AID _IOW(AMSTREAM_IOC_MAGIC, 0x07, int)
16#define AMSTREAM_IOC_VB_STATUS _IOR(AMSTREAM_IOC_MAGIC, 0x08, unsigned long)
17#define AMSTREAM_IOC_AB_STATUS _IOR(AMSTREAM_IOC_MAGIC, 0x09, unsigned long)
18#define AMSTREAM_IOC_SYSINFO _IOW(AMSTREAM_IOC_MAGIC, 0x0a, int)
19#define AMSTREAM_IOC_ACHANNEL _IOW(AMSTREAM_IOC_MAGIC, 0x0b, int)
20#define AMSTREAM_IOC_SAMPLERATE _IOW(AMSTREAM_IOC_MAGIC, 0x0c, int)
21#define AMSTREAM_IOC_DATAWIDTH _IOW(AMSTREAM_IOC_MAGIC, 0x0d, int)
22#define AMSTREAM_IOC_TSTAMP _IOW(AMSTREAM_IOC_MAGIC, 0x0e, unsigned long)
23#define AMSTREAM_IOC_VDECSTAT _IOR(AMSTREAM_IOC_MAGIC, 0x0f, unsigned long)
24#define AMSTREAM_IOC_ADECSTAT _IOR(AMSTREAM_IOC_MAGIC, 0x10, unsigned long)
25
26#define AMSTREAM_IOC_PORT_INIT _IO(AMSTREAM_IOC_MAGIC, 0x11)
27#define AMSTREAM_IOC_TRICKMODE _IOW(AMSTREAM_IOC_MAGIC, 0x12, unsigned long)
28
29#define AMSTREAM_IOC_AUDIO_INFO _IOW(AMSTREAM_IOC_MAGIC, 0x13, unsigned long)
30#define AMSTREAM_IOC_TRICK_STAT _IOR(AMSTREAM_IOC_MAGIC, 0x14, unsigned long)
31#define AMSTREAM_IOC_AUDIO_RESET _IO(AMSTREAM_IOC_MAGIC, 0x15)
32#define AMSTREAM_IOC_SID _IOW(AMSTREAM_IOC_MAGIC, 0x16, int)
33#define AMSTREAM_IOC_VPAUSE _IOW(AMSTREAM_IOC_MAGIC, 0x17, int)
34#define AMSTREAM_IOC_AVTHRESH _IOW(AMSTREAM_IOC_MAGIC, 0x18, int)
35#define AMSTREAM_IOC_SYNCTHRESH _IOW(AMSTREAM_IOC_MAGIC, 0x19, int)
36#define AMSTREAM_IOC_SUB_RESET _IOW(AMSTREAM_IOC_MAGIC, 0x1a, int)
37#define AMSTREAM_IOC_SUB_LENGTH _IOR(AMSTREAM_IOC_MAGIC, 0x1b, unsigned long)
38#define AMSTREAM_IOC_SET_DEC_RESET _IOW(AMSTREAM_IOC_MAGIC, 0x1c, int)
39#define AMSTREAM_IOC_TS_SKIPBYTE _IOW(AMSTREAM_IOC_MAGIC, 0x1d, int)
40#define AMSTREAM_IOC_SUB_TYPE _IOW(AMSTREAM_IOC_MAGIC, 0x1e, int)
41#define AMSTREAM_IOC_CLEAR_VIDEO _IOW(AMSTREAM_IOC_MAGIC, 0x1f, int)
42
43#define AMSTREAM_IOC_APTS _IOR(AMSTREAM_IOC_MAGIC, 0x40, unsigned long)
44#define AMSTREAM_IOC_VPTS _IOR(AMSTREAM_IOC_MAGIC, 0x41, unsigned long)
45#define AMSTREAM_IOC_PCRSCR _IOR(AMSTREAM_IOC_MAGIC, 0x42, unsigned long)
46#define AMSTREAM_IOC_SYNCENABLE _IOW(AMSTREAM_IOC_MAGIC, 0x43, unsigned long)
47#define AMSTREAM_IOC_GET_SYNC_ADISCON _IOR(AMSTREAM_IOC_MAGIC, 0x44, unsigned long)
48#define AMSTREAM_IOC_SET_SYNC_ADISCON _IOW(AMSTREAM_IOC_MAGIC, 0x45, unsigned long)
49#define AMSTREAM_IOC_GET_SYNC_VDISCON _IOR(AMSTREAM_IOC_MAGIC, 0x46, unsigned long)
50#define AMSTREAM_IOC_SET_SYNC_VDISCON _IOW(AMSTREAM_IOC_MAGIC, 0x47, unsigned long)
51#define AMSTREAM_IOC_GET_VIDEO_DISABLE _IOR(AMSTREAM_IOC_MAGIC, 0x48, unsigned long)
52#define AMSTREAM_IOC_SET_VIDEO_DISABLE _IOW(AMSTREAM_IOC_MAGIC, 0x49, unsigned long)
53#define AMSTREAM_IOC_SET_PCRSCR _IOW(AMSTREAM_IOC_MAGIC, 0x4a, unsigned long)
54#define AMSTREAM_IOC_GET_VIDEO_AXIS _IOR(AMSTREAM_IOC_MAGIC, 0x4b, unsigned long)
55#define AMSTREAM_IOC_SET_VIDEO_AXIS _IOW(AMSTREAM_IOC_MAGIC, 0x4c, unsigned long)
56#define AMSTREAM_IOC_GET_VIDEO_CROP _IOR(AMSTREAM_IOC_MAGIC, 0x4d, unsigned long)
57#define AMSTREAM_IOC_SET_VIDEO_CROP _IOW(AMSTREAM_IOC_MAGIC, 0x4e, unsigned long)
58
59// VPP.VE IOCTL command list
60#define AMSTREAM_IOC_VE_BEXT _IOW(AMSTREAM_IOC_MAGIC, 0x20, struct ve_bext_s )
61#define AMSTREAM_IOC_VE_DNLP _IOW(AMSTREAM_IOC_MAGIC, 0x21, struct ve_dnlp_s )
62#define AMSTREAM_IOC_VE_HSVS _IOW(AMSTREAM_IOC_MAGIC, 0x22, struct ve_hsvs_s )
63#define AMSTREAM_IOC_VE_CCOR _IOW(AMSTREAM_IOC_MAGIC, 0x23, struct ve_ccor_s )
64#define AMSTREAM_IOC_VE_BENH _IOW(AMSTREAM_IOC_MAGIC, 0x24, struct ve_benh_s )
65#define AMSTREAM_IOC_VE_DEMO _IOW(AMSTREAM_IOC_MAGIC, 0x25, struct ve_demo_s )
66#define AMSTREAM_IOC_VE_VDO_MEAS _IOW(AMSTREAM_IOC_MAGIC, 0x27, struct vdo_meas_s )
67#define AMSTREAM_IOC_VE_DEBUG _IOWR(AMSTREAM_IOC_MAGIC, 0x28, unsigned long long)
68#define AMSTREAM_IOC_VE_REGMAP _IOW(AMSTREAM_IOC_MAGIC, 0x29, struct ve_regmap_s)
69
70// VPP.CM IOCTL command list
71#define AMSTREAM_IOC_CM_REGION _IOW(AMSTREAM_IOC_MAGIC, 0x30, struct cm_region_s)
72#define AMSTREAM_IOC_CM_TOP _IOW(AMSTREAM_IOC_MAGIC, 0x31, struct cm_top_s )
73#define AMSTREAM_IOC_CM_DEMO _IOW(AMSTREAM_IOC_MAGIC, 0x32, struct cm_demo_s )
74#define AMSTREAM_IOC_CM_DEBUG _IOWR(AMSTREAM_IOC_MAGIC, 0x33, unsigned long long)
75#define AMSTREAM_IOC_CM_REGMAP _IOW(AMSTREAM_IOC_MAGIC, 0x34, struct cm_regmap_s)
76
77//VPP.3D IOCTL command list
78#define AMSTREAM_IOC_SET_3D_TYPE _IOW(AMSTREAM_IOC_MAGIC, 0x3c, unsigned int)
79#define AMSTREAM_IOC_GET_3D_TYPE _IOW(AMSTREAM_IOC_MAGIC, 0x3d, unsigned int)
80
81#define AMSTREAM_IOC_SUB_NUM _IOR(AMSTREAM_IOC_MAGIC, 0x50, unsigned long)
82#define AMSTREAM_IOC_SUB_INFO _IOR(AMSTREAM_IOC_MAGIC, 0x51, unsigned long)
83#define AMSTREAM_IOC_GET_BLACKOUT_POLICY _IOR(AMSTREAM_IOC_MAGIC, 0x52, unsigned long)
84#define AMSTREAM_IOC_SET_BLACKOUT_POLICY _IOW(AMSTREAM_IOC_MAGIC, 0x53, unsigned long)
85#define AMSTREAM_IOC_GET_SCREEN_MODE _IOR(AMSTREAM_IOC_MAGIC, 0x58, int)
86#define AMSTREAM_IOC_SET_SCREEN_MODE _IOW(AMSTREAM_IOC_MAGIC, 0x59, int)
87#define AMSTREAM_IOC_GET_VIDEO_DISCONTINUE_REPORT _IOR(AMSTREAM_IOC_MAGIC, 0x5a, int)
88#define AMSTREAM_IOC_SET_VIDEO_DISCONTINUE_REPORT _IOW(AMSTREAM_IOC_MAGIC, 0x5b, int)
89#define AMSTREAM_IOC_VF_STATUS _IOR(AMSTREAM_IOC_MAGIC, 0x60, unsigned long)
90#define AMSTREAM_IOC_CLEAR_VBUF _IO(AMSTREAM_IOC_MAGIC, 0x80)
91
92#define AMSTREAM_IOC_APTS_LOOKUP _IOR(AMSTREAM_IOC_MAGIC, 0x81, unsigned long)
93#define GET_FIRST_APTS_FLAG _IOR(AMSTREAM_IOC_MAGIC, 0x82, long)
94
95#define AMSTREAM_IOC_GET_SYNC_ADISCON_DIFF _IOR(AMSTREAM_IOC_MAGIC, 0x83, unsigned long)
96#define AMSTREAM_IOC_GET_SYNC_VDISCON_DIFF _IOR(AMSTREAM_IOC_MAGIC, 0x84, unsigned long)
97#define AMSTREAM_IOC_SET_SYNC_ADISCON_DIFF _IOW(AMSTREAM_IOC_MAGIC, 0x85, unsigned long)
98#define AMSTREAM_IOC_SET_SYNC_VDISCON_DIFF _IOW(AMSTREAM_IOC_MAGIC, 0x86, unsigned long)
99#define AMSTREAM_IOC_GET_FREERUN_MODE _IOR(AMSTREAM_IOC_MAGIC, 0x87, unsigned long)
100#define AMSTREAM_IOC_SET_FREERUN_MODE _IOW(AMSTREAM_IOC_MAGIC, 0x88, unsigned long)
101#define AMSTREAM_IOC_SET_DEMUX _IOW(AMSTREAM_IOC_MAGIC, 0x90, unsigned long)
102
103#define AMSTREAM_IOC_SET_VIDEO_DELAY_LIMIT_MS _IOW(AMSTREAM_IOC_MAGIC, 0xa0, unsigned long)
104#define AMSTREAM_IOC_GET_VIDEO_DELAY_LIMIT_MS _IOR(AMSTREAM_IOC_MAGIC, 0xa1, unsigned long)
105#define AMSTREAM_IOC_SET_AUDIO_DELAY_LIMIT_MS _IOW(AMSTREAM_IOC_MAGIC, 0xa2, unsigned long)
106#define AMSTREAM_IOC_GET_AUDIO_DELAY_LIMIT_MS _IOR(AMSTREAM_IOC_MAGIC, 0xa3, unsigned long)
107#define AMSTREAM_IOC_GET_AUDIO_CUR_DELAY_MS _IOR(AMSTREAM_IOC_MAGIC, 0xa4, unsigned long)
108#define AMSTREAM_IOC_GET_VIDEO_CUR_DELAY_MS _IOR(AMSTREAM_IOC_MAGIC, 0xa5, unsigned long)
109#define AMSTREAM_IOC_GET_AUDIO_AVG_BITRATE_BPS _IOR(AMSTREAM_IOC_MAGIC, 0xa6, unsigned long)
110#define AMSTREAM_IOC_GET_VIDEO_AVG_BITRATE_BPS _IOR(AMSTREAM_IOC_MAGIC, 0xa7, unsigned long)
111
112#define TRICKMODE_NONE 0x00
113#define TRICKMODE_I 0x01
114#define TRICKMODE_FFFB 0x02
115
116#define TRICK_STAT_DONE 0x01
117#define TRICK_STAT_WAIT 0x00
118
119#define AUDIO_EXTRA_DATA_SIZE (4096)
120#define MAX_SUB_NUM 32
121/*
122enum VIDEO_DEC_TYPE
123{
124 VIDEO_DEC_FORMAT_UNKNOW,
125 VIDEO_DEC_FORMAT_MPEG4_3,
126 VIDEO_DEC_FORMAT_MPEG4_4,
127 VIDEO_DEC_FORMAT_MPEG4_5,
128 VIDEO_DEC_FORMAT_H264,
129 VIDEO_DEC_FORMAT_MJPEG,
130 VIDEO_DEC_FORMAT_MP4,
131 VIDEO_DEC_FORMAT_H263,
132 VIDEO_DEC_FORMAT_REAL_8,
133 VIDEO_DEC_FORMAT_REAL_9,
134 VIDEO_DEC_FORMAT_WMV3,
135 VIDEO_DEC_FORMAT_WVC1,
136 VIDEO_DEC_FORMAT_SW,
137 VIDEO_DEC_FORMAT_MAX
138};
139*/
140struct buf_status {
141 int size;
142 int data_len;
143 int free_len;
144 unsigned int read_pointer;
145 unsigned int write_pointer;
146};
147
148
149struct vdec_status {
150 unsigned int width;
151 unsigned int height;
152 unsigned int fps;
153 unsigned int error_count;
154 unsigned int status;
155};
156
157struct adec_status {
158 unsigned int channels;
159 unsigned int sample_rate;
160 unsigned int resolution;
161 unsigned int error_count;
162 unsigned int status;
163};
164
165struct am_io_param {
166 union {
167 int data;
168 int id;//get bufstatus? //or others
169 };
170
171 int len; //buffer size;
172
173 union {
174 char buf[1];
175 struct buf_status status;
176 struct vdec_status vstatus;
177 struct adec_status astatus;
178 };
179};
180struct audio_info {
181 int valid;
182 int sample_rate;
183 int channels;
184 int bitrate;
185 int codec_id;
186 int block_align;
187 int extradata_size;
188 char extradata[AUDIO_EXTRA_DATA_SIZE];
189};
190
191struct dec_sysinfo {
192 unsigned int format;
193 unsigned int width;
194 unsigned int height;
195 unsigned int rate;
196 unsigned int extra;
197 unsigned int status;
198 unsigned int ratio;
199 void *param;
200 unsigned long long ratio64;
201};
202
203struct subtitle_info {
204 unsigned char id;
205 unsigned char width;
206 unsigned char height;
207 unsigned char type;
208};
209
210struct codec_profile_t {
211 char *name; // video codec short name
212 char *profile; // Attributes,seperated by commas
213};
214#define SUPPORT_VDEC_NUM (8)
215
216int vcodec_profile_register(const struct codec_profile_t *vdec_profile);
217int vcodec_profile_read(char *buf);
218
219#ifdef __KERNEL__
220#ifdef ENABLE_DEMUX_DRIVER
221/*TS demux operation interface*/
222struct tsdemux_ops {
223 int (*reset)(void);
224 int (*set_reset_flag)(void);
225 int (*request_irq)(irq_handler_t handler, void *data);
226 int (*free_irq)(void);
227 int (*set_vid)(int vpid);
228 int (*set_aid)(int apid);
229 int (*set_sid)(int spid);
230 int (*set_skipbyte)(int skipbyte);
231 int (*set_demux)(int dev);
232};
233
234void tsdemux_set_ops(struct tsdemux_ops *ops);
235int tsdemux_set_reset_flag(void);
236
237#endif /*ENABLE_DEMUX_DRIVER*/
238void set_vdec_func(int (*vdec_func)(struct vdec_status *));
239void set_adec_func(int (*adec_func)(struct adec_status *));
240void set_trickmode_func(int (*trickmode_func)(unsigned long trickmode));
241void wakeup_sub_poll(void);
242int wakeup_userdata_poll(int wp, int start_phyaddr, int buf_size);
243int get_sub_type(void);
244#endif
245
246typedef struct tcon_gamma_table_s {
247 unsigned short data[256];
248} tcon_gamma_table_t;
249
250typedef struct tcon_rgb_ogo_s {
251 unsigned int en;
252 int r_pre_offset; // s11.0, range -1024~+1023, default is 0
253 int g_pre_offset; // s11.0, range -1024~+1023, default is 0
254 int b_pre_offset; // s11.0, range -1024~+1023, default is 0
255 unsigned int r_gain; // u1.10, range 0~2047, default is 1024 (1.0x)
256 unsigned int g_gain; // u1.10, range 0~2047, default is 1024 (1.0x)
257 unsigned int b_gain; // u1.10, range 0~2047, default is 1024 (1.0x)
258 int r_post_offset; // s11.0, range -1024~+1023, default is 0
259 int g_post_offset; // s11.0, range -1024~+1023, default is 0
260 int b_post_offset; // s11.0, range -1024~+1023, default is 0
261} tcon_rgb_ogo_t;
262
263#endif //__AMSTREAM_H__
264