From: meka rama Date: Mon, 7 Jan 2013 10:40:00 +0000 (+0900) Subject: libexynosutils: Added support for HAL_PIXEL_FORMAT_YV12 format. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=abf095f7968c68a6fe54fd0df9c7681daba6f046;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos.git libexynosutils: Added support for HAL_PIXEL_FORMAT_YV12 format. Change-Id: I8e221a3b33cf0e1282708b2ba10f13a2cdebc0fc Signed-off-by: meka rama --- diff --git a/libexynosutils/exynos5_format_v4l2.c b/libexynosutils/exynos5_format_v4l2.c index fb194e5..c80622f 100644 --- a/libexynosutils/exynos5_format_v4l2.c +++ b/libexynosutils/exynos5_format_v4l2.c @@ -79,6 +79,10 @@ int HAL_PIXEL_FORMAT_2_V4L2_PIX( v4l2_pixel_format = V4L2_PIX_FMT_YVU420M; break; + case HAL_PIXEL_FORMAT_YV12: + v4l2_pixel_format = V4L2_PIX_FMT_YVU420; + break; + case HAL_PIXEL_FORMAT_YCbCr_420_P: v4l2_pixel_format = V4L2_PIX_FMT_YUV420M; break; @@ -179,6 +183,9 @@ int V4L2_PIX_2_HAL_PIXEL_FORMAT( break; case V4L2_PIX_FMT_YVU420: + hal_pixel_format = HAL_PIXEL_FORMAT_YV12; + break; + case V4L2_PIX_FMT_YVU420M: hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YV12; break; @@ -256,7 +263,8 @@ int NUM_PLANES(int hal_pixel_format) break; case HAL_PIXEL_FORMAT_YCbCr_420_I: case HAL_PIXEL_FORMAT_CbYCrY_420_I: - return 1; + case HAL_PIXEL_FORMAT_YV12: + return 1; default: return 1; } @@ -299,6 +307,11 @@ unsigned int FRAME_SIZE( frame_size = size + 2 * ALIGN(width >> 1, 8) * ALIGN(height >> 1, 8); break; + case HAL_PIXEL_FORMAT_YV12: + size = ALIGN(width, 16) * height; + frame_size = size + ALIGN(width / 2, 16) * height; + break; + case HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP: case HAL_PIXEL_FORMAT_YCrCb_420_SP: case HAL_PIXEL_FORMAT_YCbCr_420_SP: @@ -364,6 +377,11 @@ int PLANAR_FRAME_SIZE(int hal_pixel_format, int width, int height, *chroma_size = ALIGN_TO_8KB(ALIGN_TO_128B(width) * ALIGN_TO_32B(height >> 1)); break; + case HAL_PIXEL_FORMAT_YV12: + size = ALIGN(width, 16) * height; + *luma_size = size + ALIGN(width / 2, 16) * height; + break; + default: *luma_size = FRAME_SIZE(hal_pixel_format, width, height); }