camera_set_video_filesize_warning()

Configure the threshold of recording time (in seconds) left on the device before a warning is issued.

Synopsis:

#include <camera/camera_api.h>
 
camera_error_t camera_set_video_filesize_warning(camera_handle_t handle, uint16_t seconds_remaining)

Arguments:

handle

The handle returned by a call to the camera_open() function.

seconds_remaining

The desired threshold (in seconds) before the status call function is called when the amount of time is less than the value specified by this argument.

Library:

libcamapi

Description:

The device has a recording capacity measured in bytes, which can also be expressed as a number of seconds depending on the encoding bit-rate. The recording capacity is indicated as seconds of recording time, which is a reflection of the amount of time left to record the video. While encoding, there is a continual estimation of the how many seconds of recording time remains before the storage device is full.

The camera service invokes the status_callback with status set to CAMERA_STATUS_FILESIZE_WARNING whenever the amount of time left to record video is less than the value set in the seconds_remaining argument. The status_callback is the callback function set when you call the camera_start_photo_viewfinder() or camera_start_video_viewfinder() functions.

The time remaining that is calculated is an estimate based on the encoder's past performance and is subject to jitter. For this reason, the calculated time remaining may not be perfectly accurate.

Typically, an application would set this to five minutes (or 3000 seconds). Once that threshold is crossed, an application would indicate a low-space warning. You can decide to adjust the threshold lower to receive additional warnings as the recording time approaches zero. For example, you could move the threshold to one minute (60 seconds) for the next warning.

Returns:

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