4 * Copyright (C) Aaron Holtzman - Aug 1999
5 * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
6 * (C) MPlayer Developers
16 //#include "font_load.h"
17 #include "libmpcodecs/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 /* signal a device pause */
35 #define VOCTRL_PAUSE 7
36 /* start/resume playback */
37 #define VOCTRL_RESUME 8
38 /* libmpcodecs direct rendering: */
39 #define VOCTRL_GET_IMAGE 9
40 #define VOCTRL_DRAW_IMAGE 13
41 #define VOCTRL_SET_SPU_PALETTE 14
43 #define VOCTRL_GET_NUM_FRAMES 10
44 #define VOCTRL_GET_FRAME_NUM 11
45 #define VOCTRL_SET_FRAME_NUM 12
46 #define VOCTRL_GET_PANSCAN 15
47 #define VOCTRL_SET_PANSCAN 16
48 /* equalizer controls */
49 #define VOCTRL_SET_EQUALIZER 17
50 #define VOCTRL_GET_EQUALIZER 18
51 //#define VOCTRL_GUI_NOWINDOW 19
52 /* Frame duplication */
53 #define VOCTRL_DUPLICATE_FRAME 20
55 #define VOCTRL_START_SLICE 21
57 #define VOCTRL_ONTOP 25
58 #define VOCTRL_ROOTWIN 26
59 #define VOCTRL_BORDER 27
60 #define VOCTRL_DRAW_EOSD 28
61 #define VOCTRL_GET_EOSD_RES 29
63 int w
, h
; // screen dimensions, including black borders
64 int mt
, mb
, ml
, mr
; // borders (top, bottom, left, right)
67 #define VOCTRL_SET_DEINTERLACE 30
68 #define VOCTRL_GET_DEINTERLACE 31
70 #define VOCTRL_UPDATE_SCREENINFO 32
72 // Vo can be used by xover
73 #define VOCTRL_XOVERLAY_SUPPORT 22
75 #define VOCTRL_XOVERLAY_SET_COLORKEY 24
77 uint32_t x11
; // The raw x11 color
81 #define VOCTRL_XOVERLAY_SET_WIN 23
90 #define VO_NOTAVAIL -2
93 #define VOFLAG_FULLSCREEN 0x01
94 #define VOFLAG_MODESWITCHING 0x02
95 #define VOFLAG_SWSCALE 0x04
96 #define VOFLAG_FLIPPING 0x08
97 #define VOFLAG_XOVERLAY_SUB_VO 0x10000
99 typedef struct vo_info_s
101 /* driver name ("Matrox Millennium G200/G400" */
103 /* short name (for config strings) ("mga") */
104 const char *short_name
;
105 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
107 /* any additional comments */
111 typedef struct vo_functions_s
113 const vo_info_t
*info
;
115 * Preinitializes driver (real INITIALIZATION)
116 * arg - currently it's vo_subdevice
117 * returns: zero on successful initialization, non-zero on error.
119 int (*preinit
)(const char *arg
);
121 * Initialize (means CONFIGURE) the display driver.
123 * width,height: image source size
124 * d_width,d_height: size of the requested window size, just a hint
125 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint
126 * title: window title, if available
127 * format: fourcc of pixel format
128 * returns : zero on successful initialization, non-zero on error.
130 int (*config
)(uint32_t width
, uint32_t height
, uint32_t d_width
,
131 uint32_t d_height
, uint32_t fullscreen
, char *title
,
137 int (*control
)(uint32_t request
, void *data
, ...);
140 * Display a new RGB/BGR frame of the video to the screen.
142 * src[0] - pointer to the image
144 int (*draw_frame
)(uint8_t *src
[]);
147 * Draw a planar YUV slice to the buffer:
149 * src[3] = source image planes (Y,U,V)
150 * stride[3] = source image planes line widths (in bytes)
151 * w,h = width*height of area to be copied (in Y pixels)
152 * x,y = position at the destination image (in Y pixels)
154 int (*draw_slice
)(uint8_t *src
[], int stride
[], int w
,int h
, int x
,int y
);
157 * Draws OSD to the screen buffer
159 void (*draw_osd
)(void);
162 * Blit/Flip buffer to the screen. Must be called after each frame!
164 void (*flip_page
)(void);
167 * This func is called after every frames to handle keyboard and
168 * other events. It's called in PAUSE mode too!
170 void (*check_events
)(void);
173 * Closes driver. Should restore the original state of the system.
175 void (*uninit
)(void);
179 const vo_functions_t
* init_best_video_out(char** vo_list
);
180 int config_video_out(const vo_functions_t
*vo
, uint32_t width
, uint32_t height
,
181 uint32_t d_width
, uint32_t d_height
, uint32_t flags
,
182 char *title
, uint32_t format
);
183 void list_video_out(void);
185 // NULL terminated array of all drivers
186 extern const vo_functions_t
* const video_out_drivers
[];
190 extern int vo_config_count
;
192 extern int xinerama_screen
;
193 extern int xinerama_x
;
194 extern int xinerama_y
;
196 // correct resolution/bpp on screen: (should be autodetected by vo_init())
197 extern int vo_depthonscreen
;
198 extern int vo_screenwidth
;
199 extern int vo_screenheight
;
201 // requested resolution/bpp: (-x -y -bpp options)
204 extern int vo_dwidth
;
205 extern int vo_dheight
;
208 extern int vo_grabpointer
;
209 extern int vo_doublebuffering
;
210 extern int vo_directrendering
;
213 extern int vo_fsmode
;
214 extern float vo_panscan
;
215 extern int vo_adapter_num
;
216 extern int vo_refresh_rate
;
217 extern int vo_keepaspect
;
218 extern int vo_rootwin
;
220 extern int vo_border
;
222 extern int vo_gamma_gamma
;
223 extern int vo_gamma_brightness
;
224 extern int vo_gamma_saturation
;
225 extern int vo_gamma_contrast
;
226 extern int vo_gamma_hue
;
227 extern int vo_gamma_red_intensity
;
228 extern int vo_gamma_green_intensity
;
229 extern int vo_gamma_blue_intensity
;
231 extern int vo_nomouse_input
;
236 extern char *vo_subdevice
;
238 extern int vo_colorkey
;
242 #if defined(HAVE_FBDEV)||defined(HAVE_VESA)
249 extern float range_max(range_t
*r
);
250 extern int in_range(range_t
*r
, float f
);
251 extern range_t
*str2range(char *s
);
252 extern char *monitor_hfreq_str
;
253 extern char *monitor_vfreq_str
;
254 extern char *monitor_dotclock_str
;
258 #endif /* VIDEO_OUT_H */