egl/android: Use gralloc::lock_ycbcr for resolving YUV formats (v2)
There is an interface that can be used to query YUV buffers for their
internal format. Specifically, if gralloc:lock_ycbcr() is given no SW
usage flags, it's supposed to return plane offsets instead of pointers.
Let's use this interface to implement support for YUV formats in Android
EGL backend.
v2: Fixes from Emil's review:
a) Added comments for parts that might be not clear,
b) Changed get_fourcc_yuv() to return -1 on failure,
c) Changed is_yuv() to use bool.
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>