aboutsummaryrefslogtreecommitdiffstats
path: root/android/camera/camera-format-converters.c
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2011-09-21 14:58:10 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2011-09-21 15:01:27 -0700
commitddd59b14583126d6282d2fab3142171934981e85 (patch)
treecb51af33fc226d18f49b8a9b2cf5db518dc63aca /android/camera/camera-format-converters.c
parenta8559e023df6c94eee98d90a6689f421873d91f7 (diff)
downloadexternal_qemu-ddd59b14583126d6282d2fab3142171934981e85.zip
external_qemu-ddd59b14583126d6282d2fab3142171934981e85.tar.gz
external_qemu-ddd59b14583126d6282d2fab3142171934981e85.tar.bz2
Fix NV12, and NV21 format descriptors
Also adds support for YU12 pixel format that is used in video frames Change-Id: I613beef8b3e2296fd1fab7e2b9d2956fba1ac788
Diffstat (limited to 'android/camera/camera-format-converters.c')
-rwxr-xr-xandroid/camera/camera-format-converters.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/android/camera/camera-format-converters.c b/android/camera/camera-format-converters.c
index 4dcb424..c675f15 100755
--- a/android/camera/camera-format-converters.c
+++ b/android/camera/camera-format-converters.c
@@ -1238,6 +1238,19 @@ static const YUVDesc _YV12 =
.v_offset = &_VOffSepYUV
};
+/* YU12: 4:2:0, YUV are fully separated, V pane follows U pane */
+static const YUVDesc _YU12 =
+{
+ .Y_offset = 0,
+ .Y_inc = 1,
+ .Y_next_pair = 2,
+ .UV_inc = 1,
+ .U_offset = 1,
+ .V_offset = 0,
+ .u_offset = &_UOffSepYUV,
+ .v_offset = &_VOffSepYUV
+};
+
/* NV12: 4:2:0, UV are interleaved, V follows U in UV pane */
static const YUVDesc _NV12 =
{
@@ -1245,8 +1258,8 @@ static const YUVDesc _NV12 =
.Y_inc = 1,
.Y_next_pair = 2,
.UV_inc = 2,
- .U_offset = 1,
- .V_offset = 0,
+ .U_offset = 0,
+ .V_offset = 1,
.u_offset = &_UOffIntrlUV,
.v_offset = &_VOffIntrlUV
};
@@ -1258,8 +1271,8 @@ static const YUVDesc _NV21 =
.Y_inc = 1,
.Y_next_pair = 2,
.UV_inc = 2,
- .U_offset = 0,
- .V_offset = 1,
+ .U_offset = 1,
+ .V_offset = 0,
.u_offset = &_UOffIntrlUV,
.v_offset = &_VOffIntrlUV
};
@@ -1394,6 +1407,7 @@ static const PIXFormat _PIXFormats[] = {
/* YUV 4:2:0 formats. */
{ V4L2_PIX_FMT_YVU420, PIX_FMT_YUV, .desc.yuv_desc = &_YV12 },
+ { V4L2_PIX_FMT_YUV420, PIX_FMT_YUV, .desc.yuv_desc = &_YU12 },
{ V4L2_PIX_FMT_NV12, PIX_FMT_YUV, .desc.yuv_desc = &_NV12 },
{ V4L2_PIX_FMT_NV21, PIX_FMT_YUV, .desc.yuv_desc = &_NV21 },