From ae7da0f2d28aa8c8fbaefc8de8fc4718b231cdcf Mon Sep 17 00:00:00 2001 From: Jussi Saavalainen Date: Thu, 23 Aug 2012 15:12:28 +0300 Subject: [PATCH] Report only discrete resolutions in caps, avoid duplicates We just filtered the caps, so don't attempt to expand them again. Change-Id: I5c94dc4f37056647effedec0c8e605f5e22ed950 --- gst/mfldv4l2cam/v4l2camsrc_calls.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/gst/mfldv4l2cam/v4l2camsrc_calls.c b/gst/mfldv4l2cam/v4l2camsrc_calls.c index e49dab3..def580b 100644 --- a/gst/mfldv4l2cam/v4l2camsrc_calls.c +++ b/gst/mfldv4l2cam/v4l2camsrc_calls.c @@ -1898,26 +1898,10 @@ gst_v4l2camsrc_probe_caps_for_format (GstMFLDV4l2CamSrc * v4l2camsrc, /* Sort the resolutions from smallest to largest */ results = g_list_sort (results, compare_resolutions); - /* If we have resizer we can use ranges instead of discrete - resolutions reported by driver. FIXME: how to detect resizer? - It would be nice if the resizer was transparent to v4l2camsrc. - */ while (results != NULL) { tmp = GST_STRUCTURE (results->data); - gst_structure_get_int (tmp, "width", &max_w); - gst_structure_get_int (tmp, "height", &max_h); - min_w = max_w / RESIZER_MAX_DOWNSCALE_FACTOR; - min_h = max_h / RESIZER_MAX_DOWNSCALE_FACTOR; - - GST_LOG_OBJECT (v4l2camsrc, - "Setting up range %dx%d - %dx%d", min_w, min_h, max_w, max_h); - - gst_structure_set (tmp, - "width", GST_TYPE_INT_RANGE, min_w, max_w, - "height", GST_TYPE_INT_RANGE, min_h, max_h, NULL); - - gst_caps_append_structure (ret, tmp); + gst_caps_merge_structure (ret, tmp); results = g_list_delete_link (results, results); } -- 2.7.4