diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2015-03-09 12:15:36 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2015-03-23 19:51:22 -0700 |
commit | 1f29217b2a44bcb105d662eb3872ef38c2d53e27 (patch) | |
tree | 47f2dafbe1b406fe83d7c729fa8a6e7278e4b755 /include | |
parent | 3262e25ff414f787f92c6b569c49ae58298d8907 (diff) | |
download | hardware_libhardware-1f29217b2a44bcb105d662eb3872ef38c2d53e27.zip hardware_libhardware-1f29217b2a44bcb105d662eb3872ef38c2d53e27.tar.gz hardware_libhardware-1f29217b2a44bcb105d662eb3872ef38c2d53e27.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')
-rw-r--r-- | include/hardware/camera3.h | 52 |
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 |