camera_open()

Updated: April 19, 2023

Request a handle to access a logical camera unit

Synopsis:

#include <camera/camera_api.h>
camera_error_t camera_open(camera_unit_t unit,
                           uint32_t mode,
                           camera_handle_t *handle)

Arguments:

unit
The logical camera unit to open (see camera_unit_t).
mode
The access mode of the camera, which is comprised of the Camera access mode flags ORed together.
handle
A pointer to the returned camera handle if access is granted.

Library:

libcamapi

Description:

If the camera is available, a handle for access to the camera unit is returned. You must pass in a pointer to a camera_handle_t to store the handle. You must also have access permissions to use the camera.

Note:

There is a limit on the number of handles that can be opened on a given logical camera unit. If this limit would be exceeded, this function will fail and return CAMERA_EAGAIN. There is also a limit on the number of handles that an application using this library can have open. If this limit would be exceeded, this function will fail and return CAMERA_EMFILE. There is also a limit of only one handle that can be opened on a given logical camera unit with CAMERA_MODE_PWRITE. If this limit would be exceeded, this function will fail and return CAMERA_EBUSY.

Returns:

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