summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Petrov <vppetrov@mm-sol.com>2012-10-04 20:25:33 +0300
committerJason Simmons <jsimmons@google.com>2012-11-07 14:36:33 -0800
commit30f74d865f141304800d9a4a7bf243c66124e165 (patch)
tree2c0e5c56dd2569ffcca25515fead799372d1337b
parent3b13e3f0f4479878f037ab0ef221c6261b75b168 (diff)
downloadomap4-aah-30f74d865f141304800d9a4a7bf243c66124e165.tar.gz
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>
-rw-r--r--test/CameraHal/camera_test_surfacetexture.cpp17
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);