Mercurial > mplayer.hg
annotate vidix/vidix.h @ 4169:91b50468a1a4
Fix xvidix for non-x11 systems (delayed due netloss)
author | atmos4 |
---|---|
date | Tue, 15 Jan 2002 12:30:52 +0000 |
parents | b61ba6c256dd |
children | 62a6135d090e |
rev | line source |
---|---|
3991 | 1 /* |
2 * vidix.h | |
3 * VIDIX - VIDeo Interface for *niX | |
4 * This interface is introduced as universal one to MPEG decoder, | |
5 * BES == Back End Scaler and YUV2RGB hw accelerators. | |
6 * In the future it may be expanded up to capturing and audio things. | |
7 * Main goal of this this interface imlpementation is providing DGA | |
8 * everywhere where it's possible (unlike X11 and other). | |
9 * Copyright 2002 Nick Kurshev | |
10 * Licence: GPL | |
11 * This interface is based on v4l2, fbvid.h, mga_vid.h projects | |
12 * and personally my ideas. | |
13 * NOTE: This interface is introduces as driver interface. | |
14 * Don't use it for APP. | |
15 */ | |
16 #ifndef VIDIX_H | |
17 #define VIDIX_H | |
18 | |
19 #ifdef __cplusplus | |
20 extern "C" { | |
21 #endif | |
22 | |
23 #define VIDIX_VERSION 100 | |
24 | |
25 /* returns driver version */ | |
26 extern unsigned vixGetVersion( void ); | |
27 | |
28 /* Probes video hw. Returns 0 if ok else errno */ | |
3995 | 29 extern int vixProbe( int verbose ); |
3991 | 30 /* Initializes driver. Returns 0 if ok else errno */ |
31 extern int vixInit( void ); | |
32 /* Destroys driver */ | |
33 extern void vixDestroy( void ); | |
34 | |
35 typedef struct vidix_capability_s | |
36 { | |
37 char name[32]; /* Driver name */ | |
38 #define TYPE_OUTPUT 0x00000000 /* Is a video capture device */ | |
39 #define TYPE_CAPTURE 0x00000001 /* Is a CODEC device */ | |
40 #define TYPE_CODEC 0x00000002 /* Is a video output device */ | |
41 #define TYPE_FX 0x00000004 /* Is a video effects device */ | |
42 int type; /* Device type, see below */ | |
43 int inputs; /* Num video inputs */ | |
44 int outputs; /* Num video outputs */ | |
45 int in_audios; /* Num audio inputs */ | |
46 int out_audios; /* Num audio outputs */ | |
47 int maxwidth; | |
48 int maxheight; | |
49 int minwidth; | |
50 int minheight; | |
51 int maxframerate; /* -1 if unlimited */ | |
52 #define FLAG_NONE 0x00000000 /* No flags defined */ | |
53 #define FLAG_DMA 0x00000001 /* Card can use DMA */ | |
54 #define FLAG_UPSCALER 0x00000010 /* Card supports hw upscaling */ | |
55 #define FLAG_DOWNSCALER 0x00000020 /* Card supports hw downscaling */ | |
56 #define FLAG_SUBPIC 0x00001000 /* Card supports DVD subpictures */ | |
57 unsigned flags; /* Feature flags, see below */ | |
58 unsigned short vendor_id; | |
59 unsigned short device_id; | |
60 unsigned reserved[4]; | |
61 }vidix_capability_t; | |
62 | |
63 /* Should fill at least type before init. | |
64 Returns 0 if ok else errno */ | |
65 extern int vixGetCapability(vidix_capability_t *); | |
66 | |
67 typedef struct vidix_fourcc_s | |
68 { | |
69 unsigned fourcc; | |
70 #define VID_DEPTH_NONE 0x0000 | |
71 #define VID_DEPTH_1BPP 0x0001 | |
72 #define VID_DEPTH_2BPP 0x0002 | |
73 #define VID_DEPTH_4BPP 0x0004 | |
74 #define VID_DEPTH_8BPP 0x0008 | |
75 #define VID_DEPTH_12BPP 0x0010 | |
76 #define VID_DEPTH_15BPP 0x0020 | |
77 #define VID_DEPTH_16BPP 0x0040 | |
78 #define VID_DEPTH_24BPP 0x0080 | |
79 #define VID_DEPTH_32BPP 0x0100 | |
80 unsigned depth; | |
81 #define VID_CAP_NONE 0x0000 | |
82 #define VID_CAP_EXPAND 0x0001 /* if overlay can be bigger than source */ | |
83 #define VID_CAP_SHRINK 0x0002 /* if overlay can be smaller than source */ | |
84 #define VID_CAP_BLEND 0x0004 /* if overlay can be blended with framebuffer */ | |
85 #define VID_CAP_COLORKEY 0x0008 /* if overlay can be restricted to a colorkey */ | |
86 #define VID_CAP_ALPHAKEY 0x0010 /* if overlay can be restricted to an alpha channel */ | |
87 #define VID_CAP_COLORKEY_ISRANGE 0x0020 /* if the colorkey can be a range */ | |
88 #define VID_CAP_ALPHAKEY_ISRANGE 0x0040 /* if the alphakey can be a range */ | |
89 #define VID_CAP_COLORKEY_ISMAIN 0x0080 /* colorkey is checked against framebuffer */ | |
90 #define VID_CAP_COLORKEY_ISOVERLAY 0x0100 /* colorkey is checked against overlay */ | |
91 #define VID_CAP_ALPHAKEY_ISMAIN 0x0200 /* alphakey is checked against framebuffer */ | |
92 #define VID_CAP_ALPHAKEY_ISOVERLAY 0x0400 /* alphakey is checked against overlay */ | |
93 unsigned flags; | |
94 }vidix_fourcc_t; | |
95 | |
96 /* Returns 0 if ok else errno */ | |
97 extern int vixQueryFourcc(vidix_fourcc_t *); | |
98 | |
99 typedef struct vidix_yuv_s | |
100 { | |
101 unsigned y,u,v; | |
102 }vidix_yuv_t; | |
103 | |
104 typedef struct vidix_rect_s | |
105 { | |
106 unsigned x,y,w,h; /* in pixels */ | |
4008 | 107 vidix_yuv_t pitch; /* line-align in bytes */ |
3991 | 108 }vidix_rect_t; |
109 | |
110 typedef struct vidix_color_key_s | |
111 { | |
112 #define CKEY_FALSE 0 | |
113 #define CKEY_TRUE 1 | |
114 #define CKEY_EQ 2 | |
115 #define CKEY_NEQ 3 | |
116 unsigned op; /* defines logical operation */ | |
117 unsigned char red; | |
118 unsigned char green; | |
119 unsigned char blue; | |
120 unsigned char reserved; | |
121 }vidix_ckey_t; | |
122 | |
123 typedef struct vidix_video_key_s | |
124 { | |
125 #define VKEY_FALSE 0 | |
126 #define VKEY_TRUE 1 | |
127 #define VKEY_EQ 2 | |
128 #define VKEY_NEQ 3 | |
129 unsigned op; /* defines logical operation */ | |
130 unsigned char key[8]; | |
131 }vidix_vkey_t; | |
132 | |
133 typedef struct vidix_playback_s | |
134 { | |
135 unsigned fourcc; /* app -> driver: movies's fourcc */ | |
136 unsigned capability; /* app -> driver: what capability to use */ | |
137 unsigned blend_factor; /* app -> driver: blenfing factor */ | |
138 vidix_rect_t src; /* app -> driver: original movie size */ | |
139 vidix_rect_t dest; /* app -> driver: destinition movie size. driver->app dest_pitch */ | |
3995 | 140 /* memory model */ |
4008 | 141 unsigned frame_size; /* driver -> app; destinition frame size */ |
3991 | 142 unsigned num_frames; /* app -> driver; after call: driver -> app */ |
143 #define LVO_MAXFRAMES 32 | |
144 unsigned offsets[LVO_MAXFRAMES]; /* driver -> app */ | |
145 vidix_yuv_t offset; /* driver -> app: relative offsets within frame for yuv planes */ | |
146 void* dga_addr; /* driver -> app: linear address */ | |
3995 | 147 }vidix_playback_t; |
3991 | 148 |
149 /* Returns 0 if ok else errno */ | |
3995 | 150 extern int vixConfigPlayback(vidix_playback_t *); |
3991 | 151 |
152 /* Returns 0 if ok else errno */ | |
153 extern int vixPlaybackOn( void ); | |
154 | |
155 /* Returns 0 if ok else errno */ | |
156 extern int vixPlaybackOff( void ); | |
157 | |
158 /* Returns 0 if ok else errno */ | |
159 extern int vixPlaybackFrameSelect( unsigned frame_idx ); | |
160 | |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
161 typedef struct vidix_grkey_s |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
162 { |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
163 vidix_ckey_t ckey; /* app -> driver: color key */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
164 vidix_vkey_t vkey; /* app -> driver: video key */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
165 #define KEYS_PUT 0 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
166 #define KEYS_AND 1 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
167 #define KEYS_OR 2 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
168 #define KEYS_XOR 3 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
169 unsigned key_op; /* app -> driver: keys operations */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
170 }vidix_grkey_t; |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
171 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
172 /* Returns 0 if ok else errno */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
173 extern int vixGetGrKeys( vidix_grkey_t * ); |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
174 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
175 /* Returns 0 if ok else errno */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
176 extern int vixSetGrKeys( const vidix_grkey_t * ); |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
177 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
178 |
3991 | 179 typedef struct vidix_video_eq_s |
180 { | |
181 /* end-user app can have presets like: cold-normal-hot picture and so on */ | |
182 int brightness; /* -1000 : +1000 */ | |
183 int contrast; /* -1000 : +1000 */ | |
184 int saturation; /* -1000 : +1000 */ | |
185 int hue; /* -1000 : +1000 */ | |
186 int red_intense; /* -1000 : +1000 */ | |
187 int green_intense; /* -1000 : +1000 */ | |
188 int blue_intense; /* -1000 : +1000 */ | |
189 }vidix_video_eq_t; | |
190 | |
191 /* Returns 0 if ok else errno */ | |
192 extern int vixPlaybackGetEq( vidix_video_eq_t * ); | |
193 | |
194 /* Returns 0 if ok else errno */ | |
195 extern int vixPlaybackSetEq( const vidix_video_eq_t * ); | |
196 | |
197 typedef struct vidix_slice_s | |
198 { | |
199 void* address; /* app -> driver */ | |
200 unsigned size; /* app -> driver */ | |
201 vidix_rect_t slice; /* app -> driver */ | |
202 }vidix_slice_t; | |
203 | |
204 typedef struct vidix_dma_s | |
205 { | |
206 vidix_slice_t src; /* app -> driver */ | |
207 vidix_slice_t dest; /* app -> driver */ | |
208 #define LVO_DMA_NOSYNC 0 | |
209 #define LVO_DMA_SYNC 1 /* means: wait vsync or hsync */ | |
210 unsigned flags; /* app -> driver */ | |
211 }vidix_dma_t; | |
212 | |
213 /* Returns 0 if ok else errno */ | |
214 extern int vixPlaybackCopyFrame( const vidix_dma_t * ); | |
215 | |
216 #ifdef __cplusplus | |
217 } | |
218 #endif | |
219 | |
220 #endif |