typo fixes
[mplayer/greg.git] / libvo / video_out.h
blob369aa32fc8225ba5807020b3c200a29bd0e37581
1 /*
2 * video_out.h
4 * Copyright (C) Aaron Holtzman - Aug 1999
5 * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
6 * (C) MPlayer Developers
8 */
10 #ifndef __VIDEO_OUT_H
11 #define __VIDEO_OUT_H 1
13 #include <inttypes.h>
14 #include <stdarg.h>
16 //#include "font_load.h"
17 #include "img_format.h"
18 //#include "vidix/vidix.h"
20 #define VO_EVENT_EXPOSE 1
21 #define VO_EVENT_RESIZE 2
22 #define VO_EVENT_KEYPRESS 4
24 /* Obsolete: VOCTRL_QUERY_VAA 1 */
25 /* does the device support the required format */
26 #define VOCTRL_QUERY_FORMAT 2
27 /* signal a device reset seek */
28 #define VOCTRL_RESET 3
29 /* true if vo driver can use GUI created windows */
30 #define VOCTRL_GUISUPPORT 4
31 #define VOCTRL_GUI_NOWINDOW 19
32 /* used to switch to fullscreen */
33 #define VOCTRL_FULLSCREEN 5
34 #define VOCTRL_SCREENSHOT 6
35 /* signal a device pause */
36 #define VOCTRL_PAUSE 7
37 /* start/resume playback */
38 #define VOCTRL_RESUME 8
39 /* libmpcodecs direct rendering: */
40 #define VOCTRL_GET_IMAGE 9
41 #define VOCTRL_DRAW_IMAGE 13
42 #define VOCTRL_SET_SPU_PALETTE 14
43 /* decoding ahead: */
44 #define VOCTRL_GET_NUM_FRAMES 10
45 #define VOCTRL_GET_FRAME_NUM 11
46 #define VOCTRL_SET_FRAME_NUM 12
47 #define VOCTRL_GET_PANSCAN 15
48 #define VOCTRL_SET_PANSCAN 16
49 /* equalizer controls */
50 #define VOCTRL_SET_EQUALIZER 17
51 #define VOCTRL_GET_EQUALIZER 18
52 //#define VOCTRL_GUI_NOWINDOW 19
53 /* Frame duplication */
54 #define VOCTRL_DUPLICATE_FRAME 20
55 // ... 21
56 #define VOCTRL_START_SLICE 21
58 #define VOCTRL_ONTOP 25
59 #define VOCTRL_ROOTWIN 26
60 #define VOCTRL_BORDER 27
62 // Vo can be used by xover
63 #define VOCTRL_XOVERLAY_SUPPORT 22
65 #define VOCTRL_XOVERLAY_SET_COLORKEY 24
66 typedef struct {
67 uint32_t x11; // The raw x11 color
68 uint16_t r,g,b;
69 } mp_colorkey_t;
71 #define VOCTRL_XOVERLAY_SET_WIN 23
72 typedef struct {
73 int x,y;
74 int w,h;
75 } mp_win_t;
77 #define VO_TRUE 1
78 #define VO_FALSE 0
79 #define VO_ERROR -1
80 #define VO_NOTAVAIL -2
81 #define VO_NOTIMPL -3
83 #define VOFLAG_FULLSCREEN 0x01
84 #define VOFLAG_MODESWITCHING 0x02
85 #define VOFLAG_SWSCALE 0x04
86 #define VOFLAG_FLIPPING 0x08
87 #define VOFLAG_XOVERLAY_SUB_VO 0x10000
89 typedef struct vo_info_s
91 /* driver name ("Matrox Millennium G200/G400" */
92 const char *name;
93 /* short name (for config strings) ("mga") */
94 const char *short_name;
95 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
96 const char *author;
97 /* any additional comments */
98 const char *comment;
99 } vo_info_t;
101 typedef struct vo_functions_s
103 vo_info_t *info;
105 * Preinitializes driver (real INITIALIZATION)
106 * arg - currently it's vo_subdevice
107 * returns: zero on successful initialization, non-zero on error.
109 int (*preinit)(const char *arg);
111 * Initialize (means CONFIGURE) the display driver.
112 * params:
113 * width,height: image source size
114 * d_width,d_height: size of the requested window size, just a hint
115 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint
116 * title: window title, if available
117 * format: fourcc of pixel format
118 * returns : zero on successful initialization, non-zero on error.
120 int (*config)(uint32_t width, uint32_t height, uint32_t d_width,
121 uint32_t d_height, uint32_t fullscreen, char *title,
122 uint32_t format);
125 * Control interface
127 int (*control)(uint32_t request, void *data, ...);
130 * Display a new RGB/BGR frame of the video to the screen.
131 * params:
132 * src[0] - pointer to the image
134 int (*draw_frame)(uint8_t *src[]);
137 * Draw a planar YUV slice to the buffer:
138 * params:
139 * src[3] = source image planes (Y,U,V)
140 * stride[3] = source image planes line widths (in bytes)
141 * w,h = width*height of area to be copied (in Y pixels)
142 * x,y = position at the destination image (in Y pixels)
144 int (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
147 * Draws OSD to the screen buffer
149 void (*draw_osd)(void);
152 * Blit/Flip buffer to the screen. Must be called after each frame!
154 void (*flip_page)(void);
157 * This func is called after every frames to handle keyboard and
158 * other events. It's called in PAUSE mode too!
160 void (*check_events)(void);
163 * Closes driver. Should restore the original state of the system.
165 void (*uninit)(void);
167 } vo_functions_t;
169 char *vo_format_name(int format);
170 int vo_init(void);
172 vo_functions_t* init_best_video_out(char** vo_list);
173 void list_video_out(void);
175 // NULL terminated array of all drivers
176 extern vo_functions_t* video_out_drivers[];
178 extern int vo_flags;
180 extern int vo_config_count;
182 extern int xinerama_screen;
183 extern int xinerama_x;
184 extern int xinerama_y;
186 // correct resolution/bpp on screen: (should be autodetected by vo_init())
187 extern int vo_depthonscreen;
188 extern int vo_screenwidth;
189 extern int vo_screenheight;
191 // requested resolution/bpp: (-x -y -bpp options)
192 extern int vo_dx;
193 extern int vo_dy;
194 extern int vo_dwidth;
195 extern int vo_dheight;
196 extern int vo_dbpp;
198 extern int vo_grabpointer;
199 extern int vo_doublebuffering;
200 extern int vo_directrendering;
201 extern int vo_vsync;
202 extern int vo_fs;
203 extern int vo_fsmode;
204 extern float vo_panscan;
205 extern int vo_adapter_num;
206 extern int vo_refresh_rate;
207 extern int vo_keepaspect;
208 extern int vo_rootwin;
209 extern int vo_ontop;
210 extern int vo_border;
212 extern int vo_gamma_brightness;
213 extern int vo_gamma_saturation;
214 extern int vo_gamma_contrast;
215 extern int vo_gamma_hue;
216 extern int vo_gamma_red_intensity;
217 extern int vo_gamma_green_intensity;
218 extern int vo_gamma_blue_intensity;
220 extern int vo_nomouse_input;
222 extern int vo_pts;
223 extern float vo_fps;
225 extern char *vo_subdevice;
227 extern int vo_colorkey;
229 extern int WinID;
231 #if defined(HAVE_FBDEV)||defined(HAVE_VESA)
233 typedef struct {
234 float min;
235 float max;
236 } range_t;
238 extern float range_max(range_t *r);
239 extern int in_range(range_t *r, float f);
240 extern range_t *str2range(char *s);
241 extern char *monitor_hfreq_str;
242 extern char *monitor_vfreq_str;
243 extern char *monitor_dotclock_str;
245 #endif
247 #endif