libexynosutils: Added support for HAL_PIXEL_FORMAT_YV12 format.
authormeka rama <v.meka@samsung.com>
Mon, 7 Jan 2013 10:40:00 +0000 (19:40 +0900)
committermeka rama <v.meka@samsung.com>
Wed, 9 Jan 2013 01:32:17 +0000 (10:32 +0900)
Change-Id: I8e221a3b33cf0e1282708b2ba10f13a2cdebc0fc
Signed-off-by: meka rama <v.meka@samsung.com>
libexynosutils/exynos5_format_v4l2.c

index fb194e561111f20ffd276d245d5a2d20111220e8..c80622fd9b0911932d2baf3cf0b787134e045529 100644 (file)
@@ -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);
     }