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.

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