4 * Copyright (C) Aaron Holtzman - Aug 1999
5 * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
6 * (C) MPlayer Developers
11 #define __VIDEO_OUT_H 1
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
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
56 #define VOCTRL_START_SLICE 21
58 // Vo can be used by xover
59 #define VOCTRL_XOVERLAY_SUPPORT 22
61 #define VOCTRL_XOVERLAY_SET_COLORKEY 24
63 uint32_t x11
; // The raw x11 color
67 #define VOCTRL_XOVERLAY_SET_WIN 23
76 #define VO_NOTAVAIL -2
79 #define VOFLAG_FULLSCREEN 0x01
80 #define VOFLAG_MODESWITCHING 0x02
81 #define VOFLAG_SWSCALE 0x04
82 #define VOFLAG_FLIPPING 0x08
83 #define VOFLAG_XOVERLAY_SUB_VO 0x10000
85 typedef struct vo_info_s
87 /* driver name ("Matrox Millennium G200/G400" */
89 /* short name (for config strings) ("mga") */
90 const char *short_name
;
91 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
93 /* any additional comments */
97 typedef struct vo_functions_s
101 * Preinitializes driver (real INITIALIZATION)
102 * arg - currently it's vo_subdevice
103 * returns: zero on successful initialization, non-zero on error.
105 uint32_t (*preinit
)(const char *arg
);
107 * Initialize (means CONFIGURE) the display driver.
109 * width,height: image source size
110 * d_width,d_height: size of the requested window size, just a hint
111 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint
112 * title: window title, if available
113 * format: fourcc of pixel format
114 * returns : zero on successful initialization, non-zero on error.
116 uint32_t (*config
)(uint32_t width
, uint32_t height
, uint32_t d_width
,
117 uint32_t d_height
, uint32_t fullscreen
, char *title
,
123 uint32_t (*control
)(uint32_t request
, void *data
, ...);
126 * Display a new RGB/BGR frame of the video to the screen.
128 * src[0] - pointer to the image
130 uint32_t (*draw_frame
)(uint8_t *src
[]);
133 * Draw a planar YUV slice to the buffer:
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)
140 uint32_t (*draw_slice
)(uint8_t *src
[], int stride
[], int w
,int h
, int x
,int y
);
143 * Draws OSD to the screen buffer
145 void (*draw_osd
)(void);
148 * Blit/Flip buffer to the screen. Must be called after each frame!
150 void (*flip_page
)(void);
153 * This func is called after every frames to handle keyboard and
154 * other events. It's called in PAUSE mode too!
156 void (*check_events
)(void);
159 * Closes driver. Should restore the original state of the system.
161 void (*uninit
)(void);
165 char *vo_format_name(int format
);
168 vo_functions_t
* init_best_video_out(char** vo_list
);
169 void list_video_out();
171 // NULL terminated array of all drivers
172 extern vo_functions_t
* video_out_drivers
[];
176 extern int vo_config_count
;
178 // correct resolution/bpp on screen: (should be autodetected by vo_init())
179 extern int vo_depthonscreen
;
180 extern int vo_screenwidth
;
181 extern int vo_screenheight
;
183 // requested resolution/bpp: (-x -y -bpp options)
186 extern int vo_dwidth
;
187 extern int vo_dheight
;
190 extern int vo_grabpointer
;
191 extern int vo_doublebuffering
;
192 extern int vo_directrendering
;
195 extern int vo_fsmode
;
196 extern float vo_panscan
;
198 extern int vo_gamma_brightness
;
199 extern int vo_gamma_saturation
;
200 extern int vo_gamma_contrast
;
201 extern int vo_gamma_hue
;
202 extern int vo_gamma_red_intensity
;
203 extern int vo_gamma_green_intensity
;
204 extern int vo_gamma_blue_intensity
;
206 extern int vo_mouse_timer_const
;
207 extern int vo_nomouse_input
;
212 extern char *vo_subdevice
;
214 extern int vo_colorkey
;
216 #if defined(HAVE_FBDEV)||defined(HAVE_VESA)
223 extern float range_max(range_t
*r
);
224 extern int in_range(range_t
*r
, float f
);
225 extern range_t
*str2range(char *s
);
226 extern char *monitor_hfreq_str
;
227 extern char *monitor_vfreq_str
;
228 extern char *monitor_dotclock_str
;