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