video-scaler: Enforce same taps on Y and UV scalers for merged formats
authorWim Taymans <wtaymans@redhat.com>
Fri, 12 Jun 2015 14:47:03 +0000 (16:47 +0200)
committerWim Taymans <wtaymans@redhat.com>
Fri, 12 Jun 2015 14:58:10 +0000 (16:58 +0200)
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
gst-libs/gst/video/video-scaler.c
gst-libs/gst/video/video-scaler.h

index 2fa64fa..c90ddaf 100644 (file)
@@ -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);
index 25e8b01..881fd08 100644 (file)
@@ -249,6 +249,22 @@ gst_video_scaler_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
  * @out_offset: an output offset
index 891a49d..e4b752f 100644 (file)
@@ -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,