NativeBindings
Inherits from:
MagicLeapNativeBindings
Public Methods
MLResult.Code MLDepthCameraConnect
Connect to depth camera.
public MLResult.Code MLDepthCameraConnect(
in MLDepthCameraSettings settings,
out ulong handle
)
Parameters
Type | Name | Description |
---|---|---|
in MLDepthCameraSettings | settings | A pointer to MLDepthCameraSettings structure. |
out ulong | handle | A pointer to camera handle to be used in later APIs. |
Details*
apilevel: 29
permissions: com.magicleap.permission.DEPTH_CAMERA (protection level: dangerous)
Returns: MLResult_InvalidParam : One of the parameters is invalid.
MLResult_LicenseError : Necessary license is missing.
MLResult_Ok : Connected to camera device(s) successfully.
MLResult_PermissionDenied : Necessary permission is missing.
MLResult_UnspecifiedFailure : The operation failed with an unspecified error.
MLResult.Code MLDepthCameraDisconnect
Disconnect from depth camera. This will disconnect from the depth camera.
public MLResult.Code MLDepthCameraDisconnect(
ulong handle
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Camera handle obtained from MLDepthCameraConnect. |
Details*
apilevel: 29
permissions: None
Returns: MLResult_InvalidParam : Invalid handle.
MLResult_Ok : Disconnected camera successfully.
MLResult_UnspecifiedFailure : Failed to disconnect camera.
MLResult.Code MLDepthCameraGetCapabilities
Query the depth camera stream capabilities. Retrieves the capabilities supported by the depth camera based on the provided filter. After each call, a corresponding call to MLDepthCameraReleaseCapabilities should be made to release allocated resources.
public MLResult.Code MLDepthCameraGetCapabilities(
ulong handle,
ref MLDepthCameraCapabilityFilter filter,
out MLDepthCameraCapabilityList outCaps
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Camera handle obtained from MLDepthCameraConnect. |
ref MLDepthCameraCapabilityFilter | filter | Pointer to initialized MLDepthCameraCapabilityFilter structure. Used for filtering. |
out MLDepthCameraCapabilityList | outCaps | Pointer to initialized MLDepthCameraCapabilityList structure. |
Details*
apilevel: 29
permissions: None
Returns: MLResult_InvalidParam : One of the parameters is invalid.
MLResult_Ok : API call completed successfully.
MLResult.Code MLDepthCameraGetLatestDepthData
Poll for Frames. Returns MLDepthCameraData with this latest data when available. The memory is owned by the system. Application should copy the data it needs to cache it and then release the memory by calling MLDepthCameraReleaseCameraData. This is a blocking call. API is not thread safe. If there are no new depth data frames within the timeoutMs duration then the API will return MLResult_Timeout.
public MLResult.Code MLDepthCameraGetLatestDepthData(
ulong handle,
ulong timeoutMs,
out MLDepthCameraData data
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Camera handle obtained from MLDepthCameraConnect. |
ulong | timeoutMs | Timeout in milliseconds. |
out MLDepthCameraData | data | Depth camera data. Should be an initialized MLDepthCameraData object. |
Details*
apilevel: 29
permissions: None
Returns: MLResult_InvalidParam : Invalid handle.
MLResult_Ok : Depth camera data fetched successfully.
MLResult_Timeout : Returned because no new frame available at this time.
MLResult_UnspecifiedFailure : Failed due to internal error.
MLResult.Code MLDepthCameraReleaseCapabilities
Release resources allocated with MLDepthCameraGetCapabilities.
public MLResult.Code MLDepthCameraReleaseCapabilities(
ulong handle,
ref MLDepthCameraCapabilityList outCaps
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Camera handle obtained from MLDepthCameraConnect. |
ref MLDepthCameraCapabilityList | outCaps | Pointer to MLDepthCameraCapabilityList filled by the call to MLDepthCameraGetCapabilities. |
Details*
apilevel: 29
permissions: None
Returns: MLResult_InvalidParam : One of the parameters is invalid.
MLResult_Ok : API call completed successfully.
MLResult.Code MLDepthCameraReleaseDepthData
Releases specified MLDepthCameraData object. This function should be called exactly once for each successfull call to MLDepthCameraGetLatestCameraData.
public MLResult.Code MLDepthCameraReleaseDepthData(
ulong handle,
ref MLDepthCameraData data
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Camera handle obtained from MLDepthCameraConnect. |
ref MLDepthCameraData | data | Pointer to a valid MLDepthCameraData object. |
Details*
apilevel: 29
permissions: None
Returns: MLResult_Ok : Successfully released depth camera data.
MLResult_InvalidParam : data parameter was not valid (null).
MLResult_UnspecifiedFailure : Failed due to internal error.
MLResult.Code MLDepthCameraUpdateSettings
Update the depth camera settings.
public MLResult.Code MLDepthCameraUpdateSettings(
ulong handle,
in MLDepthCameraSettings settings
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Camera handle obtained from MLDepthCameraConnect. |
in MLDepthCameraSettings | settings | Pointer to MLDepthCameraSettings. |
Details*
apilevel: 29
permissions: None
Returns: MLResult_InvalidParam : Invalid handle.
MLResult_Ok : Settings updated successfully.
MLResult_UnspecifiedFailure : Failed due to internal error.