[MPlayer-cvslog] r28285 - in trunk/libvo: vo_xv.c vo_xvmc.c x11_common.c x11_common.h

cehoyos subversion at mplayerhq.hu
Fri Jan 9 16:25:27 CET 2009


Author: cehoyos
Date: Fri Jan  9 16:25:24 2009
New Revision: 28285

Log:
Factor calc_drwXY out of vo_xv and vo_xvmc.

Modified:
   trunk/libvo/vo_xv.c
   trunk/libvo/vo_xvmc.c
   trunk/libvo/x11_common.c
   trunk/libvo/x11_common.h

Modified: trunk/libvo/vo_xv.c
==============================================================================
--- trunk/libvo/vo_xv.c	Fri Jan  9 11:32:01 2009	(r28284)
+++ trunk/libvo/vo_xv.c	Fri Jan  9 16:25:24 2009	(r28285)
@@ -140,22 +140,6 @@ static void draw_alpha_null(int x0, int 
 
 static void deallocate_xvimage(int foo);
 
-static void calc_drwXY(uint32_t *drwX, uint32_t *drwY) {
-  *drwX = *drwY = 0;
-  if (vo_fs) {
-    aspect(&vo_dwidth, &vo_dheight, A_ZOOM);
-    vo_dwidth = FFMIN(vo_dwidth, vo_screenwidth);
-    vo_dheight = FFMIN(vo_dheight, vo_screenheight);
-    *drwX = (vo_screenwidth - vo_dwidth) / 2;
-    *drwY = (vo_screenheight - vo_dheight) / 2;
-    mp_msg(MSGT_VO, MSGL_V, "[xv-fs] dx: %d dy: %d dw: %d dh: %d\n",
-           *drwX, *drwY, vo_dwidth, vo_dheight);
-  } else if (WinID == 0) {
-    *drwX = vo_dx;
-    *drwY = vo_dy;
-  }
-}
-
 /*
  * connect to server, create and map window,
  * allocate colors and (shared) memory
@@ -286,7 +270,7 @@ static int config(uint32_t width, uint32
     current_ip_buf = 0;
 
     if ((flags & VOFLAG_FULLSCREEN) && WinID <= 0) vo_fs = 1;
-    calc_drwXY(&drwX, &drwY);
+    vo_calc_drwXY(&drwX, &drwY);
 
     panscan_calc();
     
@@ -391,7 +375,7 @@ static void check_events(void)
 
     if (e & VO_EVENT_RESIZE)
     {
-        calc_drwXY(&drwX, &drwY);
+        vo_calc_drwXY(&drwX, &drwY);
     }
 
     if (e & VO_EVENT_EXPOSE || e & VO_EVENT_RESIZE)

Modified: trunk/libvo/vo_xvmc.c
==============================================================================
--- trunk/libvo/vo_xvmc.c	Fri Jan  9 11:32:01 2009	(r28284)
+++ trunk/libvo/vo_xvmc.c	Fri Jan  9 16:25:24 2009	(r28285)
@@ -431,22 +431,6 @@ opt_t subopts [] =
    return 0;
 }
 
-static void calc_drwXY(uint32_t *drwX, uint32_t *drwY) {
-  *drwX = *drwY = 0;
-  if (vo_fs) {
-    aspect(&vo_dwidth, &vo_dheight, A_ZOOM);
-    vo_dwidth = FFMIN(vo_dwidth, vo_screenwidth);
-    vo_dheight = FFMIN(vo_dheight, vo_screenheight);
-    *drwX = (vo_screenwidth - vo_dwidth) / 2;
-    *drwY = (vo_screenheight - vo_dheight) / 2;
-    mp_msg(MSGT_VO, MSGL_V, "[xvmc-fs] dx: %d dy: %d dw: %d dh: %d\n",
-           *drwX, *drwY, vo_dwidth, vo_dheight);
-  } else if (WinID == 0) {
-    *drwX = vo_dx;
-    *drwY = vo_dy;
-  }
-}
-
 static int config(uint32_t width, uint32_t height,
 		       uint32_t d_width, uint32_t d_height,
 		       uint32_t flags, char *title, uint32_t format){
@@ -674,7 +658,7 @@ skip_surface_allocation:
    }
 
    if ((flags & VOFLAG_FULLSCREEN) && WinID <= 0) vo_fs = 1;
-   calc_drwXY(&drwX, &drwY);
+   vo_calc_drwXY(&drwX, &drwY);
 
    panscan_calc();
 

Modified: trunk/libvo/x11_common.c
==============================================================================
--- trunk/libvo/x11_common.c	Fri Jan  9 11:32:01 2009	(r28284)
+++ trunk/libvo/x11_common.c	Fri Jan  9 16:25:24 2009	(r28285)
@@ -8,6 +8,7 @@
 #include "config.h"
 #include "mp_msg.h"
 #include "mp_fifo.h"
+#include "libavutil/common.h"
 #include "x11_common.h"
 
 #ifdef X11_FULLSCREEN
@@ -1854,6 +1855,23 @@ uint32_t vo_x11_get_equalizer(char *name
     return VO_TRUE;
 }
 
+void vo_calc_drwXY(uint32_t *drwX, uint32_t *drwY)
+{
+    *drwX = *drwY = 0;
+    if (vo_fs) {
+        aspect(&vo_dwidth, &vo_dheight, A_ZOOM);
+        vo_dwidth  = FFMIN(vo_dwidth, vo_screenwidth);
+        vo_dheight = FFMIN(vo_dheight, vo_screenheight);
+        *drwX      = (vo_screenwidth - vo_dwidth) / 2;
+        *drwY      = (vo_screenheight - vo_dheight) / 2;
+        mp_msg(MSGT_VO, MSGL_V, "[vo-fs] dx: %d dy: %d dw: %d dh: %d\n",
+               *drwX, *drwY, vo_dwidth, vo_dheight);
+    } else if (WinID == 0) {
+        *drwX = vo_dx;
+        *drwY = vo_dy;
+    }
+}
+
 #ifdef CONFIG_XV
 int vo_xv_set_eq(uint32_t xv_port, char *name, int value)
 {

Modified: trunk/libvo/x11_common.h
==============================================================================
--- trunk/libvo/x11_common.h	Fri Jan  9 11:32:01 2009	(r28284)
+++ trunk/libvo/x11_common.h	Fri Jan  9 16:25:24 2009	(r28285)
@@ -129,5 +129,6 @@ void vo_vm_close(void);
 void update_xinerama_info(void);
 
 int vo_find_depth_from_visuals(Display *dpy, int screen, Visual **visual_return);
+void vo_calc_drwXY(uint32_t *drwX, uint32_t *drwY);
 
 #endif /* MPLAYER_X11_COMMON_H */



More information about the MPlayer-cvslog mailing list