1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef _UAPI_DVBVIDEO_H_
25#define _UAPI_DVBVIDEO_H_
26
27#include <linux/types.h>
28#ifndef __KERNEL__
29#include <stdint.h>
30#include <time.h>
31#endif
32
33typedef enum {
34 VIDEO_FORMAT_4_3,
35 VIDEO_FORMAT_16_9,
36 VIDEO_FORMAT_221_1
37} video_format_t;
38
39
40typedef enum {
41 VIDEO_SYSTEM_PAL,
42 VIDEO_SYSTEM_NTSC,
43 VIDEO_SYSTEM_PALN,
44 VIDEO_SYSTEM_PALNc,
45 VIDEO_SYSTEM_PALM,
46 VIDEO_SYSTEM_NTSC60,
47 VIDEO_SYSTEM_PAL60,
48 VIDEO_SYSTEM_PALM60
49} video_system_t;
50
51
52typedef enum {
53 VIDEO_PAN_SCAN,
54 VIDEO_LETTER_BOX,
55 VIDEO_CENTER_CUT_OUT
56} video_displayformat_t;
57
58typedef struct {
59 int w;
60 int h;
61 video_format_t aspect_ratio;
62} video_size_t;
63
64typedef enum {
65 VIDEO_SOURCE_DEMUX,
66 VIDEO_SOURCE_MEMORY
67
68
69} video_stream_source_t;
70
71
72typedef enum {
73 VIDEO_STOPPED,
74 VIDEO_PLAYING,
75 VIDEO_FREEZED
76} video_play_state_t;
77
78
79
80#define VIDEO_CMD_PLAY (0)
81#define VIDEO_CMD_STOP (1)
82#define VIDEO_CMD_FREEZE (2)
83#define VIDEO_CMD_CONTINUE (3)
84
85
86#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0)
87
88
89#define VIDEO_CMD_STOP_TO_BLACK (1 << 0)
90#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1)
91
92
93
94#define VIDEO_PLAY_FMT_NONE (0)
95
96#define VIDEO_PLAY_FMT_GOP (1)
97
98
99
100struct video_command {
101 __u32 cmd;
102 __u32 flags;
103 union {
104 struct {
105 __u64 pts;
106 } stop;
107
108 struct {
109
110
111
112
113
114 __s32 speed;
115 __u32 format;
116 } play;
117
118 struct {
119 __u32 data[16];
120 } raw;
121 };
122};
123
124
125
126
127#define VIDEO_VSYNC_FIELD_UNKNOWN (0)
128#define VIDEO_VSYNC_FIELD_ODD (1)
129#define VIDEO_VSYNC_FIELD_EVEN (2)
130#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3)
131
132struct video_event {
133 __s32 type;
134#define VIDEO_EVENT_SIZE_CHANGED 1
135#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
136#define VIDEO_EVENT_DECODER_STOPPED 3
137#define VIDEO_EVENT_VSYNC 4
138 __kernel_time_t timestamp;
139 union {
140 video_size_t size;
141 unsigned int frame_rate;
142 unsigned char vsync_field;
143 } u;
144};
145
146
147struct video_status {
148 int video_blank;
149 video_play_state_t play_state;
150 video_stream_source_t stream_source;
151 video_format_t video_format;
152 video_displayformat_t display_format;
153};
154
155
156struct video_still_picture {
157 char __user *iFrame;
158 __s32 size;
159};
160
161
162typedef
163struct video_highlight {
164 int active;
165 __u8 contrast1;
166
167 __u8 contrast2;
168
169 __u8 color1;
170
171 __u8 color2;
172
173 __u32 ypos;
174
175
176 __u32 xpos;
177
178
179} video_highlight_t;
180
181
182typedef struct video_spu {
183 int active;
184 int stream_id;
185} video_spu_t;
186
187
188typedef struct video_spu_palette {
189 int length;
190 __u8 __user *palette;
191} video_spu_palette_t;
192
193
194typedef struct video_navi_pack {
195 int length;
196 __u8 data[1024];
197} video_navi_pack_t;
198
199
200typedef __u16 video_attributes_t;
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215#define VIDEO_CAP_MPEG1 1
216#define VIDEO_CAP_MPEG2 2
217
218
219
220#define VIDEO_CAP_SYS 4
221#define VIDEO_CAP_PROG 8
222
223
224#define VIDEO_CAP_SPU 16
225#define VIDEO_CAP_NAVI 32
226#define VIDEO_CAP_CSS 64
227
228
229#define VIDEO_STOP _IO('o', 21)
230#define VIDEO_PLAY _IO('o', 22)
231#define VIDEO_FREEZE _IO('o', 23)
232#define VIDEO_CONTINUE _IO('o', 24)
233#define VIDEO_SELECT_SOURCE _IO('o', 25)
234#define VIDEO_SET_BLANK _IO('o', 26)
235#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status)
236#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event)
237#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29)
238#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture)
239#define VIDEO_FAST_FORWARD _IO('o', 31)
240#define VIDEO_SLOWMOTION _IO('o', 32)
241#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int)
242#define VIDEO_CLEAR_BUFFER _IO('o', 34)
243#define VIDEO_SET_ID _IO('o', 35)
244#define VIDEO_SET_STREAMTYPE _IO('o', 36)
245#define VIDEO_SET_FORMAT _IO('o', 37)
246#define VIDEO_SET_SYSTEM _IO('o', 38)
247#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t)
248#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t)
249#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t)
250#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t)
251#define VIDEO_SET_ATTRIBUTES _IO('o', 53)
252#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t)
253#define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int)
254
255
256
257
258
259
260
261
262
263
264
265
266#define VIDEO_GET_PTS _IOR('o', 57, __u64)
267
268
269#define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64)
270
271#define VIDEO_COMMAND _IOWR('o', 59, struct video_command)
272#define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command)
273
274#endif
275