2
/* this file contains libvo's common functions, variables used by
10
//#include <sys/mman.h>
13
#include "video_out.h"
18
#include "osdep/shmem.h"
22
// currect resolution/bpp on screen: (should be autodetected by vo_init())
23
int vo_depthonscreen=0;
25
int vo_screenheight=0;
27
int vo_config_count=0;
29
// requested resolution/bpp: (-x -y -bpp options)
36
int vo_nomouse_input = 0;
37
int vo_grabpointer = 1;
38
int vo_doublebuffering = 1;
42
float vo_panscan = 0.0f;
45
int vo_refresh_rate=0;
51
int vo_pts=0; // for hw decoding
52
float vo_fps=0; // for mp1e rte
54
char *vo_subdevice = NULL;
55
int vo_directrendering=0;
57
int vo_colorkey = 0x0000ff00; // default colorkey is green
58
// (0xff000000 means that colorkey has been disabled)
61
// Externally visible list of all vo drivers
63
extern vo_functions_t video_out_mga;
64
extern vo_functions_t video_out_xmga;
65
extern vo_functions_t video_out_x11;
66
extern vo_functions_t video_out_xover;
67
extern vo_functions_t video_out_xvmc;
68
extern vo_functions_t video_out_xv;
69
extern vo_functions_t video_out_gl;
70
extern vo_functions_t video_out_gl2;
71
extern vo_functions_t video_out_dga;
72
extern vo_functions_t video_out_fsdga;
73
extern vo_functions_t video_out_sdl;
74
extern vo_functions_t video_out_3dfx;
75
extern vo_functions_t video_out_tdfxfb;
76
extern vo_functions_t video_out_null;
77
//extern vo_functions_t video_out_odivx;
78
extern vo_functions_t video_out_zr;
79
extern vo_functions_t video_out_zr2;
80
extern vo_functions_t video_out_bl;
81
extern vo_functions_t video_out_syncfb;
82
extern vo_functions_t video_out_fbdev;
83
extern vo_functions_t video_out_fbdev2;
84
extern vo_functions_t video_out_svga;
85
extern vo_functions_t video_out_png;
86
extern vo_functions_t video_out_ggi;
87
extern vo_functions_t video_out_aa;
88
extern vo_functions_t video_out_caca;
89
extern vo_functions_t video_out_mpegpes;
90
extern vo_functions_t video_out_yuv4mpeg;
92
extern vo_functions_t video_out_directx;
95
extern vo_functions_t video_out_dxr2;
97
extern vo_functions_t video_out_dxr3;
99
extern vo_functions_t video_out_jpeg;
102
extern vo_functions_t video_out_gif89a;
105
extern vo_functions_t video_out_vesa;
108
extern vo_functions_t video_out_directfb;
109
#if DIRECTFBVERSION >= 915
110
extern vo_functions_t video_out_dfbmga;
114
extern vo_functions_t video_out_xvidix;
115
extern vo_functions_t video_out_winvidix;
116
extern vo_functions_t video_out_cvidix;
119
extern vo_functions_t video_out_tdfx_vid;
122
extern vo_functions_t video_out_tga;
125
#ifdef MACOSX_COREVIDEO
126
extern vo_functions_t video_out_macosx;
128
extern vo_functions_t video_out_quartz;
131
extern vo_functions_t video_out_pnm;
134
extern vo_functions_t video_out_md5sum;
137
vo_functions_t* video_out_drivers[] =
146
#ifdef MACOSX_COREVIDEO
221
#if DIRECTFBVERSION >= 915
235
// should not be auto-selected
259
void list_video_out(){
261
mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableVideoOutputDrivers);
263
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_OUTPUTS\n");
264
while (video_out_drivers[i]) {
265
const vo_info_t *info = video_out_drivers[i++]->info;
266
printf("\t%s\t%s\n", info->short_name, info->name);
271
vo_functions_t* init_best_video_out(char** vo_list){
273
// first try the preferred drivers, with their optional subdevice param:
274
if(vo_list && vo_list[0])
275
while(vo_list[0][0]){
276
char* vo=strdup(vo_list[0]);
277
vo_subdevice=strchr(vo,':');
278
if (!strcmp(vo, "pgm"))
279
mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_VO_PGM_HasBeenReplaced);
280
if (!strcmp(vo, "md5"))
281
mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_VO_MD5_HasBeenReplaced);
286
for(i=0;video_out_drivers[i];i++){
287
vo_functions_t* video_driver=video_out_drivers[i];
288
const vo_info_t *info = video_driver->info;
289
if(!strcmp(info->short_name,vo)){
290
// name matches, try it
291
if(!video_driver->preinit(vo_subdevice))
294
return video_driver; // success!
301
if(!(vo_list[0])) return NULL; // do NOT fallback to others
303
// now try the rest...
305
for(i=0;video_out_drivers[i];i++){
306
vo_functions_t* video_driver=video_out_drivers[i];
307
if(!video_driver->preinit(vo_subdevice))
308
return video_driver; // success!
314
#if defined(HAVE_FBDEV)||defined(HAVE_VESA)
315
/* Borrowed from vo_fbdev.c
316
Monitor ranges related functions*/
318
char *monitor_hfreq_str = NULL;
319
char *monitor_vfreq_str = NULL;
320
char *monitor_dotclock_str = NULL;
322
float range_max(range_t *r)
326
for (/* NOTHING */; (r->min != -1 && r->max != -1); r++)
327
if (max < r->max) max = r->max;
332
int in_range(range_t *r, float f)
334
for (/* NOTHING */; (r->min != -1 && r->max != -1); r++)
335
if (f >= r->min && f <= r->max)
340
range_t *str2range(char *s)
342
float tmp_min, tmp_max;
343
char *endptr = s; // to start the loop
349
for (i = 0; *endptr; i++) {
352
if (!(r = (range_t *) realloc(r, sizeof(*r) * (i + 2)))) {
353
printf("can't realloc 'r'\n");
356
tmp_min = strtod(s, &endptr);
357
if (*endptr == 'k' || *endptr == 'K') {
360
} else if (*endptr == 'm' || *endptr == 'M') {
361
tmp_min *= 1000000.0;
364
if (*endptr == '-') {
365
tmp_max = strtod(endptr + 1, &endptr);
366
if (*endptr == 'k' || *endptr == 'K') {
369
} else if (*endptr == 'm' || *endptr == 'M') {
370
tmp_max *= 1000000.0;
373
if (*endptr != ',' && *endptr)
375
} else if (*endptr == ',' || !*endptr) {
381
if (r[i].min < 0 || r[i].max < 0)
385
r[i].min = r[i].max = -1;
393
/* Borrowed from vo_fbdev.c END */