camera_set_device_orientation()
Instruct the camera of the current device orientation.
Synopsis:
#include <camera/camera_api.h>
camera_error_t camera_set_device_orientation(camera_handle_t handle, uint32_t val)
Arguments:
- handle
-
The handle returned by a call to the camera_open() function.
- val
-
The orientation value, such as 0, 90, 180, or 270. 0 represents the default orientation (landscape or portrait), 90 represents rotated to the right, and 180 degrees represents upside down based on the marking on the device.
Library:
libcamapiDescription:
You can specify values such as 0, 90, 180 or 270 degrees, where 0 degrees is the default orientation of the device. It is the responsibility of an application to update the camera when the device orientation changes.
Use this function to let the camera on the system know how the user is holding the device. This allows the camera to adjust internal settings, such as exposure weighting, face detection, or other orientation-dependent features to match the orientation of the device. If the CAMERA_IMGPROP_METAORIENTATIONHINT property is enabled for photo output, then the EXIF orientation hint will be computed using a combination of the orientation set using this function as well as the rotation angle indicated by CAMERA_IMGPROP_ROTATION.
This function has no effect on the output image rotations. It is simply used to inform the camera hardware that the orientation of the scene has changed in order to optimize internal algorithms, such as metering and face detection.
Returns:
CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed.