camera_set_video_filesize_limit()

Impose a limit to the recorded file size

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 to 0 to disable any previously imposed file size limit.
prior_warning_seconds
Specifies how many seconds prior to the file limit being reached to issue the warning status event.

Library:

libcamapi

Description:

A 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 the file size limit is reached, the camera will deliver a status event to the application with a value of CAMERA_STATUS_FILESIZE_LIMIT_WARNING. The camera will stop the recording when it is estimated that the recording file size would exceed the file size limit if it would be permitted to continue recording. A status event will be sent to the application with a value of CAMERA_STATUS_FILESIZE_ERROR when this occurs.

Note that you can only call this API 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 the camera_start_viewfinder() or camera_start_video() functions. The status event will also be delivered via any sigevent that you enabled using the camera_enable_status_event() function. For more information, see "Event mode" and "Callback mode" in the Camera Library Developer's Guide

Returns:

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