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