summaryrefslogtreecommitdiffstats
path: root/libvo/vo_xv.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-04 20:17:07 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-04 20:17:07 +0000
commite598b63ddc1afd3d9b698d6fbd081b6762d77457 (patch)
treeac8ca76046683697955c30445effabc425beb7a6 /libvo/vo_xv.c
parentd20d9e132a09b2b0f647a04be867b04eed1ad62a (diff)
downloadmpv-e598b63ddc1afd3d9b698d6fbd081b6762d77457.tar.bz2
mpv-e598b63ddc1afd3d9b698d6fbd081b6762d77457.tar.xz
pan&scan support with -vo xv by ?? <mplayer@svennevid.net>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6305 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_xv.c')
-rw-r--r--libvo/vo_xv.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 34ce3115a6..39b087cf42 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -94,6 +94,10 @@ static uint32_t image_height;
static uint32_t image_format;
static int flip_flag;
+static int panscan_x;
+static int panscan_y;
+static float panscan_amount;
+
static Window mRoot;
static uint32_t drwX,drwY,drwBorderWidth,drwDepth;
static uint32_t dwidth,dheight;
@@ -334,6 +338,10 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
static uint32_t vm_height;
#endif
+ panscan_x = 0;
+ panscan_y = 0;
+ panscan_amount = 0.0f;
+
aspect_save_orig(width,height);
aspect_save_prescale(d_width,d_height);
@@ -596,18 +604,31 @@ static void draw_osd(void)
static void flip_page(void)
{
+ if((vo_fs && (vo_panscan != panscan_amount)) || (!vo_fs && panscan_amount))
+ {
+ int panscan_area = (vo_screenheight-vo_dheight);
+
+ panscan_amount = vo_fs ? vo_panscan : 0;
+
+ panscan_x = panscan_area * panscan_amount * (image_width / (float)image_height);
+ panscan_y = panscan_area * panscan_amount;
+
+ XClearWindow(mDisplay, vo_window);
+ XFlush(mDisplay);
+ }
+
if ( Shmem_Flag )
{
XvShmPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf],
0, 0, image_width, image_height,
- drwX,drwY,vo_dwidth,(vo_fs?vo_dheight - 1:vo_dheight),
+ drwX-(panscan_x>>1),drwY-(panscan_y>>1),vo_dwidth+panscan_x,(vo_fs?vo_dheight - 1:vo_dheight)+panscan_y,
False);
}
else
{
XvPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf],
0, 0, image_width, image_height,
- drwX,drwY,vo_dwidth,(vo_fs?vo_dheight - 1:vo_dheight));
+ drwX-(panscan_x>>1),drwY-(panscan_y>>1),vo_dwidth+panscan_x,(vo_fs?vo_dheight - 1:vo_dheight)+panscan_y);
}
if (num_buffers>1){
current_buf=(current_buf+1)%num_buffers;