changeset 22873:030428ba5bb3

allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
author ben
date Sun, 01 Apr 2007 13:27:28 +0000
parents f206b9a19192
children 9a8f6901e888
files vidix/drivers.c
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/vidix/drivers.c	Sun Apr 01 13:16:54 2007 +0000
+++ b/vidix/drivers.c	Sun Apr 01 13:27:28 2007 +0000
@@ -77,11 +77,34 @@
   return 1;
 }
 
+static void vidix_list_drivers (void)
+{
+  VDXDriver *drv;
+
+  printf ("Available VIDIX drivers:\n");
+
+  drv = first_driver;
+  while (drv)
+  {
+    vidix_capability_t cap;
+    drv->get_caps (&cap);
+    printf (" * %s - %s\n", drv->name, cap.name);
+    drv = drv->next; 
+  }
+}
+
 int vidix_find_driver (VDXContext *ctx, const char *name,
                        unsigned int cap, int verbose)
 {
   VDXDriver *drv;
 
+  if (!strcmp (name, "help"))
+  {
+    vidix_list_drivers ();
+    ctx->drv = NULL;
+    return 0;
+  }
+  
   drv = first_driver;
   while (drv)
   {