[MPlayer-dev-eng] [PATCH] vo_*->control

David Holm david at realityrift.com
Fri Feb 8 11:03:25 CET 2002


indentation level = 2
use spaces instead of tabs



-------------- next part --------------
? control.patch
? control2.patch
? dxr3.patch
? fibmap_mplayer
? gmon.out
? vo.patch
? libdha/kernelhelper/test
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.386
diff -u -r1.386 mplayer.c
--- mplayer.c	6 Feb 2002 20:26:19 -0000	1.386
+++ mplayer.c	8 Feb 2002 10:12:54 -0000
@@ -1221,7 +1221,7 @@
 #ifdef USE_LIBVO2
     vo_flags=vo2_query_format(video_out);
 #else
-    vo_flags=video_out->query_format(out_fmt);
+    vo_flags=video_out->control(VOCTRL_QUERY_FORMAT, &out_fmt);
 #endif
     mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: query(%s) returned 0x%X\n",vo_format_name(out_fmt),vo_flags);
     if(vo_flags) break;
@@ -1359,7 +1359,8 @@
    }
    inited_flags|=INITED_VO;
    mp_msg(MSGT_CPLAYER,MSGL_V,"INFO: Video OUT driver init OK!\n");
-   video_out->query_vaa(&vo_vaa);
+   if(video_out->control(VOCTRL_QUERY_VAA, &vo_vaa)==VO_NOTIMPL)
+     memset(&vo_vaa,0,sizeof(vo_vaa_t));
    /*
 	get_hw_eq
    */
@@ -2540,11 +2541,15 @@
       }
       fflush(stdout);
 
+      if(sh_video){
+	 current_module="seek_video_reset";
+         video_out->control(VOCTRL_RESET,NULL);
+      }
+      
       if(sh_audio){
         current_module="seek_audio_reset";
         audio_out->reset(); // stop audio, throwing away buffered data
       }
-
 #ifdef USE_OSD
         // Set OSD:
       if(osd_level){
Index: libvo/vesa_lvo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vesa_lvo.c,v
retrieving revision 1.15
diff -u -r1.15 vesa_lvo.c
--- libvo/vesa_lvo.c	3 Feb 2002 09:12:32 -0000	1.15
+++ libvo/vesa_lvo.c	8 Feb 2002 10:12:54 -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;
 }
 
@@ -295,4 +295,16 @@
 {
   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;
 }
Index: libvo/video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.15
diff -u -r1.15 video_out.h
--- libvo/video_out.h	31 Jan 2002 09:52:45 -0000	1.15
+++ libvo/video_out.h	8 Feb 2002 10:12:54 -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.
@@ -144,14 +155,6 @@
          * Closes driver. Should restore the original state of the system.
          */
         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;
 
Index: libvo/video_out_internal.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out_internal.h,v
retrieving revision 1.8
diff -u -r1.8 video_out_internal.h
--- libvo/video_out_internal.h	31 Jan 2002 09:52:45 -0000	1.8
+++ libvo/video_out_internal.h	8 Feb 2002 10:12:54 -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,7 +40,7 @@
 {\
 	preinit,\
 	config,\
-        query_format,\
+	control,\
 	get_info,\
 	draw_frame,\
 	draw_slice,\
@@ -47,7 +48,6 @@
 	flip_page,\
 	check_events,\
 	uninit,\
-	query_vaa\
 };
 
 #include "osd.h"
Index: libvo/vo_3dfx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_3dfx.c,v
retrieving revision 1.10
diff -u -r1.10 vo_3dfx.c
--- libvo/vo_3dfx.c	31 Jan 2002 09:52:45 -0000	1.10
+++ libvo/vo_3dfx.c	8 Feb 2002 10:12:54 -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;
 }
-
Index: libvo/vo_aa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_aa.c,v
retrieving revision 1.19
diff -u -r1.19 vo_aa.c
--- libvo/vo_aa.c	31 Jan 2002 09:52:45 -0000	1.19
+++ libvo/vo_aa.c	8 Feb 2002 10:12:54 -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;
 }
Index: libvo/vo_dga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dga.c,v
retrieving revision 1.39
diff -u -r1.39 vo_dga.c
--- libvo/vo_dga.c	31 Jan 2002 11:45:25 -0000	1.39
+++ libvo/vo_dga.c	8 Feb 2002 10:12:54 -0000
@@ -1176,9 +1176,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;
 }
 
 //---------------------------------------------------------
Index: libvo/vo_directfb.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_directfb.c,v
retrieving revision 1.9
diff -u -r1.9 vo_directfb.c
--- libvo/vo_directfb.c	31 Jan 2002 09:52:45 -0000	1.9
+++ libvo/vo_directfb.c	8 Feb 2002 10:12:55 -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;
 }
Index: libvo/vo_dxr3.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dxr3.c,v
retrieving revision 1.44
diff -u -r1.44 vo_dxr3.c
--- libvo/vo_dxr3.c	3 Feb 2002 23:13:56 -0000	1.44
+++ libvo/vo_dxr3.c	8 Feb 2002 10:12:55 -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 at 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 at 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");
@@ -483,9 +479,4 @@
 #endif
 	
 	return 0;
-}
-
-static void query_vaa(vo_vaa_t *vaa)
-{
-	memset(vaa, 0, sizeof(vo_vaa_t));
 }
Index: libvo/vo_fbdev.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev.c,v
retrieving revision 1.59
diff -u -r1.59 vo_fbdev.c
--- libvo/vo_fbdev.c	31 Jan 2002 10:23:39 -0000	1.59
+++ libvo/vo_fbdev.c	8 Feb 2002 10:12:55 -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;
 }
Index: libvo/vo_fsdga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fsdga.c,v
retrieving revision 1.8
diff -u -r1.8 vo_fsdga.c
--- libvo/vo_fsdga.c	31 Jan 2002 11:45:25 -0000	1.8
+++ libvo/vo_fsdga.c	8 Feb 2002 10:12:55 -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;
 }
Index: libvo/vo_ggi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_ggi.c,v
retrieving revision 1.13
diff -u -r1.13 vo_ggi.c
--- libvo/vo_ggi.c	31 Jan 2002 09:52:45 -0000	1.13
+++ libvo/vo_ggi.c	8 Feb 2002 10:12:55 -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;
 }
Index: libvo/vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.20
diff -u -r1.20 vo_gl.c
--- libvo/vo_gl.c	1 Feb 2002 02:49:04 -0000	1.20
+++ libvo/vo_gl.c	8 Feb 2002 10:12:55 -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;
 }
Index: libvo/vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.13
diff -u -r1.13 vo_gl2.c
--- libvo/vo_gl2.c	31 Jan 2002 11:46:46 -0000	1.13
+++ libvo/vo_gl2.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_md5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_md5.c,v
retrieving revision 1.9
diff -u -r1.9 vo_md5.c
--- libvo/vo_md5.c	1 Feb 2002 02:49:04 -0000	1.9
+++ libvo/vo_md5.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_mga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_mga.c,v
retrieving revision 1.22
diff -u -r1.22 vo_mga.c
--- libvo/vo_mga.c	1 Feb 2002 02:43:01 -0000	1.22
+++ libvo/vo_mga.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_mpegpes.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_mpegpes.c,v
retrieving revision 1.18
diff -u -r1.18 vo_mpegpes.c
--- libvo/vo_mpegpes.c	31 Jan 2002 09:52:45 -0000	1.18
+++ libvo/vo_mpegpes.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_null.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_null.c,v
retrieving revision 1.5
diff -u -r1.5 vo_null.c
--- libvo/vo_null.c	31 Jan 2002 09:52:45 -0000	1.5
+++ libvo/vo_null.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_odivx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_odivx.c,v
retrieving revision 1.9
diff -u -r1.9 vo_odivx.c
--- libvo/vo_odivx.c	31 Jan 2002 09:52:45 -0000	1.9
+++ libvo/vo_odivx.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_pgm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_pgm.c,v
retrieving revision 1.9
diff -u -r1.9 vo_pgm.c
--- libvo/vo_pgm.c	31 Jan 2002 09:52:45 -0000	1.9
+++ libvo/vo_pgm.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_png.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_png.c,v
retrieving revision 1.11
diff -u -r1.11 vo_png.c
--- libvo/vo_png.c	31 Jan 2002 09:52:45 -0000	1.11
+++ libvo/vo_png.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_sdl.c,v
retrieving revision 1.64
diff -u -r1.64 vo_sdl.c
--- libvo/vo_sdl.c	4 Feb 2002 19:14:40 -0000	1.64
+++ libvo/vo_sdl.c	8 Feb 2002 10:12:56 -0000
@@ -1277,7 +1277,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;
 }
Index: libvo/vo_svga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_svga.c,v
retrieving revision 1.41
diff -u -r1.41 vo_svga.c
--- libvo/vo_svga.c	31 Jan 2002 09:52:45 -0000	1.41
+++ libvo/vo_svga.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_syncfb.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_syncfb.c,v
retrieving revision 1.9
diff -u -r1.9 vo_syncfb.c
--- libvo/vo_syncfb.c	31 Jan 2002 09:52:45 -0000	1.9
+++ libvo/vo_syncfb.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_tdfxfb.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_tdfxfb.c,v
retrieving revision 1.5
diff -u -r1.5 vo_tdfxfb.c
--- libvo/vo_tdfxfb.c	31 Jan 2002 09:52:45 -0000	1.5
+++ libvo/vo_tdfxfb.c	8 Feb 2002 10:12:56 -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;
 }
Index: libvo/vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.65
diff -u -r1.65 vo_vesa.c
--- libvo/vo_vesa.c	7 Feb 2002 19:37:09 -0000	1.65
+++ libvo/vo_vesa.c	8 Feb 2002 10:12:57 -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;
 }
Index: libvo/vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.58
diff -u -r1.58 vo_x11.c
--- libvo/vo_x11.c	6 Feb 2002 20:52:14 -0000	1.58
+++ libvo/vo_x11.c	8 Feb 2002 10:12:57 -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;
 }
-
Index: libvo/vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.43
diff -u -r1.43 vo_xmga.c
--- libvo/vo_xmga.c	7 Feb 2002 16:15:08 -0000	1.43
+++ libvo/vo_xmga.c	8 Feb 2002 10:12:57 -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;
 }
Index: libvo/vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.51
diff -u -r1.51 vo_xv.c
--- libvo/vo_xv.c	31 Jan 2002 09:52:45 -0000	1.51
+++ libvo/vo_xv.c	8 Feb 2002 10:12:57 -0000
@@ -126,7 +126,7 @@
      {
 	for (i = 0; i < howmany && attributes; i++)
         {
-            if (attributes[i].flags & XvSettable && !strcmp(attributes[i].name,"XV_SET_DEFAULTS"
))
+            if (attributes[i].flags & XvSettable && !strcmp(attributes[i].name,"XV_SET_DEFAULTS"))
             {
 		was_reset = 1;
 		if(verbose > 1) printf("vo_xv: reset gamma correction\n");
@@ -768,4 +768,16 @@
   memset(vaa,0,sizeof(vo_vaa_t));
   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;
 }
Index: libvo/vo_xvidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xvidix.c,v
retrieving revision 1.18
diff -u -r1.18 vo_xvidix.c
--- libvo/vo_xvidix.c	7 Feb 2002 17:42:37 -0000	1.18
+++ libvo/vo_xvidix.c	8 Feb 2002 10:12:57 -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;
 }
Index: libvo/vo_zr.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_zr.c,v
retrieving revision 1.7
diff -u -r1.7 vo_zr.c
--- libvo/vo_zr.c	31 Jan 2002 09:52:45 -0000	1.7
+++ libvo/vo_zr.c	8 Feb 2002 10:12:57 -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;
 }
Index: libvo/vosub_vidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vosub_vidix.c,v
retrieving revision 1.26
diff -u -r1.26 vosub_vidix.c
--- libvo/vosub_vidix.c	5 Feb 2002 18:54:41 -0000	1.26
+++ libvo/vosub_vidix.c	8 Feb 2002 10:12:57 -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;
 }
? libavcodec/README


More information about the MPlayer-dev-eng mailing list