deinterlace: use output caps to compute buffer size
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>
Tue, 14 Jan 2020 09:21:07 +0000 (14:51 +0530)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 3 Mar 2020 17:15:00 +0000 (17:15 +0000)
In interlace-mode=alternate the input buffers have half the size of the
output ones as each field has its own buffer.

gst/deinterlace/gstdeinterlace.c

index 653ecb7..5a9edd0 100644 (file)
@@ -2614,8 +2614,12 @@ gst_deinterlace_do_bufferpool (GstDeinterlace * self, GstCaps * outcaps)
   if (gst_query_get_n_allocation_pools (query) > 0)
     gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
   else {
+    GstVideoInfo out_info;
+
+    gst_video_info_from_caps (&out_info, outcaps);
+
     pool = NULL;
-    size = GST_VIDEO_INFO_SIZE (&self->vinfo);
+    size = GST_VIDEO_INFO_SIZE (&out_info);
     min =
         MAX ((gst_deinterlace_method_get_fields_required (self->method) +
             1) / 2 + 1, 4);