Updated: October 28, 2024 |
Enable the status event
#include <camera/camera_api.h>
camera_error_t camera_enable_status_event(camera_handle_t handle, camera_eventkey_t *key, struct sigevent *event)
Use this function to enable the status event. The status event is delivered whenever there is additional status information to be reported by the camera. Such status information may include changes in focus state, whether the camera has powered off, or other events detailed by the camera_devstatus_t enumerated type.
After a status event is delivered, you can retrieve specific details using camera_get_status_details(). This is the same status information that is delivered to your status_callback function registered when you called camera_start_viewfinder(), camera_start_encode(), or camera_start_video().
Call camera_enable_status_event() when you are using this framework in event mode. For more information, see Using event mode.
Use camera_disable_event() to disable this event when you no longer require status events to be delivered.
It is not possible to run status callbacks prior to starting the viewfinder, since callback functions are attached using camera_start_viewfinder(). Status events, however, may be enabled at any time after opening the camera.
CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed.