diff options
author | Vladimir Petrov <vppetrov@mm-sol.com> | 2012-10-04 20:25:33 +0300 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-11-26 20:09:17 +0200 |
commit | b10ee605cdfa5fd96c7bfeea7d0b3c702525185c (patch) | |
tree | e57d897013f6edf63474ca38ae79d653608e596c /test/CameraHal | |
parent | 0d85ffa021927c1214c6d739a9bef7d6bda5789f (diff) | |
download | hardware_ti_omap4-b10ee605cdfa5fd96c7bfeea7d0b3c702525185c.zip hardware_ti_omap4-b10ee605cdfa5fd96c7bfeea7d0b3c702525185c.tar.gz hardware_ti_omap4-b10ee605cdfa5fd96c7bfeea7d0b3c702525185c.tar.bz2 |
Camera_test: Bayer reprocessing fixes
- 'pixformat' inside 'setInput()' was not
correctly initialized. It has to hold the
pixelformat of the incoming buffer.
- Bayer buffers should not be aligned.
- Updates the copying of the incoming Bayer
buffers.
Change-Id: I5e47daa7f783158bb60d756d08fe121078970ead
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
Diffstat (limited to 'test/CameraHal')
-rw-r--r-- | test/CameraHal/camera_test_surfacetexture.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/CameraHal/camera_test_surfacetexture.cpp b/test/CameraHal/camera_test_surfacetexture.cpp index 2b87b36..75912a0 100644 --- a/test/CameraHal/camera_test_surfacetexture.cpp +++ b/test/CameraHal/camera_test_surfacetexture.cpp @@ -707,7 +707,15 @@ void BufferSourceInput::setInput(buffer_info_t bufinfo, const char *format, Shot size_t tapInMinUndequeued = 0; int aligned_width, aligned_height; - aligned_width = ALIGN_UP(bufinfo.crop.right - bufinfo.crop.left, ALIGN_WIDTH); + + pixformat = bufinfo.format; + + // Aligning is not needed for Bayer + if ( pixformat == HAL_PIXEL_FORMAT_TI_Y16 ) { + aligned_width = bufinfo.crop.right - bufinfo.crop.left; + } else { + aligned_width = ALIGN_UP(bufinfo.crop.right - bufinfo.crop.left, ALIGN_WIDTH); + } aligned_height = bufinfo.crop.bottom - bufinfo.crop.top; printf("aligned width: %d height: %d \n", aligned_width, aligned_height); @@ -715,10 +723,6 @@ void BufferSourceInput::setInput(buffer_info_t bufinfo, const char *format, Shot return; } - if ( NULL != format ) { - pixformat = getHalPixFormat(format); - } - native_window_set_usage(mWindowTapIn.get(), getUsageFromANW(pixformat)); mWindowTapIn->perform(mWindowTapIn.get(), @@ -732,7 +736,8 @@ void BufferSourceInput::setInput(buffer_info_t bufinfo, const char *format, Shot // queue the buffer directly to tapin surface. if the dimensions are different // then the aligned ones, then we have to copy the buffer into our own buffer // to make sure the stride of the buffer is correct - if ((aligned_width != bufinfo.width) || (aligned_height != bufinfo.height)) { + if ((aligned_width != bufinfo.width) || (aligned_height != bufinfo.height) || + (pixformat == HAL_PIXEL_FORMAT_TI_Y16)) { void *dest[3] = { 0 }; void *src[3] = { 0 }; Rect bounds(aligned_width, aligned_height); |