video-scaler.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* GStreamer
  2. * Copyright (C) <2014> Wim Taymans <wim.taymans@gmail.com>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  17. * Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __GST_VIDEO_SCALER_H__
  20. #define __GST_VIDEO_SCALER_H__
  21. #include <gst/gst.h>
  22. #include <gst/video/video-format.h>
  23. #include <gst/video/video-color.h>
  24. #include <gst/video/video-resampler.h>
  25. G_BEGIN_DECLS
  26. /**
  27. * GST_VIDEO_SCALER_OPT_DITHER_METHOD:
  28. *
  29. * #GST_TYPE_VIDEO_DITHER_METHOD, The dither method to use for propagating
  30. * quatization errors.
  31. */
  32. #define GST_VIDEO_SCALER_OPT_DITHER_METHOD "GstVideoScaler.dither-method"
  33. /**
  34. * GstVideoScalerFlags:
  35. * @GST_VIDEO_SCALER_FLAG_NONE: no flags
  36. * @GST_VIDEO_SCALER_FLAG_INTERLACED: Set up a scaler for interlaced content
  37. *
  38. * Different scale flags.
  39. */
  40. typedef enum {
  41. GST_VIDEO_SCALER_FLAG_NONE = (0),
  42. GST_VIDEO_SCALER_FLAG_INTERLACED = (1 << 0),
  43. } GstVideoScalerFlags;
  44. typedef struct _GstVideoScaler GstVideoScaler;
  45. GstVideoScaler * gst_video_scaler_new (GstVideoResamplerMethod method,
  46. GstVideoScalerFlags flags,
  47. guint n_taps,
  48. guint in_size, guint out_size,
  49. GstStructure * options);
  50. void gst_video_scaler_free (GstVideoScaler *scale);
  51. guint gst_video_scaler_get_max_taps (GstVideoScaler *scale);
  52. const gdouble * gst_video_scaler_get_coeff (GstVideoScaler *scale,
  53. guint out_offset,
  54. guint *in_offset,
  55. guint *n_taps);
  56. void gst_video_scaler_horizontal (GstVideoScaler *scale,
  57. GstVideoFormat format,
  58. gpointer src, gpointer dest,
  59. guint dest_offset, guint width);
  60. void gst_video_scaler_vertical (GstVideoScaler *scale,
  61. GstVideoFormat format,
  62. gpointer src_lines[], gpointer dest,
  63. guint dest_offset, guint width);
  64. GstVideoScaler * gst_video_scaler_combine_packed_YUV (GstVideoScaler * y_scale,
  65. GstVideoScaler *uv_scale,
  66. GstVideoFormat in_format,
  67. GstVideoFormat out_format);
  68. void gst_video_scaler_2d (GstVideoScaler *hscale,
  69. GstVideoScaler *vscale,
  70. GstVideoFormat format,
  71. gpointer src, gint src_stride,
  72. gpointer dest, gint dest_stride,
  73. guint x, guint y,
  74. guint width, guint height);
  75. G_END_DECLS
  76. #endif /* __GST_VIDEO_SCALER_H__ */