fsCameraEnumerateCameraDefinitions

The fsCameraEnumerateCameraDefinitions function is used to retrieve an array of all the defined camera names.

 

Syntax
bool fsCameraEnumerateCameraDefinitions(
    char** outArrCameraDefinition,
    int* outArrSize
    );

 

Members
Parameters Description
outArrCameraDefinition Pointer to an array of strings storing the names of the Camera Definitions
outArrSize Pointer to an int representing the size of the array.

 

Return Values

The function returns false if it was not possible to send the request, otherwise it will return true. If the request was sent but failed, the specified callback will be invoked with an appropriate error code.

 

Remarks

The function allocates and fills an array of strings (char*) with a size of 256 char each. It is the responsibility of the client to free the memory allocated. The function also fills the outArrSize parameter with the size of the array, however the memory for this parameter must be allocated by the client. See the example sample below:

char* listCamDef  = nullptr;          // Null pointer
int   camDefCount = 0;                // Allocated int
 
if (!fsCameraEnumerateCameraDefinitions(&listCamDef, &camDefCount))
{
    std::cout << "Error with allocation";
    return;
}
 
char* tmpPtr = listCamDef;
for (int i = 0; i < camDefCount; ++i) // Iterate throught the array
{
    std::cout << tmpPtr;
    tmpPtr += 256;                    // Go to the next string (256 char each)
}
 
free(listCamDef);                     // free the memory when it's no longer used

 

Related Topics

  1. WebAssembly
  2. Camera API

0/255