summaryrefslogtreecommitdiffstats
path: root/include/hardware/camera3.h
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2015-03-09 12:15:36 -0700
committerYin-Chia Yeh <yinchiayeh@google.com>2015-03-12 13:34:42 -0700
commite0042080252c94588c725b617a2fe6b48672c724 (patch)
treea740274125f1f425acff95f4b530262e3f6f1dcf /include/hardware/camera3.h
parent8e4b0cfac85a8d71f919571086cdc71f9e373c83 (diff)
downloadhardware_libhardware-e0042080252c94588c725b617a2fe6b48672c724.zip
hardware_libhardware-e0042080252c94588c725b617a2fe6b48672c724.tar.gz
hardware_libhardware-e0042080252c94588c725b617a2fe6b48672c724.tar.bz2
Camera3: Add rotation field to camera3_stream_t
This allows application or framework request HAL to perform a rotation of 0, 90, 180 or 270 degrees counterclockwise. Currently there is no plan to support arbitrary rotation angles. HAL should return -EINVAL if the requested rotation cannot be supported. Change-Id: I8bde2bcfd797c408db4d5b391b170a4e856ec2d0
Diffstat (limited to 'include/hardware/camera3.h')
-rw-r--r--include/hardware/camera3.h52
1 files changed, 50 insertions, 2 deletions
diff --git a/include/hardware/camera3.h b/include/hardware/camera3.h
index 2c47ef6..284c78b 100644
--- a/include/hardware/camera3.h
+++ b/include/hardware/camera3.h
@@ -129,10 +129,12 @@
*
* - OPAQUE and YUV reprocessing API updates.
*
- * - Basic support for depth output buffers
+ * - Basic support for depth output buffers.
*
* - Addition of data_space field to camera3_stream_t.
*
+ * - Addition of rotation field to camera3_stream_t.
+ *
*/
/**
@@ -1370,6 +1372,25 @@ typedef enum camera3_stream_type {
} camera3_stream_type_t;
/**
+ * camera3_stream_rotation_t:
+ *
+ * The required counterclockwise rotation of camera stream.
+ */
+typedef enum camera3_stream_rotation {
+ /* No rotation */
+ CAMERA3_STREAM_ROTATION_0 = 0,
+
+ /* Rotate by 90 degree counterclockwise */
+ CAMERA3_STREAM_ROTATION_90 = 1,
+
+ /* Rotate by 180 degree counterclockwise */
+ CAMERA3_STREAM_ROTATION_180 = 2,
+
+ /* Rotate by 270 degree counterclockwise */
+ CAMERA3_STREAM_ROTATION_270 = 3
+} camera3_stream_rotation_t;
+
+/**
* camera3_stream_t:
*
* A handle to a single camera input or output stream. A stream is defined by
@@ -1513,8 +1534,32 @@ typedef struct camera3_stream {
*/
android_dataspace_t data_space;
+ /**
+ * The required output rotation of the stream, one of
+ * the camera3_stream_rotation_t values. This must be inspected by HAL along
+ * with stream width and height. For example, if the rotation is 90 degree
+ * and the stream width and height is 720 and 1280 respectively, camera service
+ * will supply buffers of size 720x1280, and HAL should capture a 1280x720 image
+ * and rotate the image by 90 degree counterclockwise.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Not defined and must not be accessed. HAL must not apply any rotation
+ * on output images.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_3:
+ *
+ * Always set by camera service. HAL must inspect this field during stream
+ * configuration and returns -EINVAL if HAL cannot perform such rotation.
+ * HAL must always support CAMERA3_STREAM_ROTATION_0, so a
+ * configure_streams() call must not fail for unsupported rotation if
+ * rotation field of all streams is CAMERA3_STREAM_ROTATION_0.
+ *
+ */
+ int rotation;
+
/* reserved for future use */
- void *reserved[8];
+ void *reserved[7];
} camera3_stream_t;
@@ -2570,6 +2615,9 @@ typedef struct camera3_device_ops {
*
* - Including too many output streams of a certain format.
*
+ * - Unsupported rotation configuration (only applies to
+ * devices with version >= CAMERA_DEVICE_API_VERSION_3_3)
+ *
* Note that the framework submitting an invalid stream
* configuration is not normal operation, since stream
* configurations are checked before configure. An invalid