API Usage
The following section describes the API workflow.
-
The user is required to instantiate and pass in five arguments:
-
nitoMem
: Pointer to location of memory that a NITO file is loaded into memory.
Note:As mentioned in the section Input Parameter Restrictions earlier, NITO data in other containers (for example, files) must be copied into memory before using this API.
- nitoMemLength: Size of the memory pointed to that holds the NITO file.
- metadataArray: Pointer to a user-instantiated array of the NvSIPLNitoMetadata struct, which will be used to store the metadata retrieved.
- metadataArrayLength: Size of the metadata array, for example, the number of elements the array can hold.
Note:As mentioned in the section Input Parameter Restrictions earlier, this must be greater than or equal to the number of parameter set(s) in the NITO buffer. The API will return an error if the
metadataArray
cannot store all retrieved metadata tuples.- metadataCount: Pointer to a variable to store number of tuples in metadataArray on success.
-
- On success, the function will populate the NvSIPLNitoMetadata struct array
metadataArray
with metadata from each parameter set and update themetadataCount
variable to indicate the number of metadata tuples retrieved.- For printing the parameter set ID and hash values, the user can iterate over each
element of the
metadataArray
usingmetadataCount
and the NITO file constants described in NvSIPLNitoMetadata and Related Constants section.
- For printing the parameter set ID and hash values, the user can iterate over each
element of the
- On failure, an error will be logged stating the possible reason and the corresponding error code.
Sample API usage code is provided in the nvsipl_camera application. In addition, command line arguments have been added to nvsipl_camera to allow users to retrieve metadata from the NITO files loaded by the application, as well as specify the number of parameter sets in the NITO file when necessary.