From 7305f50512faa25fdb2ed198ff2249edb4d22505 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Thu, 10 Aug 2017 01:45:53 +0200 Subject: [PATCH] videoaggregator: improve find_best_format heuristic. The goal here is to minimize the work needed to bring all images to a common format. A better criteria than the number of pads with a given format is the number of pixels with a given format. https://bugzilla.gnome.org/show_bug.cgi?id=786078 --- gst-libs/gst/video/gstvideoaggregator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c index def0998d78..a7b3bf8055 100644 --- a/gst-libs/gst/video/gstvideoaggregator.c +++ b/gst-libs/gst/video/gstvideoaggregator.c @@ -514,7 +514,7 @@ gst_video_aggregator_find_best_format (GstVideoAggregator * vagg, format_number = GPOINTER_TO_INT (g_hash_table_lookup (formats_table, GINT_TO_POINTER (GST_VIDEO_INFO_FORMAT (&pad->info)))); - format_number += 1; + format_number += pad->info.width * pad->info.height; g_hash_table_replace (formats_table, GINT_TO_POINTER (GST_VIDEO_INFO_FORMAT (&pad->info)),