10l initial patch by Oded Shimon <ods15 at ods15.dyndns.org>
[mplayer/greg.git] / libvo / video_out.h
blob1ed670eb3eea7459d55751156aa430f153efbc03
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
61 // Vo can be used by xover
62 #define VOCTRL_XOVERLAY_SUPPORT 22
64 #define VOCTRL_XOVERLAY_SET_COLORKEY 24
65 typedef struct {
66 uint32_t x11; // The raw x11 color
67 uint16_t r,g,b;
68 } mp_colorkey_t;
70 #define VOCTRL_XOVERLAY_SET_WIN 23
71 typedef struct {
72 int x,y;
73 int w,h;
74 } mp_win_t;
76 #define VO_TRUE 1
77 #define VO_FALSE 0
78 #define VO_ERROR -1
79 #define VO_NOTAVAIL -2
80 #define VO_NOTIMPL -3
82 #define VOFLAG_FULLSCREEN 0x01
83 #define VOFLAG_MODESWITCHING 0x02
84 #define VOFLAG_SWSCALE 0x04
85 #define VOFLAG_FLIPPING 0x08
86 #define VOFLAG_XOVERLAY_SUB_VO 0x10000
88 typedef struct vo_info_s
90 /* driver name ("Matrox Millennium G200/G400" */
91 const char *name;
92 /* short name (for config strings) ("mga") */
93 const char *short_name;
94 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
95 const char *author;
96 /* any additional comments */
97 const char *comment;
98 } vo_info_t;
100 typedef struct vo_functions_s
102 vo_info_t *info;
104 * Preinitializes driver (real INITIALIZATION)
105 * arg - currently it's vo_subdevice
106 * returns: zero on successful initialization, non-zero on error.
108 uint32_t (*preinit)(const char *arg);
110 * Initialize (means CONFIGURE) the display driver.
111 * params:
112 * width,height: image source size
113 * d_width,d_height: size of the requested window size, just a hint
114 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint
115 * title: window title, if available
116 * format: fourcc of pixel format
117 * returns : zero on successful initialization, non-zero on error.
119 uint32_t (*config)(uint32_t width, uint32_t height, uint32_t d_width,
120 uint32_t d_height, uint32_t fullscreen, char *title,
121 uint32_t format);
124 * Control interface
126 uint32_t (*control)(uint32_t request, void *data, ...);
129 * Display a new RGB/BGR frame of the video to the screen.
130 * params:
131 * src[0] - pointer to the image
133 uint32_t (*draw_frame)(uint8_t *src[]);
136 * Draw a planar YUV slice to the buffer:
137 * params:
138 * src[3] = source image planes (Y,U,V)
139 * stride[3] = source image planes line widths (in bytes)
140 * w,h = width*height of area to be copied (in Y pixels)
141 * x,y = position at the destination image (in Y pixels)
143 uint32_t (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
146 * Draws OSD to the screen buffer
148 void (*draw_osd)(void);
151 * Blit/Flip buffer to the screen. Must be called after each frame!
153 void (*flip_page)(void);
156 * This func is called after every frames to handle keyboard and
157 * other events. It's called in PAUSE mode too!
159 void (*check_events)(void);
162 * Closes driver. Should restore the original state of the system.
164 void (*uninit)(void);
166 } vo_functions_t;
168 char *vo_format_name(int format);
169 int vo_init(void);
171 vo_functions_t* init_best_video_out(char** vo_list);
172 void list_video_out();
174 // NULL terminated array of all drivers
175 extern vo_functions_t* video_out_drivers[];
177 extern int vo_flags;
179 extern int vo_config_count;
181 // correct resolution/bpp on screen: (should be autodetected by vo_init())
182 extern int vo_depthonscreen;
183 extern int vo_screenwidth;
184 extern int vo_screenheight;
186 // requested resolution/bpp: (-x -y -bpp options)
187 extern int vo_dx;
188 extern int vo_dy;
189 extern int vo_dwidth;
190 extern int vo_dheight;
191 extern int vo_dbpp;
193 extern int vo_grabpointer;
194 extern int vo_doublebuffering;
195 extern int vo_directrendering;
196 extern int vo_vsync;
197 extern int vo_fs;
198 extern int vo_fsmode;
199 extern float vo_panscan;
200 extern int vo_adapter_num;
201 extern int vo_refresh_rate;
202 extern int vo_keepaspect;
203 extern int vo_rootwin;
205 extern int vo_gamma_brightness;
206 extern int vo_gamma_saturation;
207 extern int vo_gamma_contrast;
208 extern int vo_gamma_hue;
209 extern int vo_gamma_red_intensity;
210 extern int vo_gamma_green_intensity;
211 extern int vo_gamma_blue_intensity;
213 extern int vo_mouse_timer_const;
214 extern int vo_nomouse_input;
216 extern int vo_pts;
217 extern float vo_fps;
219 extern char *vo_subdevice;
221 extern int vo_colorkey;
223 #if defined(HAVE_FBDEV)||defined(HAVE_VESA)
225 typedef struct {
226 float min;
227 float max;
228 } range_t;
230 extern float range_max(range_t *r);
231 extern int in_range(range_t *r, float f);
232 extern range_t *str2range(char *s);
233 extern char *monitor_hfreq_str;
234 extern char *monitor_vfreq_str;
235 extern char *monitor_dotclock_str;
237 #endif
239 #endif