2 * Copyright (C) Aaron Holtzman - Aug 1999
3 * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
4 * (C) MPlayer developers
6 * This file is part of MPlayer.
8 * MPlayer is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * MPlayer is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef MPLAYER_VIDEO_OUT_H
24 #define MPLAYER_VIDEO_OUT_H
29 //#include "font_load.h"
30 #include "libmpcodecs/img_format.h"
31 //#include "vidix/vidix.h"
33 #define VO_EVENT_EXPOSE 1
34 #define VO_EVENT_RESIZE 2
35 #define VO_EVENT_KEYPRESS 4
37 /* Obsolete: VOCTRL_QUERY_VAA 1 */
38 /* does the device support the required format */
39 #define VOCTRL_QUERY_FORMAT 2
40 /* signal a device reset seek */
41 #define VOCTRL_RESET 3
42 /* true if vo driver can use GUI created windows */
43 #define VOCTRL_GUISUPPORT 4
44 #define VOCTRL_GUI_NOWINDOW 19
45 /* used to switch to fullscreen */
46 #define VOCTRL_FULLSCREEN 5
47 /* signal a device pause */
48 #define VOCTRL_PAUSE 7
49 /* start/resume playback */
50 #define VOCTRL_RESUME 8
51 /* libmpcodecs direct rendering: */
52 #define VOCTRL_GET_IMAGE 9
53 #define VOCTRL_DRAW_IMAGE 13
54 #define VOCTRL_SET_SPU_PALETTE 14
56 #define VOCTRL_GET_NUM_FRAMES 10
57 #define VOCTRL_GET_FRAME_NUM 11
58 #define VOCTRL_SET_FRAME_NUM 12
59 #define VOCTRL_GET_PANSCAN 15
60 #define VOCTRL_SET_PANSCAN 16
61 /* equalizer controls */
62 #define VOCTRL_SET_EQUALIZER 17
63 #define VOCTRL_GET_EQUALIZER 18
64 //#define VOCTRL_GUI_NOWINDOW 19
65 /* Frame duplication */
66 #define VOCTRL_DUPLICATE_FRAME 20
68 #define VOCTRL_START_SLICE 21
70 #define VOCTRL_ONTOP 25
71 #define VOCTRL_ROOTWIN 26
72 #define VOCTRL_BORDER 27
73 #define VOCTRL_DRAW_EOSD 28
74 #define VOCTRL_GET_EOSD_RES 29
76 int w
, h
; // screen dimensions, including black borders
77 int mt
, mb
, ml
, mr
; // borders (top, bottom, left, right)
80 #define VOCTRL_SET_DEINTERLACE 30
81 #define VOCTRL_GET_DEINTERLACE 31
83 #define VOCTRL_UPDATE_SCREENINFO 32
85 // Vo can be used by xover
86 #define VOCTRL_XOVERLAY_SUPPORT 22
88 #define VOCTRL_XOVERLAY_SET_COLORKEY 24
90 uint32_t x11
; // The raw x11 color
94 #define VOCTRL_XOVERLAY_SET_WIN 23
103 #define VO_NOTAVAIL -2
104 #define VO_NOTIMPL -3
106 #define VOFLAG_FULLSCREEN 0x01
107 #define VOFLAG_MODESWITCHING 0x02
108 #define VOFLAG_SWSCALE 0x04
109 #define VOFLAG_FLIPPING 0x08
110 #define VOFLAG_XOVERLAY_SUB_VO 0x10000
112 typedef struct vo_info_s
114 /* driver name ("Matrox Millennium G200/G400" */
116 /* short name (for config strings) ("mga") */
117 const char *short_name
;
118 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
120 /* any additional comments */
124 typedef struct vo_functions_s
126 const vo_info_t
*info
;
128 * Preinitializes driver (real INITIALIZATION)
129 * arg - currently it's vo_subdevice
130 * returns: zero on successful initialization, non-zero on error.
132 int (*preinit
)(const char *arg
);
134 * Initialize (means CONFIGURE) the display driver.
136 * width,height: image source size
137 * d_width,d_height: size of the requested window size, just a hint
138 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint
139 * title: window title, if available
140 * format: fourcc of pixel format
141 * returns : zero on successful initialization, non-zero on error.
143 int (*config
)(uint32_t width
, uint32_t height
, uint32_t d_width
,
144 uint32_t d_height
, uint32_t fullscreen
, char *title
,
150 int (*control
)(uint32_t request
, void *data
, ...);
153 * Display a new RGB/BGR frame of the video to the screen.
155 * src[0] - pointer to the image
157 int (*draw_frame
)(uint8_t *src
[]);
160 * Draw a planar YUV slice to the buffer:
162 * src[3] = source image planes (Y,U,V)
163 * stride[3] = source image planes line widths (in bytes)
164 * w,h = width*height of area to be copied (in Y pixels)
165 * x,y = position at the destination image (in Y pixels)
167 int (*draw_slice
)(uint8_t *src
[], int stride
[], int w
,int h
, int x
,int y
);
170 * Draws OSD to the screen buffer
172 void (*draw_osd
)(void);
175 * Blit/Flip buffer to the screen. Must be called after each frame!
177 void (*flip_page
)(void);
180 * This func is called after every frames to handle keyboard and
181 * other events. It's called in PAUSE mode too!
183 void (*check_events
)(void);
186 * Closes driver. Should restore the original state of the system.
188 void (*uninit
)(void);
192 const vo_functions_t
* init_best_video_out(char** vo_list
);
193 int config_video_out(const vo_functions_t
*vo
, uint32_t width
, uint32_t height
,
194 uint32_t d_width
, uint32_t d_height
, uint32_t flags
,
195 char *title
, uint32_t format
);
196 void list_video_out(void);
198 // NULL terminated array of all drivers
199 extern const vo_functions_t
* const video_out_drivers
[];
203 extern int vo_config_count
;
205 extern int xinerama_screen
;
206 extern int xinerama_x
;
207 extern int xinerama_y
;
209 // correct resolution/bpp on screen: (should be autodetected by vo_init())
210 extern int vo_depthonscreen
;
211 extern int vo_screenwidth
;
212 extern int vo_screenheight
;
214 // requested resolution/bpp: (-x -y -bpp options)
217 extern int vo_dwidth
;
218 extern int vo_dheight
;
221 extern int vo_grabpointer
;
222 extern int vo_doublebuffering
;
223 extern int vo_directrendering
;
226 extern int vo_fsmode
;
227 extern float vo_panscan
;
228 extern int vo_adapter_num
;
229 extern int vo_refresh_rate
;
230 extern int vo_keepaspect
;
231 extern int vo_rootwin
;
233 extern int vo_border
;
235 extern int vo_gamma_gamma
;
236 extern int vo_gamma_brightness
;
237 extern int vo_gamma_saturation
;
238 extern int vo_gamma_contrast
;
239 extern int vo_gamma_hue
;
240 extern int vo_gamma_red_intensity
;
241 extern int vo_gamma_green_intensity
;
242 extern int vo_gamma_blue_intensity
;
244 extern int vo_nomouse_input
;
249 extern char *vo_subdevice
;
251 extern int vo_colorkey
;
253 extern int64_t WinID
;
260 float range_max(range_t
*r
);
261 int in_range(range_t
*r
, float f
);
262 range_t
*str2range(char *s
);
263 extern char *monitor_hfreq_str
;
264 extern char *monitor_vfreq_str
;
265 extern char *monitor_dotclock_str
;
271 int lookup_keymap_table(const struct keymap
*map
, int key
);
273 int left
, right
, top
, bottom
, width
, height
;
275 void calc_src_dst_rects(int src_width
, int src_height
, struct vo_rect
*src
, struct vo_rect
*dst
,
276 struct vo_rect
*borders
, const struct vo_rect
*crop
);
278 #endif /* MPLAYER_VIDEO_OUT_H */