media: v4l: common: Add a function to obtain best size from a list
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 23 Feb 2018 09:50:14 +0000 (04:50 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 21 Mar 2018 15:18:52 +0000 (11:18 -0400)
commit95ce9c28601afc5da0c11792601ad32dd14cdd44
tree8e30f3685fe841a55833a753453c92f6b98ce3d9
parent2525fdcb6e8211ee9dbc270a7f882fbfb6433b55
media: v4l: common: Add a function to obtain best size from a list

Add a function (as well as a helper macro) to obtain the best size in a
list of device specific sizes. This helps writing drivers as well as
aligns interface behaviour across drivers.

The struct in which this information is contained in is typically specific
to the driver, therefore the existing function v4l2_find_nearest_format()
does not address the need.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-common.c
include/media/v4l2-common.h