Mercurial > mplayer.hg
comparison libvo/video_out.c @ 7562:92188b57a062
video out driver list support (like -vc, example: -vo xmga,xv,x11,)
author | arpi |
---|---|
date | Sun, 29 Sep 2002 21:53:05 +0000 |
parents | 56ea9db91251 |
children | 3dc0b71630ff |
comparison
equal
deleted
inserted
replaced
7561:047212009a7f | 7562:92188b57a062 |
---|---|
9 #include <unistd.h> | 9 #include <unistd.h> |
10 //#include <sys/mman.h> | 10 //#include <sys/mman.h> |
11 | 11 |
12 #include "config.h" | 12 #include "config.h" |
13 #include "video_out.h" | 13 #include "video_out.h" |
14 | |
15 #include "mp_msg.h" | |
16 #include "help_mp.h" | |
14 | 17 |
15 #include "../linux/shmem.h" | 18 #include "../linux/shmem.h" |
16 | 19 |
17 //int vo_flags=0; | 20 //int vo_flags=0; |
18 | 21 |
188 void libvo_register_options(void* cfg) { | 191 void libvo_register_options(void* cfg) { |
189 #ifdef HAVE_DXR2 | 192 #ifdef HAVE_DXR2 |
190 vo_dxr2_register_options(cfg); | 193 vo_dxr2_register_options(cfg); |
191 #endif | 194 #endif |
192 } | 195 } |
196 | |
197 void list_video_out(){ | |
198 int i=0; | |
199 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableVideoOutputDrivers); | |
200 while (video_out_drivers[i]) { | |
201 const vo_info_t *info = video_out_drivers[i++]->get_info (); | |
202 printf("\t%s\t%s\n", info->short_name, info->name); | |
203 } | |
204 printf("\n"); | |
205 } | |
206 | |
207 vo_functions_t* init_best_video_out(char** vo_list){ | |
208 int i; | |
209 // first try the preferred drivers, with their optional subdevice param: | |
210 if(vo_list && vo_list[0]) | |
211 while(vo_list[0][0]){ | |
212 char* vo=strdup(vo_list[0]); | |
213 vo_subdevice=strchr(vo,':'); | |
214 if(vo_subdevice){ | |
215 vo_subdevice[0]=0; | |
216 ++vo_subdevice; | |
217 } | |
218 for(i=0;video_out_drivers[i];i++){ | |
219 vo_functions_t* video_driver=video_out_drivers[i]; | |
220 const vo_info_t *info = video_driver->get_info(); | |
221 if(!strcmp(info->short_name,vo)){ | |
222 // name matches, try it | |
223 if(!video_driver->preinit(vo_subdevice)) | |
224 return video_driver; // success! | |
225 } | |
226 } | |
227 // continue... | |
228 ++vo_list; | |
229 if(!(vo_list[0])) return NULL; // do NOT fallback to others | |
230 } | |
231 // now try the rest... | |
232 vo_subdevice=NULL; | |
233 for(i=0;video_out_drivers[i];i++){ | |
234 vo_functions_t* video_driver=video_out_drivers[i]; | |
235 if(!video_driver->preinit(vo_subdevice)) | |
236 return video_driver; // success! | |
237 } | |
238 return NULL; | |
239 } | |
240 | |
241 | |
193 #if defined(HAVE_FBDEV)||defined(HAVE_VESA) | 242 #if defined(HAVE_FBDEV)||defined(HAVE_VESA) |
194 /* Borrowed from vo_fbdev.c | 243 /* Borrowed from vo_fbdev.c |
195 Monitor ranges related functions*/ | 244 Monitor ranges related functions*/ |
196 | 245 |
197 char *monitor_hfreq_str = NULL; | 246 char *monitor_hfreq_str = NULL; |