[MPlayer-dev-eng] [PATCH] panscanrange option

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Sep 25 18:53:54 CEST 2005


Hi,
attached patch adds a panscanrange option, effecting how panscan works.
Using negative values e.g. allows doing panscan without cropping the
borders first. See man page part for details.
I intend to apply tomorrow if nobody has suggestions/objections.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.252
diff -u -r1.252 cfg-mplayer.h
--- cfg-mplayer.h	23 Sep 2005 22:35:02 -0000	1.252
+++ cfg-mplayer.h	25 Sep 2005 16:42:18 -0000
@@ -37,6 +37,7 @@
 extern int vo_dbpp;
 extern int vo_directrendering;
 extern float vo_panscan;
+extern float vo_panscanrange;
 /* only used at startup (setting these values from configfile) */
 extern int vo_gamma_brightness;
 extern int vo_gamma_saturation;
@@ -239,6 +240,7 @@
 	{"vsync", &vo_vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"novsync", &vo_vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL},
 	{"panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL},
+	{"panscanrange", &vo_panscanrange, CONF_TYPE_FLOAT, CONF_RANGE, -19.0, 99.0, NULL},
 
 	{"grabpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"nograbpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 1, 0, NULL},
Index: DOCS/man/en/mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/man/en/mplayer.1,v
retrieving revision 1.1117
diff -u -r1.1117 mplayer.1
--- DOCS/man/en/mplayer.1	25 Sep 2005 16:20:41 -0000	1.1117
+++ DOCS/man/en/mplayer.1	25 Sep 2005 16:43:22 -0000
@@ -2280,6 +2280,15 @@
 video output drivers.
 .
 .TP
+.B \-panscanrange <-19.0\-99.0> (experimental)
+Change the range of the pan-and-scan functionality.
+Positive values means you can zoom up to this many time the factor needed
+to remove the borders.
+Negative numbers mean you can zoom in up to a factor of -panscanrange+1.
+E.g. \-panscanrange -3 allows a zoom factor of up to 4.
+This feature is experimental, only report bugs when using -vo gl.
+.
+.TP
 .B \-refreshrate <Hz>
 Set the monitor refreshrate in Hz.
 Currently only supported by \-vo directx combined with the \-vm option.
Index: libvo/aspect.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/aspect.c,v
retrieving revision 1.17
diff -u -r1.17 aspect.c
--- libvo/aspect.c	28 Oct 2004 01:15:51 -0000	1.17
+++ libvo/aspect.c	25 Sep 2005 16:44:01 -0000
@@ -14,6 +14,7 @@
 int vo_panscan_x = 0;
 int vo_panscan_y = 0;
 float vo_panscan_amount = 0;
+float vo_panscanrange = 1.0;
 
 #include "video_out.h"
 
@@ -123,8 +124,12 @@
  int fwidth,fheight;
  int vo_panscan_area;
 
+ if (vo_panscanrange > 0) {
  aspect(&fwidth,&fheight,A_ZOOM);
  vo_panscan_area = (aspdat.scrh-fheight);
+   vo_panscan_area *= vo_panscanrange;
+ } else
+   vo_panscan_area = -vo_panscanrange * aspdat.scrh;
 
  vo_panscan_amount = vo_fs ? vo_panscan : 0;
  vo_panscan_x = vo_panscan_area * vo_panscan_amount * aspdat.asp;


More information about the MPlayer-dev-eng mailing list