changeset 4592:5fbfd8545c3b

query_ stuff replaced by new control() - patch by David Holm
author arpi
date Sat, 09 Feb 2002 00:47:26 +0000
parents 8324cc7c352a
children 3769ccb8da8b
files libvo/vesa_lvo.c libvo/video_out.h libvo/video_out_internal.h libvo/vo_3dfx.c libvo/vo_aa.c libvo/vo_dga.c libvo/vo_directfb.c libvo/vo_dxr3.c libvo/vo_fbdev.c libvo/vo_fsdga.c libvo/vo_ggi.c libvo/vo_gl.c libvo/vo_gl2.c libvo/vo_md5.c libvo/vo_mga.c libvo/vo_mpegpes.c libvo/vo_null.c libvo/vo_odivx.c libvo/vo_pgm.c libvo/vo_png.c libvo/vo_sdl.c libvo/vo_svga.c libvo/vo_syncfb.c libvo/vo_tdfxfb.c libvo/vo_vesa.c libvo/vo_x11.c libvo/vo_xmga.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_zr.c libvo/vosub_vidix.c
diffstat 31 files changed, 247 insertions(+), 117 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vesa_lvo.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vesa_lvo.c	Sat Feb 09 00:47:26 2002 +0000
@@ -40,6 +40,7 @@
 static mga_vid_config_t mga_vid_config;
 static unsigned image_bpp,image_height,image_width,src_format;
 extern int verbose;
+uint32_t vlvo_control(uint32_t request, void *data, ...);
 
 #define PIXEL_SIZE() ((video_mode_info.BitsPerPixel+7)/8)
 #define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) )
@@ -69,8 +70,7 @@
 	video_out_vesa.draw_frame=vlvo_draw_frame;
 	video_out_vesa.flip_page=vlvo_flip_page;
 	video_out_vesa.draw_osd=vlvo_draw_osd;
-	video_out_vesa.query_format=vlvo_query_info;
-	video_out_vesa.query_vaa=vlvo_query_vaa;
+  video_out_vesa.control=vlvo_control;
 	return 0;
 }
 
@@ -296,3 +296,15 @@
   if(verbose > 1) printf("vesa_lvo: query_format was called: %x (%s)\n",format,vo_format_name(format));
   return 1;
 }
+
+uint32_t vlvo_control(uint32_t request, void *data, ...)
+{
+  switch (request) {
+  case VOCTRL_QUERY_VAA:
+    vlvo_query_vaa((vo_vaa_t*)data);
+    return VO_TRUE;
+  case VOCTRL_QUERY_FORMAT:
+    return vlvo_query_info(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
+}
--- a/libvo/video_out.h	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/video_out.h	Sat Feb 09 00:47:26 2002 +0000
@@ -7,6 +7,7 @@
  */
 
 #include <inttypes.h>
+#include <stdarg.h>
 
 #include "font_load.h"
 #include "img_format.h"
@@ -16,6 +17,19 @@
 #define VO_EVENT_RESIZE 2
 #define VO_EVENT_KEYPRESS 4
 
+/* takes a pointer to a vo_vaa_s struct */
+#define VOCTRL_QUERY_VAA 1
+/* takes a pointer to uint32_t fourcc */
+#define VOCTRL_QUERY_FORMAT 2
+/* signal a device reset (seek/paus) */
+#define VOCTRL_RESET 3
+
+#define VO_TRUE		1
+#define VO_FALSE	0
+#define VO_ERROR	-1
+#define VO_NOTAVAIL	-2
+#define VO_NOTIMPL	-3
+
 typedef struct vo_info_s
 {
         /* driver name ("Matrox Millennium G200/G400" */
@@ -93,13 +107,10 @@
 			 uint32_t d_height, uint32_t fullscreen, char *title,
 			 uint32_t format,const vo_tune_info_t *);
 
-        /*
-         * Query that given pixel format is supported or not.
-	 * params:
-	 *   format: fourcc of pixel format
-         * returns : 1 if supported, 0 if unsupported
-         */
-        uint32_t (*query_format)(uint32_t format);
+	/*
+	 * Control interface
+	 */
+	uint32_t (*control)(uint32_t request, void *data, ...);
 
         /*
          * Return driver information.
@@ -145,14 +156,6 @@
          */
         void (*uninit)(void);
 
-	/*
-	 * Query Video Accelerated Architecture information.
-	 * params:
-	 *   vaa: address of struct to be filled.
-	 *  (Note: driver should memset it to ZERO if it doesn't support vaa.)
-	 */
-	void (*query_vaa)(vo_vaa_t *vaa);
-
 } vo_functions_t;
 
 char *vo_format_name(int format);
--- a/libvo/video_out_internal.h	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/video_out_internal.h	Sat Feb 09 00:47:26 2002 +0000
@@ -21,6 +21,7 @@
  *
  */
 
+static uint32_t control(uint32_t request, void *data, ...);
 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
 		     uint32_t d_height, uint32_t fullscreen, char *title,
 		     uint32_t format,const vo_tune_info_t *);
@@ -39,15 +40,14 @@
 {\
 	preinit,\
 	config,\
-        query_format,\
+	control,\
 	get_info,\
 	draw_frame,\
 	draw_slice,\
      	draw_osd,\
 	flip_page,\
 	check_events,\
-	uninit,\
-	query_vaa\
+	uninit\
 };
 
 #include "osd.h"
--- a/libvo/vo_3dfx.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_3dfx.c	Sat Feb 09 00:47:26 2002 +0000
@@ -493,8 +493,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
-
--- a/libvo/vo_aa.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_aa.c	Sat Feb 09 00:47:26 2002 +0000
@@ -757,7 +757,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_dga.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_dga.c	Sat Feb 09 00:47:26 2002 +0000
@@ -23,6 +23,9 @@
  * - works only on x86 architectures
  *
  * $Log$
+ * Revision 1.40  2002/02/09 00:47:26  arpi
+ * query_ stuff replaced by new control() - patch by David Holm
+ *
  * Revision 1.39  2002/01/31 11:45:25  alex
  * removed obsoleted Terminate_Display_Process
  *
@@ -1176,9 +1179,13 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
 
 //---------------------------------------------------------
--- a/libvo/vo_directfb.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_directfb.c	Sat Feb 09 00:47:26 2002 +0000
@@ -888,7 +888,11 @@
 
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_dxr3.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_dxr3.c	Sat Feb 09 00:47:26 2002 +0000
@@ -92,6 +92,39 @@
 	""
 };
 
+uint32_t control(uint32_t request, void *data, ...)
+{
+	uint32_t flag = 0;
+	switch (request) {
+	case VOCTRL_RESET:
+		fsync(fd_video);
+		return VO_TRUE;
+	case VOCTRL_QUERY_FORMAT:
+		switch (*((uint32_t*)data)) {	
+		case IMGFMT_MPEGPES:
+			/* Hardware accelerated | Hardware supports subpics */
+			flag = 0x2 | 0x8;
+			break;
+#ifdef USE_LIBAVCODEC
+		case IMGFMT_YV12:
+		case IMGFMT_YUY2:
+		case IMGFMT_RGB24:
+		case IMGFMT_BGR24:
+			/* Conversion needed | OSD Supported */
+			flag = 0x1 | 0x4;
+			break;
+		default:
+			printf("VO: [dxr3] Format unsupported, mail dholm@iname.com\n");
+#else
+		default:
+			printf("VO: [dxr3] You have enable libavcodec support (Read DOCS/codecs.html)!\n");
+#endif
+		}
+		return flag;
+	}
+	return VO_NOTIMPL;
+}
+
 static uint32_t config(uint32_t scr_width, uint32_t scr_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info)
 {
 	int tmp1, tmp2;
@@ -288,13 +321,6 @@
 static void flip_page(void)
 {
 	/* Flush the device if a seek occured */
-	if (!vo_pts) {
-		/* Flush video */
-		/*ioval = EM8300_SUBDEVICE_VIDEO;
-		ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
-		*/
-		fsync(fd_video);
-	}
 #ifdef USE_LIBAVCODEC
 	if (img_format == IMGFMT_YV12) {
 		int out_size = avcodec_encode_video(avc_context, avc_outbuf, avc_outbuf_size, &avc_picture);
@@ -352,36 +378,6 @@
 	return -1;
 }
 
-static uint32_t query_format(uint32_t format)
-{
-	uint32_t flag = 0;
-	
-	if (format == IMGFMT_MPEGPES) {
-		/* Hardware accelerated | Hardware supports subpics */
-		flag = 0x2 | 0x8;
-#ifdef USE_LIBAVCODEC
-	} else if (format == IMGFMT_YV12) {
-		/* Conversion needed | OSD Supported */
-		flag = 0x1 | 0x4;
-	} else if (format == IMGFMT_YUY2) {
-		/* Conversion needed | OSD Supported */
-		flag = 0x1 | 0x4;
-	} else if (format == IMGFMT_RGB24) {
-		/* Conversion needed | OSD Supported */
-		flag = 0x1 | 0x4;
-	} else if (format == IMGFMT_BGR24) {
-		/* Conversion needed | OSD Supported */
-		flag = 0x1 | 0x4;
-	} else {
-		printf("VO: [dxr3] Format unsupported, mail dholm@iname.com\n");
-#else
-	} else {
-		printf("VO: [dxr3] You have enable libavcodec support (Read DOCS/codecs.html)!\n");
-#endif
-	}
-	return flag;
-}
-
 static void uninit(void)
 {
 	printf("VO: [dxr3] Uninitializing\n");
@@ -484,8 +480,3 @@
 	
 	return 0;
 }
-
-static void query_vaa(vo_vaa_t *vaa)
-{
-	memset(vaa, 0, sizeof(vo_vaa_t));
-}
--- a/libvo/vo_fbdev.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_fbdev.c	Sat Feb 09 00:47:26 2002 +0000
@@ -1339,7 +1339,11 @@
     if(!pre_init_err) return (pre_init_err=(fb_preinit()?0:-1));
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_fsdga.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_fsdga.c	Sat Feb 09 00:47:26 2002 +0000
@@ -461,7 +461,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_ggi.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_ggi.c	Sat Feb 09 00:47:26 2002 +0000
@@ -771,7 +771,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_gl.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_gl.c	Sat Feb 09 00:47:26 2002 +0000
@@ -474,7 +474,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_gl2.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_gl2.c	Sat Feb 09 00:47:26 2002 +0000
@@ -1101,7 +1101,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_md5.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_md5.c	Sat Feb 09 00:47:26 2002 +0000
@@ -87,7 +87,7 @@
 static uint32_t
 query_format(uint32_t format)
 {
-    return video_out_pgm.query_format(format);
+    return video_out_pgm.control(VOCTRL_QUERY_FORMAT, &format);
 }
 
 
@@ -108,7 +108,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_mga.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_mga.c	Sat Feb 09 00:47:26 2002 +0000
@@ -151,7 +151,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_mpegpes.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_mpegpes.c	Sat Feb 09 00:47:26 2002 +0000
@@ -516,7 +516,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_null.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_null.c	Sat Feb 09 00:47:26 2002 +0000
@@ -95,7 +95,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_odivx.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_odivx.c	Sat Feb 09 00:47:26 2002 +0000
@@ -270,7 +270,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_pgm.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_pgm.c	Sat Feb 09 00:47:26 2002 +0000
@@ -140,7 +140,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_png.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_png.c	Sat Feb 09 00:47:26 2002 +0000
@@ -330,7 +330,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_sdl.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_sdl.c	Sat Feb 09 00:47:26 2002 +0000
@@ -1326,7 +1326,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_svga.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_svga.c	Sat Feb 09 00:47:26 2002 +0000
@@ -575,7 +575,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_syncfb.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_syncfb.c	Sat Feb 09 00:47:26 2002 +0000
@@ -453,7 +453,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_tdfxfb.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_tdfxfb.c	Sat Feb 09 00:47:26 2002 +0000
@@ -828,7 +828,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_vesa.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_vesa.c	Sat Feb 09 00:47:26 2002 +0000
@@ -944,7 +944,11 @@
   return pre_init_err;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_x11.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_x11.c	Sat Feb 09 00:47:26 2002 +0000
@@ -624,8 +624,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
-
--- a/libvo/vo_xmga.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_xmga.c	Sat Feb 09 00:47:26 2002 +0000
@@ -400,7 +400,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_xv.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_xv.c	Sat Feb 09 00:47:26 2002 +0000
@@ -770,3 +770,15 @@
   vaa->get_video_eq = xv_get_video_eq;
   vaa->set_video_eq = xv_set_video_eq;
 }
+
+uint32_t control(uint32_t request, void *data, ...)
+{
+  switch (request) {
+  case VOCTRL_QUERY_VAA:
+    query_vaa((vo_vaa_t*)data);
+    return VO_TRUE;
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
+}
--- a/libvo/vo_xvidix.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_xvidix.c	Sat Feb 09 00:47:26 2002 +0000
@@ -463,7 +463,11 @@
     return(0);
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vo_zr.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vo_zr.c	Sat Feb 09 00:47:26 2002 +0000
@@ -634,7 +634,11 @@
   return 0;
 }
 
-static void query_vaa(vo_vaa_t *vaa)
+uint32_t control(uint32_t request, void *data, ...)
 {
-  memset(vaa,0,sizeof(vo_vaa_t));
+  switch (request) {
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
 }
--- a/libvo/vosub_vidix.c	Fri Feb 08 23:03:38 2002 +0000
+++ b/libvo/vosub_vidix.c	Sat Feb 09 00:47:26 2002 +0000
@@ -627,6 +627,18 @@
 	return 0;
 }
 
+uint32_t vidix_control(uint32_t request, void *data, ...)
+{
+  switch (request) {
+  case VOCTRL_QUERY_VAA:
+    vidix_query_vaa((vo_vaa_t*)data);
+    return VO_TRUE;
+  case VOCTRL_QUERY_FORMAT:
+    return vidix_query_fourcc(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
+}
+
 int vidix_preinit(const char *drvname,void *server)
 {
   int err;
@@ -656,8 +668,7 @@
 	((vo_functions_t *)server)->draw_frame=vidix_draw_frame;
 	((vo_functions_t *)server)->flip_page=vidix_flip_page;
 	((vo_functions_t *)server)->draw_osd=vidix_draw_osd;
-	((vo_functions_t *)server)->query_format=vidix_query_fourcc;
-	((vo_functions_t *)server)->query_vaa=vidix_query_vaa;
+	((vo_functions_t *)server)->control=vidix_control;
 	vo_server = server;
 	return 0;
 }