Use correct gralloc flags in V4L2 Camera HAL
Also checks gralloc return results, and cleans up style.
BUG: https://b/31595935, https://b/31589070
TEST: test streaming app works
Change-Id: I4d910524ae21a7b666a1f456e2b7122a8671560f
diff --git a/modules/camera/3_4/camera.cpp b/modules/camera/3_4/camera.cpp
index 7a34af5..60b3eed 100644
--- a/modules/camera/3_4/camera.cpp
+++ b/modules/camera/3_4/camera.cpp
@@ -335,9 +335,9 @@
for (int i = 0; i < count; i++) {
uint32_t usage = 0;
if (streams[i]->isOutputType())
- usage |= GRALLOC_USAGE_HW_CAMERA_WRITE;
+ usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;
if (streams[i]->isInputType())
- usage |= GRALLOC_USAGE_HW_CAMERA_READ;
+ usage |= GRALLOC_USAGE_SW_READ_OFTEN;
streams[i]->setUsage(usage);
uint32_t max_buffers;