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