Hi Sylwester, On Wed, Jun 28, 2017 at 05:44:32PM +0200, Sylwester Nawrocki wrote: > Hi, > > On 06/28/2017 03:31 PM, Sakari Ailus wrote: > > IMO VB2/V4L2 could better support conversion between single and > > multi-planar buffer types so that the applications could just use any and > > drivers could manage with one. > > > > I don't have a strong opinion either way, but IMO this could be well > > addressed later on by improving the framework when (or if) the support for > > formats such as NV12 is added. > > We had already conversion between single and multi-planar buffer types > in the kernel. But for some reasons it got removed. [1] The conversion > is supposed to be done in libv4l2, which is not mandatory so it cannot > be used to ensure backward compatibility while moving driver from one > API to the other. > > [1] > commit 1d0c86cad38678fa42f6d048a7b9e4057c8c16fc > [media] media: v4l: remove single to multiplane conversion Thanks for the pointer. I had missed this back then. Not all applications will be using libv4l2. This is something that would make sense to do in the kernel IMO. The changes seem pretty minimal to me, based on the patch. There is now at least one difference between single-planar and multi-planar cases; the data_offset field is only present in struct v4l2_plane. That should be easy to address by adding the field to the single-planar case, too. (We'll need new buffer structs in the near future anyway, there's no really a way around that.) -- Kind regards, Sakari Ailus e-mail: sakari.ailus@xxxxxx XMPP: sailus@xxxxxxxxxxxxxx