camera_find_capable()

Updated: April 19, 2023

Find the cameras that have the specified features

Synopsis:

#include <camera/camera_api.h>
camera_error_t camera_find_capable(camera_feature_t *features,
                                   int nfeatures,
                                   camera_unit_t prevunit,
                                   camera_unit_t *nextunit)

Arguments:

features
A pointer to a camera_feature_t array that lists the required camera features.
nfeatures
The number of features specified in the first argument.
prevunit
The previous unit returned, or CAMERA_UNIT_NONE if this is the first call to this function.
nextunit
A pointer to a camera_unit_t value where the function returns the next unit which supports all requested features.

Library:

libcamapi

Description:

Use this function to find cameras with the features required for your application. For example, you can find cameras that have a flash or that support video recording.

This function allows you to iterate through a list of cameras. To start doing so, set the prevunit argument to CAMERA_UNIT_NONE. The function then returns the first camera found that supports the set of features defined by features. The matching camera unit is returned in the nextunit argument. To continue iterating through the list, call this function again and set prevunit to the value previously returned by nextunit. In this way, the function always searches the list using prevunit as the starting point. When the end of the list is reached, nextunit returns a value of CAMERA_UNIT_NONE.

Returns:

CAMERA_EOK when the function successfully completes. CAMERA_ENODEV indicates that the end of list was reached.