[MPlayer-dev-eng] xvmc crop patch

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Fri Jun 23 22:01:55 CEST 2006


On Friday, 23 June 2006 at 19:42, DivXero at gmx.net wrote:
> Attached, find an xvmc crop patch. It's pretty simple to use and useful
> for xvmc users. For instance, it helps me crop out the garbage at the top
> of a broadcast (TV) video. Since panscan doesn't help with vertical
> cropping, this is the only way I can remove the annoying (teletext?)
> garbage.
> 
> Syntax-wise, it's quite similar to vf_crop's syntax:
> 
> Usage: mplayer -vc ffmpeg12mc -vo xvmc:crop=WxH[+X+Y]
> (X and Y offsets are optional, if not given, image is centered)
> 
> So for example, I use "-vo xvmc:crop=1912x1048" to "overscan" the edges
> from a 1080i HDTV broadcast.

I'd prefer it if you used exactly the same syntax as -vf crop for consistency.

> I know it's not the prettiest patch you've ever seen, but it's a very
> important feature for me so if someone could clean it up a bit and commit
> it, that would be great.

Doesn't look too bad. A few comments:

@@ -430,8 +442,6 @@
 #ifdef HAVE_XF86VM
 int vm=0;
 unsigned int modeline_width, modeline_height;
-static uint32_t vm_width;
-static uint32_t vm_height;
 #endif
 //end of vo_xv

@@ -624,16 +677,13 @@
    {
       hint.x = vo_dx;
       hint.y = vo_dy;
-      hint.width = d_width;
-      hint.height = d_height;
+      hint.width = vo_dwidth;
+      hint.height = vo_dheight;
+
 #ifdef HAVE_XF86VM
       if ( vm )
       {
-        if ((d_width==0) && (d_height==0))
-           { vm_width=image_width; vm_height=image_height; }
-        else
-           { vm_width=d_width; vm_height=d_height; }
-        vo_vm_switch(vm_width, vm_height,&modeline_width, &modeline_height);
+    vo_vm_switch(vo_dwidth, vo_dheight,&modeline_width, &modeline_height);
         hint.x=(vo_screenwidth-modeline_width)/2;
         hint.y=(vo_screenheight-modeline_height)/2;
         hint.width=modeline_width;

Why are you removing vm_height and vm_width? Are you sure the code behaves
the same way as it did before if you don't use crop?

Also, the vo_vm_switch line is indented inconsistently with its
surroundings after your changes.

Regards,
R.

-- 
MPlayer developer and RPMs maintainer: http://rpm.greysector.net/mplayer/
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan



More information about the MPlayer-dev-eng mailing list