camera_roll_open_video()

Updated: October 26, 2022

Create and open the next available video file on the camera roll for writing

Synopsis:

#include <camera/camera_api.h>
camera_error_t camera_roll_open_video(camera_handle_t handle,
                                      int *fd,
                                      char *filename,
                                      int namelen,
                                      camera_roll_video_fmt_t fmt)

Arguments:

handle
The handle returned by a call to the camera_open() function.
fd
A pointer to the returned open file descriptor. This descriptor corresponds to an open video file on the camera roll.
filename
A pointer to the returned name of the camera roll file. Ensure that the buffer pointed to by filename is the same size as specified by namelen.
namelen
The size of the buffer provided by the caller as filename. The recommended size for filenames is defined by CAMERA_ROLL_NAMELEN.
fmt
A camera_roll_video_fmt_t value indicating the type of file to create.

Library:

libcamapi

Description:

The camera roll is a directory on the device where the camera application saves files. The Camera library manages unique filenames on behalf of the application. Use this function to retrieve the next available file from the camera roll. To do so, you require CAMERA_MODE_ROLL access mode when you first call the camera_open() function.

After camera_roll_open_video() successfully returns, a file is created and opened for writing. To close the file, you must call the camera_roll_close_video() function. For information about changing the roll path, see the camera_roll_set_path() function.

Returns:

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