Retrieve a list of the cameras available on the device


#include <camera/camera_api.h>
camera_error_t camera_get_supported_cameras(unsigned int numasked,
                                            unsigned int *numsupported,
                                            camera_unit_t *cameras)


The requested number of camera units to return in the array.
A pointer to the number of camera units that you have access to. The argument is updated when the function completes successfully.
A pointer to a camera_unit_t array. The array is updated with the cameras that you have access to when the function completes successfully.




This function writes an enumerated list of available camera units into the cameras argument.

Ensure that the cameras argument points to an array which has at least numasked elements allocated. To determine an appropriate size for this array, you can invoke this function in presizing mode by setting the numasked argument to 0 or the cameras argument to NULL. The function then returns, in the numsupported argument, the maximum array size required. You can then allocate an array of this size, store its address in cameras, and invoke the function again with numasked set to that previous numsupported value.


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