summaryrefslogtreecommitdiffstats
path: root/include/camera
diff options
context:
space:
mode:
Diffstat (limited to 'include/camera')
-rw-r--r--include/camera/Camera.h14
-rw-r--r--include/camera/CameraHardwareInterface.h4
-rw-r--r--include/camera/CameraParameters.h27
3 files changed, 28 insertions, 17 deletions
diff --git a/include/camera/Camera.h b/include/camera/Camera.h
index 8d8edd6..c7f0b15 100644
--- a/include/camera/Camera.h
+++ b/include/camera/Camera.h
@@ -111,8 +111,8 @@ enum {
};
enum {
- CAMERA_FACING_BACK = 0,
- CAMERA_FACING_FRONT = 1 /* The camera faces to the user */
+ CAMERA_FACING_BACK = 0, /* The facing of the camera is opposite to that of the screen. */
+ CAMERA_FACING_FRONT = 1 /* The facing of the camera is the same as that of the screen. */
};
struct CameraInfo {
@@ -128,10 +128,12 @@ struct CameraInfo {
* camera image needs to be rotated clockwise so it shows correctly on
* the display in its natural orientation. It should be 0, 90, 180, or 270.
*
- * For example, suppose a device has a naturally tall screen, but the camera
- * sensor is mounted in landscape. If the top side of the camera sensor is
- * aligned with the right edge of the display in natural orientation, the
- * value should be 90.
+ * For example, suppose a device has a naturally tall screen. The
+ * back-facing camera sensor is mounted in landscape. You are looking at
+ * the screen. If the top side of the camera sensor is aligned with the
+ * right edge of the screen in natural orientation, the value should be
+ * 90. If the top side of a front-facing camera sensor is aligned with
+ * the right of the screen, the value should be 270.
*/
int orientation;
};
diff --git a/include/camera/CameraHardwareInterface.h b/include/camera/CameraHardwareInterface.h
index 5465441..16f572c 100644
--- a/include/camera/CameraHardwareInterface.h
+++ b/include/camera/CameraHardwareInterface.h
@@ -269,7 +269,9 @@ public:
*/
virtual status_t cancelPicture() = 0;
- /** Set the camera parameters. */
+ /**
+ * Set the camera parameters. This returns BAD_VALUE if any parameter is
+ * invalid or not supported. */
virtual status_t setParameters(const CameraParameters& params) = 0;
/** Return the camera parameters. */
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index 60031a4..6364d58 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -163,16 +163,23 @@ public:
// the best.
// Example value: "90". Read/write.
static const char KEY_JPEG_QUALITY[];
- // The orientation of the device in degrees. For example, suppose the
- // natural position of the device is landscape. If the user takes a picture
- // in landscape mode in 2048x1536 resolution, the rotation will be set to
- // "0". If the user rotates the phone 90 degrees clockwise, the rotation
- // should be set to "90".
- // The camera driver can set orientation in the EXIF header without rotating
- // the picture. Or the driver can rotate the picture and the EXIF thumbnail.
- // If the Jpeg picture is rotated, the orientation in the EXIF header should
- // be missing or 1 (row #0 is top and column #0 is left side). The driver
- // should not set default value for this parameter.
+ // The rotation angle in degrees relative to the orientation of the camera.
+ // This affects the pictures returned from CAMERA_MSG_COMPRESSED_IMAGE. The
+ // camera driver may set orientation in the EXIF header without rotating the
+ // picture. Or the driver may rotate the picture and the EXIF thumbnail. If
+ // the Jpeg picture is rotated, the orientation in the EXIF header will be
+ // missing or 1 (row #0 is top and column #0 is left side).
+ //
+ // Note that the JPEG pictures of front-facing cameras are not mirrored
+ // as in preview display.
+ //
+ // For example, suppose the natural orientation of the device is portrait.
+ // The device is rotated 270 degrees clockwise, so the device orientation is
+ // 270. Suppose a back-facing camera sensor is mounted in landscape and the
+ // top side of the camera sensor is aligned with the right edge of the
+ // display in natural orientation. So the camera orientation is 90. The
+ // rotation should be set to 0 (270 + 90).
+ //
// Example value: "0" or "90" or "180" or "270". Write only.
static const char KEY_ROTATION[];
// GPS latitude coordinate. GPSLatitude and GPSLatitudeRef will be stored in