diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-29 21:53:05 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-29 21:53:05 +0000 |
commit | 1a6f3e1d60c13d0d654d90b24bef63f19ab9b3b0 (patch) | |
tree | b0c356869c52c079671c56987c94820b08a414fa /libvo/video_out.c | |
parent | 4b0580893934337ea1aaf21e996e5db8f5641658 (diff) | |
download | mpv-1a6f3e1d60c13d0d654d90b24bef63f19ab9b3b0.tar.bz2 mpv-1a6f3e1d60c13d0d654d90b24bef63f19ab9b3b0.tar.xz |
video out driver list support (like -vc, example: -vo xmga,xv,x11,)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7563 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/video_out.c')
-rw-r--r-- | libvo/video_out.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c index 5aec99bb0d..5793aff8b9 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -12,6 +12,9 @@ #include "config.h" #include "video_out.h" +#include "mp_msg.h" +#include "help_mp.h" + #include "../linux/shmem.h" //int vo_flags=0; @@ -190,6 +193,52 @@ void libvo_register_options(void* cfg) { vo_dxr2_register_options(cfg); #endif } + +void list_video_out(){ + int i=0; + mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableVideoOutputDrivers); + while (video_out_drivers[i]) { + const vo_info_t *info = video_out_drivers[i++]->get_info (); + printf("\t%s\t%s\n", info->short_name, info->name); + } + printf("\n"); +} + +vo_functions_t* init_best_video_out(char** vo_list){ + int i; + // first try the preferred drivers, with their optional subdevice param: + if(vo_list && vo_list[0]) + while(vo_list[0][0]){ + char* vo=strdup(vo_list[0]); + vo_subdevice=strchr(vo,':'); + if(vo_subdevice){ + vo_subdevice[0]=0; + ++vo_subdevice; + } + for(i=0;video_out_drivers[i];i++){ + vo_functions_t* video_driver=video_out_drivers[i]; + const vo_info_t *info = video_driver->get_info(); + if(!strcmp(info->short_name,vo)){ + // name matches, try it + if(!video_driver->preinit(vo_subdevice)) + return video_driver; // success! + } + } + // continue... + ++vo_list; + if(!(vo_list[0])) return NULL; // do NOT fallback to others + } + // now try the rest... + vo_subdevice=NULL; + for(i=0;video_out_drivers[i];i++){ + vo_functions_t* video_driver=video_out_drivers[i]; + if(!video_driver->preinit(vo_subdevice)) + return video_driver; // success! + } + return NULL; +} + + #if defined(HAVE_FBDEV)||defined(HAVE_VESA) /* Borrowed from vo_fbdev.c Monitor ranges related functions*/ |