[Mplayer-cvslog] CVS: main/libvo video_out.c,1.60,1.61 video_out.h,1.43,1.44
Arpi of Ize
arpi at mplayerhq.hu
Sun Sep 29 23:53:08 CEST 2002
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv12343/libvo
Modified Files:
video_out.c video_out.h
Log Message:
video out driver list support (like -vc, example: -vo xmga,xv,x11,)
Index: video_out.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- video_out.c 28 Sep 2002 20:09:14 -0000 1.60
+++ video_out.c 29 Sep 2002 21:53:05 -0000 1.61
@@ -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 @@
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*/
Index: video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- video_out.h 28 Sep 2002 20:09:14 -0000 1.43
+++ video_out.h 29 Sep 2002 21:53:05 -0000 1.44
@@ -151,6 +151,9 @@
char *vo_format_name(int format);
int vo_init(void);
+vo_functions_t* init_best_video_out(char** vo_list);
+void list_video_out();
+
// NULL terminated array of all drivers
extern vo_functions_t* video_out_drivers[];
More information about the MPlayer-cvslog
mailing list