media/gpu/v4l2/V4L2Device: Add |single_planar| args in VideoPixelFormatToV4L2PixFmt()

V4L2Device::VideoPixelFormatToV4L2PixFmt returns either single and multi plane
v4l2 pix fmt, depending on VideoPixelFormat. This would rather return single or
multi plane v4l2 pix format with given VideoPixelFormat and |single_planar|.
V4L2VEA always uses multi plane formats. On the other hand, V4L2 IP depends on
its caller's decision. So V4L2IP's caller specifies single or multi planes by
the number of buffers on VideoFrameLayout. VideoFrameLayoutToV4L2PixFmt() is
also added in this CL, which returns v4l2 pixel format from given
VideoFrameLayout. This CL also adds IsMultiPlanarV4L2PixFmt(), which returns
whether v4l2 pix fmt is multi planar or not.

BUG=chromium:894381
TEST=VDA unittest with/without --test_import on hana
TEST=VEA unittest with YV12 raw video data on hana

Change-Id: I8cce3229e81fe041eb0bf8ea60f2735ef610e1b0
Reviewed-on: https://chromium-review.googlesource.com/c/1341428
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611537}
5 files changed