camera_enable_video_event()

Updated: October 26, 2022

Enable the video event

Synopsis:

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

Arguments:

handle
The handle returned by a call to the camera_open() function.
eventmode
The event buffering mode as a camera_eventmode_t value.
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 video frame is available to retrieve using camera_get_video_buffers().

Library:

libcamapi

Description:

Use this function to enable the video event. The video event is delivered when an uncompressed video frame is available. You can then retrieve the video frame using camera_get_video_buffers(). This is the same image data that is delivered to your video_callback function registered when you started video encoding using camera_start_video() or camera_start_encode().

Note:

On platforms that advertise the CAMERA_FEATURE_PREVIEWISVIDEO feature, video frames will be identical to viewfinder frames.

Call camera_enable_video_event() when you are using the Camera API in event mode. For more information, see Using event mode.

Use camera_disable_event() to disable this event when you no longer require video events to be delivered.

Returns:

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