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