OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
3.0 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../mplayer/vf-crop-relative.patch
  5. # Copyright (C) 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. It got on my nerves for some time that I have to compute the resulting width and
  17. height manually all the itme - a task screaming for a computer. Also just
  18. cutting off the overscan noise usually on DVB broadcasts requires multiple
  19. parameter sets depending on the actual broadcast format (e.g. classic 4:3
  20. vs. a real (black border-less) 16:9) transmission).
  21. Allow relative cuts using negative values, e.g. crop="20:82:-20:-82".
  22. - Rene Rebe <rene@exactcode.de>
  23. --- MPlayer-1.0pre7try2/libmpcodecs/vf_crop.c 2003-05-20 19:42:33.000000000 +0200
  24. +++ MPlayer-1.0pre7try2-fixed/libmpcodecs/vf_crop.c 2006-02-13 13:35:19.927524500 +0100
  25. @@ -28,9 +28,13 @@
  26. static int config(struct vf_instance_s* vf,
  27. int width, int height, int d_width, int d_height,
  28. unsigned int flags, unsigned int outfmt){
  29. + if (vf->priv->crop_w < 0)
  30. + vf->priv->crop_w = width + vf->priv->crop_w;
  31. + if (vf->priv->crop_h < 0)
  32. + vf->priv->crop_h = height + vf->priv->crop_h;
  33. // calculate the missing parameters:
  34. - if(vf->priv->crop_w<=0 || vf->priv->crop_w>width) vf->priv->crop_w=width;
  35. - if(vf->priv->crop_h<=0 || vf->priv->crop_h>height) vf->priv->crop_h=height;
  36. + if(vf->priv->crop_w>width) vf->priv->crop_w=width;
  37. + if(vf->priv->crop_h>height) vf->priv->crop_h=height;
  38. if(vf->priv->crop_x<0) vf->priv->crop_x=(width-vf->priv->crop_w)/2;
  39. if(vf->priv->crop_y<0) vf->priv->crop_y=(height-vf->priv->crop_h)/2;
  40. // rounding:
  41. @@ -156,7 +163,7 @@
  42. &vf->priv->crop_h,
  43. &vf->priv->crop_x,
  44. &vf->priv->crop_y);
  45. - mp_msg(MSGT_VFILTER, MSGL_INFO, "Crop: %d x %d, %d ; %d\n",
  46. + mp_msg(MSGT_VFILTER, MSGL_INFO, "Crop: %d x %d @%d,%d\n",
  47. vf->priv->crop_w,
  48. vf->priv->crop_h,
  49. vf->priv->crop_x,
  50. @@ -166,10 +173,10 @@
  51. #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
  52. static m_option_t vf_opts_fields[] = {
  53. - {"w", ST_OFF(crop_w), CONF_TYPE_INT, M_OPT_MIN,0 ,0, NULL},
  54. - {"h", ST_OFF(crop_h), CONF_TYPE_INT, M_OPT_MIN,0 ,0, NULL},
  55. - {"x", ST_OFF(crop_x), CONF_TYPE_INT, M_OPT_MIN,-1 ,0, NULL},
  56. - {"y", ST_OFF(crop_y), CONF_TYPE_INT, M_OPT_MIN,-1 ,0, NULL},
  57. + {"w", ST_OFF(crop_w), CONF_TYPE_INT, 0, 0, 0, NULL},
  58. + {"h", ST_OFF(crop_h), CONF_TYPE_INT, 0, 0, 0, NULL},
  59. + {"x", ST_OFF(crop_x), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
  60. + {"y", ST_OFF(crop_y), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
  61. { NULL, NULL, 0, 0, 0, 0, NULL }
  62. };