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