Updated: October 28, 2024 |
Find the cameras that have the specified features
#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)
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.
CAMERA_EOK when the function successfully completes. CAMERA_ENODEV indicates that the end of list was reached.