The status of the camera device
#include <camera/camera_api.h>
typedef enum { CAMERA_STATUS_UNKNOWN = 0, CAMERA_STATUS_DISCONNECTED, CAMERA_STATUS_CONNECTED, CAMERA_STATUS_POWERDOWN, CAMERA_STATUS_VIDEOVF, CAMERA_STATUS_MM_ERROR, CAMERA_STATUS_FILESIZE_ERROR, CAMERA_STATUS_NOSPACE_ERROR, CAMERA_STATUS_CAPTURE_ABORTED, CAMERA_STATUS_FILESIZE_WARNING, CAMERA_STATUS_FOCUS_CHANGE, CAMERA_STATUS_RESOURCENOTAVAIL, CAMERA_STATUS_VIDEO_PAUSE, CAMERA_STATUS_VIDEO_RESUME, CAMERA_STATUS_CAPTURECOMPLETE, CAMERA_STATUS_POWERUP, CAMERA_STATUS_VIEWFINDER_FREEZE, CAMERA_STATUS_VIEWFINDER_UNFREEZE, CAMERA_STATUS_LOWLIGHT, CAMERA_STATUS_FRAME_DROPPED, CAMERA_STATUS_VIEWFINDER_SUSPEND, CAMERA_STATUS_VIEWFINDER_UNSUSPEND, CAMERA_STATUS_FILESIZE_LIMIT_WARNING, CAMERA_STATUS_VIEWFINDER_ACTIVE, CAMERA_STATUS_BUFFER_UNDERFLOW, CAMERA_STATUS_VIEWFINDER_ERROR } camera_devstatus_t;
This is typical when the device is going into a standby state. The extra uint16_t value can be interpreted as follows:
Recordings will stop with this error when the size is getting too close to the limit.
The default is 60 seconds, but you can change the time-remaining threshold using the camera_set_video_filesize_warning() function.
The extra uint16_t value can be interpreted as follows:
You can call the camera_get_focus_state() function to retrieve further details, including the focus region co-ordinates.
You should release camera resources by returning buffers, stopping recordings, and stopping viewfinders. This event happens when the device is about to enter standby mode or a higher-priority process needs access to resources that are shared with the camera. The extra uint16_t value can be interpreted as follows:
For more important information related to the triggering of this status event, see "Resource management" in the Camera Library Developer's Guide and the camera_register_resource() function.
This pause is due to resources needed for video encoding not being currently available (needed elsewhere). Once resources are available again, CAMERA_STATUS_VIDEO_RESUME status change will be sent. While encoding is in this paused state, there will be a gap in the video file. Your application may choose to stop video encoding when this status event is received.
This status typically occurs when the device returns from the standby (i.e., CAMERA_STATUS_POWERDOWN) state.
When the viewfinder is frozen, the same frame is continually sent until the CAMERA_STATUS_VIEWFINDER_UNFREEZE status is sent.
This status can only be received after the CAMERA_STATUS_VIEWFINDER_FREEZE status has been received previously.
The least significant bit of the uint16_t value will be 1 when low-light is detected, and 0 when low-light is not detected. All other bits in the uint16_t value are for internal use only. Do not use.
The uint16_t extra argument contains the least significant bits of the camera_eventkey_t associated with the buffer queue that overflowed.
No frames will be delivered while the viewfinder is suspended.
This status will only be received after the CAMERA_STATUS_VIEWFINDER_SUSPEND status has been received previously.
This status event is generated after the user has called camera_set_video_filesize_limit() to set a non-zero file size limit and that it was determined that the file size limit will be reached in the configured warning time.
This is sent initially after entering CAMERA_STATUS_VIDEOVF to indicate that we have received our first viewfinder buffer. This is also sent after we recover from an error such as CAMERA_STATUS_BUFFER_UNDERFLOW or CAMERA_STATUS_VIEWFINDER_ERROR to indicate that streaming is back to working as expected.
Once recovered, a CAMERA_STATUS_VIEWFINDER_ACTIVE indication will be given. This will typically occur if a user is holding on to more buffers than what is specified in the number of user buffer configuration.
Once recovered, a CAMERA_STATUS_VIEWFINDER_ACTIVE indication will be given.
These values are delivered to your status callback functions or via the camera_get_status_details() function whenever the state of the camera changes.
Status changes may also convey additional information as a uint16_t value where indicated.