summaryrefslogtreecommitdiffstats
path: root/libvo/vo_xvmc.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-12 17:40:53 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-12 17:40:53 +0000
commit694c3dc03f157eb62442fb2f24118f2ae4432ec7 (patch)
treebb97f3f9bd760f87c4b48f42ae61ccc07ffd33c4 /libvo/vo_xvmc.c
parent8c2821f32d62e6a2a6f6df99b366d1a2ba40fdd3 (diff)
downloadmpv-694c3dc03f157eb62442fb2f24118f2ae4432ec7.tar.bz2
mpv-694c3dc03f157eb62442fb2f24118f2ae4432ec7.tar.xz
Add a calc_src_dst_rects that calculates from window size, panscan etc.
which part of the video source must be scaled onto which part of the window. Direct3D and (future) VDPAU need this, for XvMC it makes it easier to add cropping support and Xv is changed to keep the diff to XvMC small. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28546 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_xvmc.c')
-rw-r--r--libvo/vo_xvmc.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c
index 1f7bbdd1d1..35b5d39309 100644
--- a/libvo/vo_xvmc.c
+++ b/libvo/vo_xvmc.c
@@ -81,7 +81,6 @@ static int top_field_first;
static int image_width,image_height;
static int image_format;
-static uint32_t drwX,drwY;
#define NO_SUBPICTURE 0
#define OVERLAY_SUBPICTURE 1
@@ -676,11 +675,6 @@ skip_surface_allocation:
}
if ((flags & VOFLAG_FULLSCREEN) && WinID <= 0) vo_fs = 1;
- vo_calc_drwXY(&drwX, &drwY);
-
- panscan_calc();
-
- mp_msg(MSGT_VO,MSGL_V, "[xvmc] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
//end vo_xv
@@ -950,19 +944,16 @@ int status,rez;
static void put_xvmc_image(struct xvmc_render_state * p_render_surface,
int draw_ck){
int rez;
-int clipX,clipY,clipW,clipH;
+struct vo_rect src_rect, dst_rect;
int i;
if(p_render_surface == NULL)
return;
- clipX = drwX-(vo_panscan_x>>1);
- clipY = drwY-(vo_panscan_y>>1);
- clipW = vo_dwidth+vo_panscan_x;
- clipH = vo_dheight+vo_panscan_y;
+ calc_src_dst_rects(image_width, image_height, &src_rect, &dst_rect, NULL);
if(draw_ck)
- vo_xv_draw_colorkey(clipX,clipY,clipW,clipH);
+ vo_xv_draw_colorkey(dst_rect.left, dst_rect.top, dst_rect.width, dst_rect.height);
if(benchmark)
return;
@@ -971,8 +962,8 @@ int i;
int field = top_field_first ? i : i ^ 3;
rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface,
vo_window,
- 0, 0, image_width, image_height,
- clipX, clipY, clipW, clipH,
+ src_rect.left, src_rect.top, src_rect.width, src_rect.height,
+ dst_rect.left, dst_rect.top, dst_rect.width, dst_rect.height,
bob_deinterlace ? field : 3);
//p_render_surface_to_show->display_flags);
if(rez != Success){
@@ -1036,8 +1027,6 @@ int e=vo_x11_check_events(mDisplay);
if(e&VO_EVENT_RESIZE)
{
e |= VO_EVENT_EXPOSE;
-
- vo_calc_drwXY(&drwX, &drwY);
}
if ( e & VO_EVENT_EXPOSE )
{