diff options
author | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-01-09 15:25:24 +0000 |
---|---|---|
committer | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-01-09 15:25:24 +0000 |
commit | 0fa2d1abd78aba49a33b0f6dd6f7f2738a179d4e (patch) | |
tree | 529ed18ba6b905f347d4c5791634ee52f661b6c2 /libvo | |
parent | 84b4007802282135bc64d569c8fcec291465b515 (diff) | |
download | mpv-0fa2d1abd78aba49a33b0f6dd6f7f2738a179d4e.tar.bz2 mpv-0fa2d1abd78aba49a33b0f6dd6f7f2738a179d4e.tar.xz |
Factor calc_drwXY out of vo_xv and vo_xvmc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28285 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/vo_xv.c | 20 | ||||
-rw-r--r-- | libvo/vo_xvmc.c | 18 | ||||
-rw-r--r-- | libvo/x11_common.c | 18 | ||||
-rw-r--r-- | libvo/x11_common.h | 1 |
4 files changed, 22 insertions, 35 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index 2c30bddb50..7b1aeabd8e 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -140,22 +140,6 @@ static void draw_alpha_null(int x0, int y0, int w, int h, 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_t height, uint32_t d_width, 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) diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c index a0f01113e7..29ce3b6471 100644 --- a/libvo/vo_xvmc.c +++ b/libvo/vo_xvmc.c @@ -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(); diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 9b6ee47b9b..919dec5c1f 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -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, int *value) 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) { diff --git a/libvo/x11_common.h b/libvo/x11_common.h index b4f1e4ae9f..d4b18c89ea 100644 --- a/libvo/x11_common.h +++ b/libvo/x11_common.h @@ -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 */ |