00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MPLAYER_VIDEO_OUT_H
00024 #define MPLAYER_VIDEO_OUT_H
00025
00026 #include <inttypes.h>
00027 #include <stdarg.h>
00028
00029
00030 #include "../img_format.h"
00031
00032
00033 #define VO_EVENT_EXPOSE 1
00034 #define VO_EVENT_RESIZE 2
00035 #define VO_EVENT_KEYPRESS 4
00036 #define VO_EVENT_REINIT 8
00037 #define VO_EVENT_MOVE 16
00038
00039
00040
00041 #define VOCTRL_QUERY_FORMAT 2
00042
00043 #define VOCTRL_RESET 3
00044
00045 #define VOCTRL_GUISUPPORT 4
00046 #define VOCTRL_GUI_NOWINDOW 19
00047
00048 #define VOCTRL_FULLSCREEN 5
00049
00050 #define VOCTRL_PAUSE 7
00051
00052 #define VOCTRL_RESUME 8
00053
00054 #define VOCTRL_GET_IMAGE 9
00055 #define VOCTRL_DRAW_IMAGE 13
00056 #define VOCTRL_SET_SPU_PALETTE 14
00057
00058 #define VOCTRL_GET_NUM_FRAMES 10
00059 #define VOCTRL_GET_FRAME_NUM 11
00060 #define VOCTRL_SET_FRAME_NUM 12
00061 #define VOCTRL_GET_PANSCAN 15
00062 #define VOCTRL_SET_PANSCAN 16
00063
00064 #define VOCTRL_SET_EQUALIZER 17
00065 #define VOCTRL_GET_EQUALIZER 18
00066
00067
00068 #define VOCTRL_DUPLICATE_FRAME 20
00069
00070 #define VOCTRL_START_SLICE 21
00071
00072 #define VOCTRL_ONTOP 25
00073 #define VOCTRL_ROOTWIN 26
00074 #define VOCTRL_BORDER 27
00075 #define VOCTRL_DRAW_EOSD 28
00076 #define VOCTRL_GET_EOSD_RES 29
00077
00078 #define VOCTRL_SET_DEINTERLACE 30
00079 #define VOCTRL_GET_DEINTERLACE 31
00080
00081 #define VOCTRL_UPDATE_SCREENINFO 32
00082
00083
00084 #define VOCTRL_XOVERLAY_SUPPORT 22
00085
00086 #define VOCTRL_XOVERLAY_SET_COLORKEY 24
00087 typedef struct {
00088 uint32_t x11;
00089 uint16_t r,g,b;
00090 } mp_colorkey_t;
00091
00092 #define VOCTRL_XOVERLAY_SET_WIN 23
00093 typedef struct {
00094 int x,y;
00095 int w,h;
00096 } mp_win_t;
00097
00098 #define VO_TRUE 1
00099 #define VO_FALSE 0
00100 #define VO_ERROR -1
00101 #define VO_NOTAVAIL -2
00102 #define VO_NOTIMPL -3
00103
00104 #define VOFLAG_FULLSCREEN 0x01
00105 #define VOFLAG_MODESWITCHING 0x02
00106 #define VOFLAG_SWSCALE 0x04
00107 #define VOFLAG_FLIPPING 0x08
00108 #define VOFLAG_HIDDEN 0x10 //< Use to create a hidden window
00109 #define VOFLAG_STEREO 0x20 //< Use to create a stereo-capable window
00110 #define VOFLAG_XOVERLAY_SUB_VO 0x10000
00111
00112 typedef struct vo_info_s
00113 {
00114
00115 const char *name;
00116
00117 const char *short_name;
00118
00119 const char *author;
00120
00121 const char *comment;
00122 } vo_info_t;
00123
00124 typedef struct vo_functions_s
00125 {
00126 const vo_info_t *info;
00127
00128
00129
00130
00131
00132 int (*preinit)(const char *arg);
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143 int (*config)(uint32_t width, uint32_t height, uint32_t d_width,
00144 uint32_t d_height, uint32_t fullscreen, char *title,
00145 uint32_t format);
00146
00147
00148
00149
00150 int (*control)(uint32_t request, void *data, ...);
00151
00152
00153
00154
00155
00156
00157 int (*draw_frame)(uint8_t *src[]);
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167 int (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
00168
00169
00170
00171
00172 void (*draw_osd)(void);
00173
00174
00175
00176
00177 void (*flip_page)(void);
00178
00179
00180
00181
00182
00183 void (*check_events)(void);
00184
00185
00186
00187
00188 void (*uninit)(void);
00189 } vo_functions_t;
00190
00191 const vo_functions_t* init_best_video_out(char** vo_list);
00192 int config_video_out(const vo_functions_t *vo, uint32_t width, uint32_t height,
00193 uint32_t d_width, uint32_t d_height, uint32_t flags,
00194 char *title, uint32_t format);
00195 void list_video_out(void);
00196
00197
00198 extern const vo_functions_t* const video_out_drivers[];
00199
00200 extern int vo_flags;
00201
00202 extern int vo_config_count;
00203
00204 extern int xinerama_screen;
00205 extern int xinerama_x;
00206 extern int xinerama_y;
00207
00208
00209 extern int vo_depthonscreen;
00210 extern int vo_screenwidth;
00211 extern int vo_screenheight;
00212
00213
00214 extern int vo_dx;
00215 extern int vo_dy;
00216 extern int vo_dwidth;
00217 extern int vo_dheight;
00218 extern int vo_dbpp;
00219
00220 extern int vo_grabpointer;
00221 extern int vo_doublebuffering;
00222 extern int vo_directrendering;
00223 extern int vo_vsync;
00224 extern int vo_fsmode;
00225 extern float vo_panscan;
00226 extern int vo_adapter_num;
00227 extern int vo_refresh_rate;
00228 extern int vo_keepaspect;
00229 extern int vo_rootwin;
00230 extern int vo_ontop;
00231 extern int vo_border;
00232
00233 extern int vo_gamma_gamma;
00234 extern int vo_gamma_brightness;
00235 extern int vo_gamma_saturation;
00236 extern int vo_gamma_contrast;
00237 extern int vo_gamma_hue;
00238 extern int vo_gamma_red_intensity;
00239 extern int vo_gamma_green_intensity;
00240 extern int vo_gamma_blue_intensity;
00241
00242 extern int vo_nomouse_input;
00243 extern int enable_mouse_movements;
00244
00245 extern int vo_pts;
00246 extern float vo_fps;
00247
00248 extern char *vo_subdevice;
00249
00250 extern int vo_colorkey;
00251
00252 extern char *vo_winname;
00253 extern char *vo_wintitle;
00254
00255 extern int64_t WinID;
00256
00257 typedef struct {
00258 float min;
00259 float max;
00260 } range_t;
00261
00262 float range_max(range_t *r);
00263 int in_range(range_t *r, float f);
00264 range_t *str2range(char *s);
00265 extern char *monitor_hfreq_str;
00266 extern char *monitor_vfreq_str;
00267 extern char *monitor_dotclock_str;
00268
00269 struct mp_keymap {
00270 int from;
00271 int to;
00272 };
00273 int lookup_keymap_table(const struct mp_keymap *map, int key);
00274 struct vo_rect {
00275 int left, right, top, bottom, width, height;
00276 };
00277 void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, struct vo_rect *dst,
00278 struct vo_rect *borders, const struct vo_rect *crop);
00279 void vo_mouse_movement(int posx, int posy);
00280
00281 #endif