camera_set_video_filesize_limit()

Updated: April 19, 2023

Impose a limit to the size of the recording file

Synopsis:

#include <camera/camera_api.h>
camera_error_t camera_set_video_filesize_limit(camera_handle_t handle,
                                               uint64_t size_limit,
                                               uint32_t prior_warning_seconds)

Arguments:

handle
The handle returned by a call to the camera_open() function.
size_limit
The file size limit to impose, in bytes. Set this to 0 to disable any previous file size limit.
prior_warning_seconds
The number of seconds prior to the size limit being reached to issue a warning status event.

Library:

libcamapi

Description:

A file size limit can be imposed on any video recording that was started using camera_start_video(). When there is less than a programmed number of seconds before this size limit will be reached, the camera will deliver a CAMERA_STATUS_FILESIZE_LIMIT_WARNING status event to the application. The camera will stop the recording when it estimates that the recording file size would exceed the limit if it were permitted to keep recording. A CAMERA_STATUS_FILESIZE_ERROR status event will be sent to the application when this occurs.

Note:

You can call this function only when an active recording created by calling camera_start_video() is still active.

The status event is delivered to any status callback functions registered when you called camera_start_viewfinder() or camera_start_video(). It is also delivered via any sigevent enabled by camera_enable_status_event(). For more details, see Using event mode and Using callback mode.

Returns:

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