Mercurial > mplayer.hg
annotate libvo/video_out.h @ 6953:ce67cc1f0beb
ignore BadAccess error at XSelectInput() (grabbing mouse etc) with warning
patch Kazunori Ueno <jagarl@creator.club.ne.jp>
author | arpi |
---|---|
date | Fri, 09 Aug 2002 17:43:49 +0000 |
parents | 924263b4df10 |
children | 98bed9e12087 |
rev | line source |
---|---|
1 | 1 /* |
2 * video_out.h | |
3 * | |
4 * Copyright (C) Aaron Holtzman - Aug 1999 | |
31 | 5 * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001 |
6781 | 6 * (C) MPlayer Developers |
1 | 7 * |
8 */ | |
4933 | 9 |
10 #ifndef __VIDEO_OUT_H | |
11 #define __VIDEO_OUT_H 1 | |
1 | 12 |
13 #include <inttypes.h> | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
14 #include <stdarg.h> |
1 | 15 |
5294 | 16 //#include "font_load.h" |
408 | 17 #include "img_format.h" |
4352 | 18 #include "../vidix/vidix.h" |
1 | 19 |
31 | 20 #define VO_EVENT_EXPOSE 1 |
21 #define VO_EVENT_RESIZE 2 | |
22 #define VO_EVENT_KEYPRESS 4 | |
23 | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
24 /* takes a pointer to a vo_vaa_s struct */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
25 #define VOCTRL_QUERY_VAA 1 |
6781 | 26 /* does the device support the required format */ |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
27 #define VOCTRL_QUERY_FORMAT 2 |
4754 | 28 /* signal a device reset seek */ |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
29 #define VOCTRL_RESET 3 |
4618 | 30 /* true if vo driver can use GUI created windows */ |
31 #define VOCTRL_GUISUPPORT 4 | |
4731 | 32 /* used to switch to fullscreen */ |
33 #define VOCTRL_FULLSCREEN 5 | |
4738 | 34 #define VOCTRL_SCREENSHOT 6 |
4754 | 35 /* signal a device pause */ |
36 #define VOCTRL_PAUSE 7 | |
37 /* start/resume playback */ | |
38 #define VOCTRL_RESUME 8 | |
4971 | 39 /* libmpcodecs direct rendering: */ |
40 #define VOCTRL_GET_IMAGE 9 | |
5502 | 41 #define VOCTRL_DRAW_IMAGE 13 |
6110 | 42 #define VOCTRL_SET_SPU_PALETTE 14 |
5002 | 43 /* decoding ahead: */ |
44 #define VOCTRL_GET_NUM_FRAMES 10 | |
45 #define VOCTRL_GET_FRAME_NUM 11 | |
46 #define VOCTRL_SET_FRAME_NUM 12 | |
6308 | 47 #define VOCTRL_GET_PANSCAN 15 |
48 #define VOCTRL_SET_PANSCAN 16 | |
6781 | 49 /* equalizer controls */ |
50 #define VOCTRL_SET_EQUALIZER 17 | |
51 #define VOCTRL_GET_EQUALIZER 18 | |
6307 | 52 |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
53 #define VO_TRUE 1 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
54 #define VO_FALSE 0 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
55 #define VO_ERROR -1 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
56 #define VO_NOTAVAIL -2 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
57 #define VO_NOTIMPL -3 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
58 |
4736 | 59 #define VOFLAG_FULLSCREEN 0x01 |
60 #define VOFLAG_MODESWITCHING 0x02 | |
61 #define VOFLAG_SWSCALE 0x04 | |
62 #define VOFLAG_FLIPPING 0x08 | |
63 | |
1 | 64 typedef struct vo_info_s |
65 { | |
66 /* driver name ("Matrox Millennium G200/G400" */ | |
67 const char *name; | |
68 /* short name (for config strings) ("mga") */ | |
69 const char *short_name; | |
70 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */ | |
71 const char *author; | |
72 /* any additional comments */ | |
73 const char *comment; | |
74 } vo_info_t; | |
75 | |
4352 | 76 /* Direct access to BES */ |
77 typedef struct bes_da_s | |
78 { | |
79 vidix_rect_t dest; /* This field should be filled by x,y,w,h | |
80 from vidix:src but pitches from | |
81 vidix:dest */ | |
82 int flags; /* Probably will work only when flag == 0 */ | |
83 /* memory model */ | |
4618 | 84 unsigned frame_size; /* destination frame size */ |
85 unsigned num_frames; /* number of available frames */ | |
4352 | 86 unsigned offsets[VID_PLAY_MAXFRAMES]; /* relative offset of each frame from begin of video memory */ |
87 vidix_yuv_t offset; /* relative offsets within frame for yuv planes */ | |
88 void* dga_addr; /* linear address of BES */ | |
89 }bes_da_t; | |
90 | |
91 /* | |
92 Video Accelearted Architecture. | |
93 Every field of this structure can be set to NULL that means that | |
94 features is not supported | |
95 */ | |
96 typedef struct vo_vaa_s | |
97 { | |
98 uint32_t flags; /* currently undefined */ | |
99 /* | |
100 * Query Direct Access to BES | |
101 * info - information to be filled | |
102 * returns: 0 on success errno on error. | |
103 */ | |
104 int (*query_bes_da)(bes_da_t *info); | |
105 int (*get_video_eq)(vidix_video_eq_t *info); | |
106 int (*set_video_eq)(const vidix_video_eq_t *info); | |
107 int (*get_num_fx)(unsigned *info); | |
108 int (*get_oem_fx)(vidix_oem_fx_t *info); | |
109 int (*set_oem_fx)(const vidix_oem_fx_t *info); | |
110 int (*set_deint)(const vidix_deinterlace_t *info); | |
111 }vo_vaa_t; | |
112 | |
4433 | 113 /* Misc info to tuneup vo driver */ |
114 typedef struct vo_tune_info_s | |
115 { | |
116 int pitch[3]; /* Should be 0 if unknown else power of 2 */ | |
117 }vo_tune_info_t; | |
118 | |
1 | 119 typedef struct vo_functions_s |
120 { | |
4352 | 121 /* |
122 * Preinitializes driver (real INITIALIZATION) | |
123 * arg - currently it's vo_subdevice | |
124 * returns: zero on successful initialization, non-zero on error. | |
125 */ | |
126 uint32_t (*preinit)(const char *arg); | |
1 | 127 /* |
4352 | 128 * Initialize (means CONFIGURE) the display driver. |
31 | 129 * params: |
130 * width,height: image source size | |
131 * d_width,d_height: size of the requested window size, just a hint | |
132 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint | |
133 * title: window title, if available | |
134 * format: fourcc of pixel format | |
135 * returns : zero on successful initialization, non-zero on error. | |
1 | 136 */ |
4433 | 137 uint32_t (*config)(uint32_t width, uint32_t height, uint32_t d_width, |
138 uint32_t d_height, uint32_t fullscreen, char *title, | |
139 uint32_t format,const vo_tune_info_t *); | |
1 | 140 |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
141 /* |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
142 * Control interface |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
143 */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
144 uint32_t (*control)(uint32_t request, void *data, ...); |
1 | 145 |
146 /* | |
147 * Return driver information. | |
148 * returns : read-only pointer to a vo_info_t structure. | |
149 */ | |
150 const vo_info_t* (*get_info)(void); | |
151 | |
152 /* | |
31 | 153 * Display a new RGB/BGR frame of the video to the screen. |
154 * params: | |
155 * src[0] - pointer to the image | |
1 | 156 */ |
157 uint32_t (*draw_frame)(uint8_t *src[]); | |
158 | |
159 /* | |
31 | 160 * Draw a planar YUV slice to the buffer: |
161 * params: | |
162 * src[3] = source image planes (Y,U,V) | |
163 * stride[3] = source image planes line widths (in bytes) | |
164 * w,h = width*height of area to be copied (in Y pixels) | |
165 * x,y = position at the destination image (in Y pixels) | |
1 | 166 */ |
167 uint32_t (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y); | |
168 | |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
169 /* |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
170 * Draws OSD to the screen buffer |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
171 */ |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
172 void (*draw_osd)(void); |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
173 |
1 | 174 /* |
31 | 175 * Blit/Flip buffer to the screen. Must be called after each frame! |
1 | 176 */ |
177 void (*flip_page)(void); | |
178 | |
31 | 179 /* |
180 * This func is called after every frames to handle keyboard and | |
181 * other events. It's called in PAUSE mode too! | |
182 */ | |
183 void (*check_events)(void); | |
184 | |
185 /* | |
186 * Closes driver. Should restore the original state of the system. | |
187 */ | |
1 | 188 void (*uninit)(void); |
189 | |
190 } vo_functions_t; | |
191 | |
1142 | 192 char *vo_format_name(int format); |
1326 | 193 int vo_init(void); |
194 | |
1 | 195 // NULL terminated array of all drivers |
196 extern vo_functions_t* video_out_drivers[]; | |
197 | |
4811
38a9cddd9e4d
added vo_dx,vo_dy (used currently only by X based outputs)
alex
parents:
4754
diff
changeset
|
198 extern int vo_flags; |
38a9cddd9e4d
added vo_dx,vo_dy (used currently only by X based outputs)
alex
parents:
4754
diff
changeset
|
199 |
5511 | 200 extern int vo_config_count; |
201 | |
4618 | 202 // correct resolution/bpp on screen: (should be autodetected by vo_init()) |
388 | 203 extern int vo_depthonscreen; |
204 extern int vo_screenwidth; | |
205 extern int vo_screenheight; | |
213 | 206 |
388 | 207 // requested resolution/bpp: (-x -y -bpp options) |
4811
38a9cddd9e4d
added vo_dx,vo_dy (used currently only by X based outputs)
alex
parents:
4754
diff
changeset
|
208 extern int vo_dx; |
38a9cddd9e4d
added vo_dx,vo_dy (used currently only by X based outputs)
alex
parents:
4754
diff
changeset
|
209 extern int vo_dy; |
388 | 210 extern int vo_dwidth; |
211 extern int vo_dheight; | |
212 extern int vo_dbpp; | |
213 | |
4981 | 214 extern int vo_old_x; |
215 extern int vo_old_y; | |
216 extern int vo_old_width; | |
217 extern int vo_old_height; | |
218 | |
1268 | 219 extern int vo_doublebuffering; |
5431
013458752947
disabling direct rendering by default (too buggy and conflicts with osd/sub)
arpi
parents:
5294
diff
changeset
|
220 extern int vo_directrendering; |
4667 | 221 extern int vo_vsync; |
4981 | 222 extern int vo_fs; |
1268 | 223 extern int vo_fsmode; |
6304
ee65527096c2
pan&scan support with -vo xv by ?? <mplayer@svennevid.net>
arpi
parents:
6110
diff
changeset
|
224 extern float vo_panscan; |
1268 | 225 |
6755 | 226 extern int vo_gamma_brightness; |
227 extern int vo_gamma_saturation; | |
228 extern int vo_gamma_contrast; | |
229 extern int vo_gamma_hue; | |
230 extern int vo_gamma_red_intensity; | |
231 extern int vo_gamma_green_intensity; | |
232 extern int vo_gamma_blue_intensity; | |
233 | |
5651
b8d8d72776f2
fix playlist bug with gui and rewrite mousecursor show/hide code
pontscho
parents:
5511
diff
changeset
|
234 extern int vo_mouse_timer_const; |
b8d8d72776f2
fix playlist bug with gui and rewrite mousecursor show/hide code
pontscho
parents:
5511
diff
changeset
|
235 |
2707 | 236 extern int vo_pts; |
3201 | 237 extern float vo_fps; |
2707 | 238 |
1184 | 239 extern char *vo_subdevice; |
240 | |
4933 | 241 #endif |