v4l2src: Maintain downstream caps order
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 11 Jan 2018 22:47:39 +0000 (17:47 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 11 Jan 2018 22:51:13 +0000 (17:51 -0500)
commit21b01acef100cc08879d653068ab5dcbd76dc1d7
tree44a68abe388537ca0b066cecccba8dfd8cc2ccc7
parentb3afa0dc1da53df65361e05a589a0e844d7947b3
v4l2src: Maintain downstream caps order

The g_list_insert_sorted() will behave like prepend when the compare
function returns 0. In our case, we want to maintain the order hence
append. This fixes this issue and improve the sorting algorithm to make
a 10x10 prefered over 10x200 with a preference of 10x8 (and similar
cases which was badly handled). This fixes generally fixes issue were a
sub-optimal format / size is picked.

https://bugzilla.gnome.org/show_bug.cgi?id=792435
sys/v4l2/gstv4l2src.c