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