From f4f389483658e23ca7f410cc0633ce3fd358f70c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 12 Jun 2015 16:47:03 +0200 Subject: [PATCH] video-scaler: Enforce same taps on Y and UV scalers for merged formats Make sure we have the same number of taps for the Y and UV scalers so that the scalers can be merged correctly. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=749764 --- gst-libs/gst/video/video-converter.c | 3 ++- gst-libs/gst/video/video-scaler.c | 16 ++++++++++++++++ gst-libs/gst/video/video-scaler.h | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index 2fa64fa6b6..c90ddaf791 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -4040,7 +4040,8 @@ setup_scale (GstVideoConverter * convert) in_width), GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (out_finfo, GST_VIDEO_COMP_Y, out_width), convert->config); uv_scaler = - gst_video_scaler_new (method, GST_VIDEO_SCALER_FLAG_NONE, taps, + gst_video_scaler_new (method, GST_VIDEO_SCALER_FLAG_NONE, + gst_video_scaler_get_max_taps (y_scaler), GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (in_finfo, GST_VIDEO_COMP_U, in_width), GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (out_finfo, GST_VIDEO_COMP_U, out_width), convert->config); diff --git a/gst-libs/gst/video/video-scaler.c b/gst-libs/gst/video/video-scaler.c index 25e8b015a6..881fd08922 100644 --- a/gst-libs/gst/video/video-scaler.c +++ b/gst-libs/gst/video/video-scaler.c @@ -248,6 +248,22 @@ gst_video_scaler_free (GstVideoScaler * scale) g_slice_free (GstVideoScaler, scale); } +/** + * gst_video_scaler_get_max_taps: + * @scale: a #GstVideoScaler + * + * Get the maximum number of taps for @scale. + * + * Returns: the maximum number of taps + */ +guint +gst_video_scaler_get_max_taps (GstVideoScaler * scale) +{ + g_return_val_if_fail (scale != NULL, 0); + + return scale->resampler.max_taps; +} + /** * gst_video_scaler_get_coeff: * @scale: a #GstVideoScaler diff --git a/gst-libs/gst/video/video-scaler.h b/gst-libs/gst/video/video-scaler.h index 891a49de02..e4b752fd22 100644 --- a/gst-libs/gst/video/video-scaler.h +++ b/gst-libs/gst/video/video-scaler.h @@ -57,6 +57,7 @@ GstVideoScaler * gst_video_scaler_new (GstVideoResamplerMethod m GstStructure * options); void gst_video_scaler_free (GstVideoScaler *scale); +guint gst_video_scaler_get_max_taps (GstVideoScaler *scale); const gdouble * gst_video_scaler_get_coeff (GstVideoScaler *scale, guint out_offset, guint *in_offset,