camera_enable_status_event()

Updated: May 06, 2022

Enable the status event

Synopsis:

#include <camera/camera_api.h>
camera_error_t camera_enable_status_event(camera_handle_t handle,
                                          camera_eventkey_t *key,
                                          struct sigevent *event)

Arguments:

handle
The handle returned by a call to the camera_open() function.
key
A pointer to a returned camera_eventkey_t value. This argument is required for subsequent function calls to identify the proper event.
event
A pointer to a struct sigevent that must be initialized by the caller. This is the struct sigevent that will be delivered when a status change occurs. You can then retrieve the status details using camera_get_status_details().

Library:

libcamapi

Description:

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.

Note:

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.

Returns:

CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed.