[libcamera-devel,v2] android: camera_capabilities: Add (1600x1200) and (1280x960) resolutions
diff mbox series

Message ID 20220427151302.607431-1-hanlinchen@chromium.org
State Accepted
Commit f32eb2689bd30b87120f9cc6bfbbc313572ff674
Headers show
Series
  • [libcamera-devel,v2] android: camera_capabilities: Add (1600x1200) and (1280x960) resolutions
Related show

Commit Message

Hanlin Chen April 27, 2022, 3:13 p.m. UTC
Although resolutions (1600x1200) and (1280x960) are not mandatory to be
supported by the Android Camera3 specification, they are commonly used
by Android devices as viewfinder streams for 4:3 still capture.

Add them into stream resolution candidates.

Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/android/camera_capabilities.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
index ee17cdc7..649f84d3 100644
--- a/src/android/camera_capabilities.cpp
+++ b/src/android/camera_capabilities.cpp
@@ -31,13 +31,20 @@  namespace {
 
 /*
  * \var camera3Resolutions
- * \brief The list of image resolutions defined as mandatory to be supported by
- * the Android Camera3 specification
+ * \brief The list of image resolutions commonly supported by Android
+ *
+ * The following are defined as mandatory to be supported by the Android
+ * Camera3 specification: (320x240), (640x480), (1280x720), (1920x1080).
+ *
+ * The following 4:3 resolutions are defined as optional, but commonly
+ * supported by Android devices: (1280x960), (1600x1200).
  */
 const std::vector<Size> camera3Resolutions = {
 	{ 320, 240 },
 	{ 640, 480 },
 	{ 1280, 720 },
+	{ 1280, 960 },
+	{ 1600, 1200 },
 	{ 1920, 1080 }
 };
 
@@ -492,8 +499,8 @@  int CameraCapabilities::initializeStreamConfigurations()
 	/*
 	 * Build the list of supported image resolutions.
 	 *
-	 * The resolutions listed in camera3Resolution are mandatory to be
-	 * supported, up to the camera maximum resolution.
+	 * The resolutions listed in camera3Resolution are supported, up to the
+	 * camera maximum resolution.
 	 *
 	 * Augment the list by adding resolutions calculated from the camera
 	 * maximum one.