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