Support native camera resolutions
This CL makes camera HAL support native camera resoultions up to
3280x2464, which is the maximum camera resolution of RPi3's camera
module version two.
Bug: 69983703
Test: Verified with ThingsCameraQA.apk
Exempt-From-Owner-Approval: V4L2 camera HAL is owned by iot team.
Change-Id: I303e763e87bdfc5ae81d398aac8be0730e57b05d
diff --git a/modules/camera/3_4/v4l2_wrapper.cpp b/modules/camera/3_4/v4l2_wrapper.cpp
index b5a1c71..36d0411 100644
--- a/modules/camera/3_4/v4l2_wrapper.cpp
+++ b/modules/camera/3_4/v4l2_wrapper.cpp
@@ -35,7 +35,19 @@
namespace v4l2_camera_hal {
-const int32_t kStandardSizes[][2] = {{640, 480}, {320, 240}};
+const int32_t kStandardSizes[][2] = {
+ {4096, 2160}, // 4KDCI (for USB camera)
+ {3840, 2160}, // 4KUHD (for USB camera)
+ {3280, 2464}, // 8MP
+ {2560, 1440}, // QHD
+ {1920, 1080}, // HD1080
+ {1640, 1232}, // 2MP
+ {1280, 720}, // HD
+ {1024, 768}, // XGA
+ { 640, 480}, // VGA
+ { 320, 240}, // QVGA
+ { 176, 144} // QCIF
+};
V4L2Wrapper* V4L2Wrapper::NewV4L2Wrapper(const std::string device_path) {
std::unique_ptr<V4L2Gralloc> gralloc(V4L2Gralloc::NewV4L2Gralloc());
@@ -364,7 +376,7 @@
desired_height,
v4l2_format);
continue;
- } else if (desired_width > size_query.stepwise.max_width &&
+ } else if (desired_width > size_query.stepwise.max_width ||
desired_height > size_query.stepwise.max_height) {
HAL_LOGV("Standard size %u x %u is too big for format %d",
desired_width,