ml_camera_v2.h
Classes
Name | |
---|---|
struct | MLCameraMRConnectInfo |
struct | MLCameraConnectContext |
struct | MLCameraCaptureStreamCaps A structure to encapsulate stream capabilities. |
struct | MLCameraCaptureStreamConfig |
struct | MLCameraCaptureConfig |
struct | MLCameraPlaneInfo |
struct | MLCameraOutput |
struct | MLCameraIntrinsicCalibrationParameters Camera intrinsic parameter. |
struct | MLCameraResultExtras |
struct | MLCameraDeviceAvailabilityInfo |
struct | MLCameraDeviceAvailabilityStatusCallbacks |
struct | MLCameraDeviceStatusCallbacks |
struct | MLCameraCaptureCallbacks Capture callbacks to be implemented by client to receive capture status if callback mechanism is used. |
Types
Enums
Functions
Name | |
---|---|
void | MLCameraConnectContextInit(MLCameraConnectContext * inout_context) Initialize the connect context structure. |
void | MLCameraCaptureConfigInit(MLCameraCaptureConfig * inout_config) Initialize the capture config structure. |
void | MLCameraDeviceAvailabilityStatusCallbacksInit(MLCameraDeviceAvailabilityStatusCallbacks * inout_device_availability_status_callbacks) Initialize the callback structure. |
void | MLCameraDeviceStatusCallbacksInit(MLCameraDeviceStatusCallbacks * inout_device_status_callbacks) Initialize the callback structure. |
void | MLCameraCaptureCallbacksInit(MLCameraCaptureCallbacks * inout_capture_callbacks) Initialize the callback structure. |
MLResult | MLCameraInit(const MLCameraDeviceAvailabilityStatusCallbacks device_availability_status_callbacks, void user_data) Initialize ML Camera API, Register callback for device availability. If the user does not want to register device availability listener, MLCameraConnect can be called directly without MLCameraInit(). MLCameraDeInit should be used for unregistering callbacks and releasing resources acquired in MLCameraInit(). |
MLResult | MLCameraConnect(const MLCameraConnectContext input_context, MLCameraContext out_context) Connect to camera device. |
MLResult | MLCameraGetNumSupportedStreams(MLCameraContext context, uint32_t * out_num_supported_streams) Query the no of streams supported by camera device. |
MLResult | MLCameraGetStreamCaps(MLCameraContext context, const uint32_t stream_index, uint32_t inout_num_stream_caps, MLCameraCaptureStreamCaps inout_stream_caps) Query the stream capabilities. |
MLResult | MLCameraDisconnect(MLCameraContext context) Disconnect from camera device. |
MLResult | MLCameraDeInit() Uninitialize ML Camera API, unregister callback for device availability. Should be called after all camera devices are disconnected. After MLCameraDeInit, MLCameraInit can be called or MLCameraConnect can be called. |
MLResult | MLCameraPreCaptureAEAWB(MLCameraContext context) Trigger AEAWB Convergence. |
MLResult | MLCameraPrepareCapture(MLCameraContext context, const MLCameraCaptureConfig config, MLHandle out_request_handle) Prepare for capture. |
MLResult | MLCameraUpdateCaptureSettings(MLCameraContext context) Update capture setting. |
MLResult | MLCameraSetDeviceStatusCallbacks(MLCameraContext context, const MLCameraDeviceStatusCallbacks device_status_callbacks, void data) Set the client-implemented callbacks to convey camera device status. |
MLResult | MLCameraSetCaptureCallbacks(MLCameraContext context, const MLCameraCaptureCallbacks capture_callbacks, void data) Set the client-implemented callbacks to convey capture status. |
MLResult | MLCameraCaptureImage(MLCameraContext context, uint32_t num_images) Capture still image. |
MLResult | MLCameraCaptureVideoStart(MLCameraContext context) Start video capture. Capture either encoded video or YUV/RGBA frames. |
MLResult | MLCameraCapturePreviewStart(MLCameraContext context) Start preview provide raw frames through callback. |
MLResult | MLCameraCaptureVideoStop(MLCameraContext context) Stop video capture. |
MLResult | MLCameraCapturePreviewStop(MLCameraContext context) Stop preview. |
MLResult | MLCameraGetDeviceStatus(MLCameraContext context, uint32_t * out_device_status) Poll camera device status. |
MLResult | MLCameraGetDeviceAvailabilityStatus(MLCameraIdentifier cam_id, bool * out_device_availability_status) Poll camera device availability status. |
MLResult | MLCameraGetErrorCode(MLCameraContext context, MLCameraError * out_error_code) Obtain camera device error code. |
MLResult | MLCameraGetCameraCharacteristics(MLCameraContext context, MLHandle * out_characteristics_handle) Obtains handle for retrieving camera characteristics. |
Enums Documentation
Anonymous Enum 4
Enumerator | Value | Description |
---|---|---|
MLCAMERA_MAXSTREAMS | 2 | Max No of streams supported by logical camera. |
MLCameraIdentifier
Enumerator | Value | Description |
---|---|---|
MLCameraIdentifier_MAIN | 0 | x86 logical camera. |
MLCameraIdentifier_CV | CV logical camera. | |
MLCameraIdentifier_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Logical camera identifiers available for access.
MLCameraCaptureType
Enumerator | Value | Description |
---|---|---|
MLCameraCaptureType_Image | 0 | To capture an image. |
MLCameraCaptureType_Video | To capture a video. | |
MLCameraCaptureType_Preview | To capture a video and access the raw buffer of the frames. | |
MLCameraCaptureType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Captures operation type.
MLCameraCaptureFrameRate
Enumerator | Value | Description |
---|---|---|
MLCameraCaptureFrameRate_None | 0 | None, used for still capture. |
MLCameraCaptureFrameRate_15FPS | Specified 15FPS. | |
MLCameraCaptureFrameRate_30FPS | Specified 30FPS. | |
MLCameraCaptureFrameRate_60FPS | Specified 60FPS. | |
MLCameraCaptureFrameRate_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Captures frame rate.
Call MLCameraPrepareCapture() to configure frame rate. Use MLCameraCaptureFrameRate_None when configuring only Image capture. Use MLCameraCaptureFrameRate_60fps only when resolution of captures <= 3MP(2048x1536). Use MLCameraCaptureFrameRate_15FPS only when MLCameraConnectFlag is MLCameraConnectFlag_CamOnly.
MLCameraMRQuality
Enumerator | Value | Description |
---|---|---|
MLCameraMRQuality_648x720 | 1 | Specifies 648 x 720 resolution. Aspect ratio: 9x10. |
MLCameraMRQuality_972x1080 | 2 | Specifies 972 x 1080 resolution. Aspect ratio: 9x10. |
MLCameraMRQuality_1944x2160 | 3 | Specifies 1944 x 2160 resolution. Aspect ratio: 9x10. MLCameraCaptureFrameRate_60FPS is not supported for this quality mode. |
MLCameraMRQuality_960x720 | 4 | Specifies 960 x 720 resolution. Aspect ratio: 4x3. |
MLCameraMRQuality_1440x1080 | 5 | Specifies 1440 x 1080 resolution. Aspect ratio: 4x3. |
MLCameraMRQuality_2880x2160 | 6 | Specifies 2880 x 2160 resolution. Aspect ratio: 4x3. MLCameraCaptureFrameRate_60FPS is not supported for this quality mode. |
MLCameraMRQuality_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Video Quality enumeration for mixed reality capture.
Use MLCameraGetStreamCaps to get the resolution.
MLCameraConnectFlag
Enumerator | Value | Description |
---|---|---|
MLCameraConnectFlag_CamOnly | 0x0 | Camera only frame capture. |
MLCameraConnectFlag_VirtualOnly | 0x1 | Virtual only capture. Only supported for MLCameraIdentifier_MAIN. |
MLCameraConnectFlag_MR | 0x2 | Mixed Reality capture. Only supported for MLCameraIdentifier_MAIN. |
MLCameraConnectFlag_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Flags to describe various modules in camera pipeline.
MLCameraMRBlendType
Enumerator | Value | Description |
---|---|---|
MLCameraMRBlendType_Additive | 1 | Additive blend type. It simply adds pixel values of real world and virtual layer. |
MLCameraMRBlendType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Virtual and real content blending modes.
MLCameraDisconnectReason
Enumerator | Value | Description |
---|---|---|
MLCameraDisconnect_DeviceLost | 0 | Device lost. |
MLCameraDisconnect_PriorityLost | Priority lost. | |
MLCameraDisconnect_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Camera disconnect reason.
MLCameraError
Enumerator | Value | Description |
---|---|---|
MLCameraError_None | 0 | |
MLCameraError_Invalid | Invalid/Unknown Error. | |
MLCameraError_Disabled | Camera disabled. | |
MLCameraError_DeviceFailed | Camera device failed. | |
MLCameraError_ServiceFailed | Camera service failed. | |
MLCameraError_CaptureFailed | Capture failed. | |
MLCameraError_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Camera errors.
MLCameraOutputFormat
Enumerator | Value | Description |
---|---|---|
MLCameraOutputFormat_Unknown | ||
MLCameraOutputFormat_YUV_420_888 | YUV planar format. | |
MLCameraOutputFormat_JPEG | Compressed output stream. | |
MLCameraOutputFormat_RGBA_8888 | RGB32 format. | |
MLCameraOutputFormat_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Captured output format. These three parameters determine which formats are supported:
- Camera type: [Main, CV].
- Mode: [Real, MR, Virtual].
- Capture type: [Preview, Video, Image]. These are formats supported:
Format | Camera Type | Mode | Capture Type |
---|---|---|---|
YUV | Main CV | Real Real | Preview, Video, Image Video, Image |
RGBA | Main Main CR | Real MR, Virtual Real | Video Video, Image Video |
JPEG | Main | Real, MR, Virtual | Image |
MLCameraDeviceStatusFlag
Enumerator | Value | Description |
---|---|---|
MLCameraDeviceStatusFlag_Connected | 1 << 0 | Connected. |
MLCameraDeviceStatusFlag_Idle | 1 << 1 | Idle. |
MLCameraDeviceStatusFlag_Streaming | 1 << 2 | Opened. |
MLCameraDeviceStatusFlag_Disconnected | 1 << 3 | Disconnected. |
MLCameraDeviceStatusFlag_Error | 1 << 4 | Error. Call MLCameraGetErrorCode to obtain the error code. |
MLCameraDeviceStatusFlag_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Client can implement polling mechanism to retrieve device status and use these masks to view device status.
Anonymous Enum 5
Enumerator | Value | Description |
---|---|---|
MLCamera_MaxImagePlanes | 3 | Number of planes representing the image color space. |
Anonymous Enum 6
Enumerator | Value | Description |
---|---|---|
MLCameraIntrinsics_MaxDistortionCoefficients | 5 | Default distortion vector size. |
Camera distortion vector size.
API Level:
- 20
Types Documentation
MLCameraContext
typedef MLHandle MLCameraContext;
Camera context to be used while connecting to camera.
MLCameraMRConnectInfo
typedef struct MLCameraMRConnectInfo MLCameraMRConnectInfo;
A structure to encapsulate connection settings for MR capture.
MLCameraConnectContext
typedef struct MLCameraConnectContext MLCameraConnectContext;
A structure to encapsulate context for a CameraConnect Request.
MLCameraCaptureStreamCaps
typedef struct MLCameraCaptureStreamCaps MLCameraCaptureStreamCaps;
A structure to encapsulate stream capabilities.
The capabilities for each stream supported by logical camera device can be queried with MLCameraGetStreamCaps.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraCaptureStreamConfig
typedef struct MLCameraCaptureStreamConfig MLCameraCaptureStreamConfig;
A structure to encapsulate stream configurations.
MLCameraCaptureConfig
typedef struct MLCameraCaptureConfig MLCameraCaptureConfig;
A structure to encapsulate capture configuration.
MLCameraPlaneInfo
typedef struct MLCameraPlaneInfo MLCameraPlaneInfo;
Per plane info for captured output.
MLCameraOutput
typedef struct MLCameraOutput MLCameraOutput;
A structure to encapsulate captured output.
MLCameraIntrinsicCalibrationParameters
typedef struct MLCameraIntrinsicCalibrationParameters MLCameraIntrinsicCalibrationParameters;
Camera intrinsic parameter.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraResultExtras
typedef struct MLCameraResultExtras MLCameraResultExtras;
A structure to encapsulate various indices for a capture result.
MLCameraDeviceAvailabilityInfo
typedef struct MLCameraDeviceAvailabilityInfo MLCameraDeviceAvailabilityInfo;
A structure to represent info on camera availability.
MLCameraDeviceAvailabilityStatusCallbacks
typedef struct MLCameraDeviceAvailabilityStatusCallbacks MLCameraDeviceAvailabilityStatusCallbacks;
Device availability status callbacks to be implemented by client to receive device availability status.
MLCameraDeviceStatusCallbacks
typedef struct MLCameraDeviceStatusCallbacks MLCameraDeviceStatusCallbacks;
Device status callbacks to be implemented by client to receive device status if callback mechanism is used.
MLCameraCaptureCallbacks
typedef struct MLCameraCaptureCallbacks MLCameraCaptureCallbacks;
Capture callbacks to be implemented by client to receive capture status if callback mechanism is used.
This structure must be initialized by calling MLCameraCaptureCallbacksInit() before use.
Deprecated since 1.4.0. Scheduled for removal.
Functions Documentation
MLCameraConnectContextInit
static inline void MLCameraConnectContextInit(
MLCameraConnectContext * inout_context
)
Initialize the connect context structure.
Parameters
MLCameraConnectContext * | inout_context | MLCameraConnectContext structure to initialize. |
Required Permissions:
- None
Shall be called before calling MLCameraConnect().
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraCaptureConfigInit
static inline void MLCameraCaptureConfigInit(
MLCameraCaptureConfig * inout_config
)
Initialize the capture config structure.
Parameters
MLCameraCaptureConfig * | inout_config | MLCameraCaptureConfig structure to initialize. |
Required Permissions:
- None
Shall be called before calling MLCameraPrepareCapture().
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraDeviceAvailabilityStatusCallbacksInit
static inline void MLCameraDeviceAvailabilityStatusCallbacksInit(
MLCameraDeviceAvailabilityStatusCallbacks * inout_device_availability_status_callbacks
)
Initialize the callback structure.
Parameters
MLCameraDeviceAvailabilityStatusCallbacks * | inout_device_availability_status_callbacks | Device availability status callbacks structure to initialize. |
Required Permissions:
- None
Shall be called before calling MLCameraSetDeviceAvailabilityStatusCallbacks().
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraDeviceStatusCallbacksInit
static inline void MLCameraDeviceStatusCallbacksInit(
MLCameraDeviceStatusCallbacks * inout_device_status_callbacks
)
Initialize the callback structure.
Parameters
MLCameraDeviceStatusCallbacks * | inout_device_status_callbacks | Device status callbacks structure to initialize. |
Required Permissions:
- None
Shall be called before calling MLCameraSetDeviceStatusCallbacks().
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraCaptureCallbacksInit
static inline void MLCameraCaptureCallbacksInit(
MLCameraCaptureCallbacks * inout_capture_callbacks
)
Initialize the callback structure.
Parameters
MLCameraCaptureCallbacks * | inout_capture_callbacks | Capture status callbacks structure to initialize. |
Required Permissions:
- None
Shall be called before calling MLCameraSetCaptureCallbacks().
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraInit
MLResult MLCameraInit(
const MLCameraDeviceAvailabilityStatusCallbacks * device_availability_status_callbacks,
void * user_data
)
Initialize ML Camera API, Register callback for device availability. If the user does not want to register device availability listener, MLCameraConnect can be called directly without MLCameraInit(). MLCameraDeInit should be used for unregistering callbacks and releasing resources acquired in MLCameraInit().
Parameters
const MLCameraDeviceAvailabilityStatusCallbacks * | device_availability_status_callbacks | Callback to notify camera availability status. |
void * | user_data | Pointer to user context data (can be NULL). |
Returns
MLResult | MLResult_Ok | Camera is initialized and callbacks registered successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
Required Permissions:
- android.permission.CAMERA (protection level: dangerous)
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraConnect
MLResult MLCameraConnect(
const MLCameraConnectContext * input_context,
MLCameraContext * out_context
)
Connect to camera device.
Parameters
const MLCameraConnectContext * | input_context | MLCameraConnectContext structure. |
MLCameraContext * | out_context | Camera context to be used in later APIs. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLResult_Ok | Connected to camera device successfully. |
MLResult | MLMediaGenericResult_InvalidOperation | camera device already connected. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
Required Permissions:
- android.permission.CAMERA (protection level: dangerous)
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraGetNumSupportedStreams
MLResult MLCameraGetNumSupportedStreams(
MLCameraContext context,
uint32_t * out_num_supported_streams
)
Query the no of streams supported by camera device.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
uint32_t * | out_num_supported_streams | Number of streams supported by device. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | API call completed successfully. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraGetStreamCaps
MLResult MLCameraGetStreamCaps(
MLCameraContext context,
const uint32_t stream_index,
uint32_t * inout_num_stream_caps,
MLCameraCaptureStreamCaps * inout_stream_caps
)
Query the stream capabilities.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
const uint32_t | stream_index | Index of the stream for which to query capabilities. The index should be in the range [0 , num_supported_streams) where the num_supported_streams is from MLCameraGetNumSupportedStreams(). |
uint32_t * | inout_num_stream_caps | When the parameter inout_stream_caps is null, this is an output parameter which will hold the number of capabilities supported by the stream on function return. Otherwise this is an input parameter specifying the number of capabilities to retrieve, namely the size of the array pointed to by inout_stream_caps on return. The value should be in the range of [0, number-of-caps-retrieved]. |
MLCameraCaptureStreamCaps * | inout_stream_caps | This is either null or pointing to an array of MLCameraCaptureStreamCaps() on return. Note that caller is responsible for allocating and releasing the array. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | API call completed successfully. |
Required Permissions:
- None
Retrieves either the number of capabilities supported by the given stream or an array of capabilities for the given stream. To get the number of capabilities supported by the given stream, this API should be called with num_stream_caps being valid pointer and out_stream_caps being NULL. To retrieve the array of capabilities for the given stream, this API should be called with a valid num_stream_caps (that contains the size of the out_stream_caps) and out_stream_caps being a preallocated array of MLCameraCaptureStreamCaps of size specified by num_stream_caps.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraDisconnect
MLResult MLCameraDisconnect(
MLCameraContext context
)
Disconnect from camera device.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
Returns
MLResult | MLResult_Ok | Disconnected Camera device successfully. |
MLResult | MLMediaGenericResult_InvalidOperation | Camera device already disconnected or camera device is streaming. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraDeInit
MLResult MLCameraDeInit()
Uninitialize ML Camera API, unregister callback for device availability. Should be called after all camera devices are disconnected. After MLCameraDeInit, MLCameraInit can be called or MLCameraConnect can be called.
Returns
MLResult | MLResult_Ok | Deinitialization completed successfully. |
MLResult | MLMediaGenericResult_InvalidOperation | DeInit called when camera device is connected. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraPreCaptureAEAWB
MLResult MLCameraPreCaptureAEAWB(
MLCameraContext context
)
Trigger AEAWB Convergence.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
Returns
MLResult | MLResult_InvalidParam | Invalid camera context. |
MLResult | MLResult_Ok | AEAWB convergence done. |
MLResult | MLResult_UnspecifiedFailure | Unspecified failure. |
MLResult | MLResult_Timeout | Timed out waiting for AEAWB convergence. |
MLResult | MLMediaGenericResult_InvalidOperation | Camera device not configured using MLCameraPrepareCapture() or camera device is streaming. |
Required Permissions:
- None
This API triggers AEAWB sequence and returns when AEAWB convergence has been achieved. The Users can either trigger and converge AEAWB metadata settings or use this API.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraPrepareCapture
MLResult MLCameraPrepareCapture(
MLCameraContext context,
const MLCameraCaptureConfig * config,
MLHandle * out_request_handle
)
Prepare for capture.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
const MLCameraCaptureConfig * | config | Capture configuration. |
MLHandle * | out_request_handle | Handle to the capture request metadata. Only valid if result is MLResult_Ok. |
Returns
MLResult | MLResult_InvalidParam | Failed to prepare for capture due to invalid input parameter. |
MLResult | MLResult_Ok | Prepared for capture successfully. |
MLResult | MLResult_UnspecifiedFailure | Failed to prepare for capture due to internal error. |
MLResult | MLMediaGenericResult_InvalidOperation | Camera device in streaming state. |
Required Permissions:
- None
This API prepares for capture per specified MLCameraCaptureType by creating a capture request, and a handle to which is returned to the user, who can choose to manipulate the request data (metadata) via APIs defined in ml_camera_metadata_v2.h before performing the capture.
Shall be called after MLCameraConnect().
Note: When preparing capture the width and height parameters should match one of the values returned from MLCameraGetStreamCaps.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraUpdateCaptureSettings
MLResult MLCameraUpdateCaptureSettings(
MLCameraContext context
)
Update capture setting.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
Returns
MLResult | MLResult_InvalidParam | Invalid context. |
MLResult | MLMediaGenericResult_InvalidOperation | Camera not streaming video or not in preview. |
Required Permissions:
- None
This API updates the capture settings for an active preview/video stream. The API can be used to update capture settings like exposure compensation manual exposure settings like exposure time, iso setting.The capture settings can be changed in metadata handle returned by MLCameraPrepareCapture() and then this API can be called to apply the capture settings.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraSetDeviceStatusCallbacks
MLResult MLCameraSetDeviceStatusCallbacks(
MLCameraContext context,
const MLCameraDeviceStatusCallbacks * device_status_callbacks,
void * data
)
Set the client-implemented callbacks to convey camera device status.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
const MLCameraDeviceStatusCallbacks * | device_status_callbacks | Camera device status callbacks. |
void * | data | User metadata. |
Returns
MLResult | MLResult_InvalidParam | Invalid context. |
MLResult | MLResult_Ok | Set device status callbacks successfully. |
Required Permissions:
- None
Client needs to implement the callbacks defined by MLCameraDeviceStatusCallbacks. The library passes the camera device status to the client via those callbacks.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraSetCaptureCallbacks
MLResult MLCameraSetCaptureCallbacks(
MLCameraContext context,
const MLCameraCaptureCallbacks * capture_callbacks,
void * data
)
Set the client-implemented callbacks to convey capture status.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
const MLCameraCaptureCallbacks * | capture_callbacks | Capture status callbacks. |
void * | data | User metadata. |
Returns
MLResult | MLResult_InvalidParam | Invalid context. |
MLResult | MLResult_Ok | Set Capture callbacks successfully. |
MLResult | MLResult_UnspecifiedFailure | Internal error occurred. |
Required Permissions:
- None
Client needs to implement the callbacks defined by MLCameraCaptureCallbacks. The library passes the capture status to the client via those callbacks.
Shall be called before capture operation for preview/image/video.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraCaptureImage
MLResult MLCameraCaptureImage(
MLCameraContext context,
uint32_t num_images
)
Capture still image.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
uint32_t | num_images | Number of images to capture valid range is 1-10. |
Returns
MLResult | MLResult_InvalidParam | Invalid context or invalid num_images. |
MLResult | MLResult_Ok | Triggered image capture successfully. |
MLResult | MLMediaGenericResult_InvalidOperation | MLMediaGenericResult_InvalidOperation Capture device in invalid state or image stream not configured by MLCameraPrepareCapture(). |
MLResult | MLResult_UnspecifiedFailure | Internal error occurred. |
Required Permissions:
- None
The output image will be returned in capture callback on_image_buffer_available.
This is a blocking call, it will return after the end of on_image_buffer_available callback execution.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraCaptureVideoStart
MLResult MLCameraCaptureVideoStart(
MLCameraContext context
)
Start video capture. Capture either encoded video or YUV/RGBA frames.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
Returns
MLResult | MLResult_InvalidParam | Invalid context input parameter. |
MLResult | MLResult_Ok | Started video capture successfully. |
MLResult | MLMediaGenericResult_InvalidOperation | Capture device in invalid state or video stream not configured by MLCameraPrepareCapture(). |
MLResult | MLResult_UnspecifiedFailure | Failed to start video recording due to internal error. |
Required Permissions:
- None
YUV/RGBA frames are provides through callback.For encoded video capture valid encoder input surface should be configured.The captured video YUV/RGBA frames will be returned to the application via on_video_buffer_available.
MLCameraCaptureVideoStop needs to be called to stop the capture.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraCapturePreviewStart
MLResult MLCameraCapturePreviewStart(
MLCameraContext context
)
Start preview provide raw frames through callback.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
Returns
MLResult | MLResult_InvalidParam | Invalid context. |
MLResult | MLResult_Ok | Started preview successfully. |
MLResult | MLResult_UnspecifiedFailure | Failed to start preview due to internal error. |
MLResult | MLMediaGenericResult_InvalidOperation | Capture device in invalid state or preview stream not configured by MLCameraPrepareCapture(). |
Required Permissions:
- None
The captured preview YUV frames will be returned to the application via on_preview_buffer_available.
MLCameraCapturePreviewStop needs to be called to stop the capture.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraCaptureVideoStop
MLResult MLCameraCaptureVideoStop(
MLCameraContext context
)
Stop video capture.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
Returns
MLResult | MLResult_InvalidParam | Invalid context. |
MLResult | MLResult_Ok | Stopped video capture successfully. |
MLResult | MLResult_UnspecifiedFailure | Failed to stop video recording due to internal error. |
MLResult | MLMediaGenericResult_InvalidOperation | Capture device in invalid state or video stream not streaming. |
Required Permissions:
- None
User should allow some time, i.e., >500ms, after MLCameraCaptureVideoStart and before calling this API, as captured frames are being encoded. Otherwise, MLResult_UnspecifiedFailure will be returned.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraCapturePreviewStop
MLResult MLCameraCapturePreviewStop(
MLCameraContext context
)
Stop preview.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
Returns
MLResult | MLResult_InvalidParam | Invalid context. |
MLResult | MLResult_Ok | Stopped video capture successfully. |
MLResult | MLResult_UnspecifiedFailure | Failed to stop preview due to internal error. |
MLResult | MLMediaGenericResult_InvalidOperation | Capture device in invalid state or preview stream not streaming. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraGetDeviceStatus
MLResult MLCameraGetDeviceStatus(
MLCameraContext context,
uint32_t * out_device_status
)
Poll camera device status.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
uint32_t * | out_device_status | Device status. |
Returns
MLResult | MLResult_InvalidParam | Failed to obtain device status due to invalid input parameter. |
MLResult | MLResult_Ok | Obtained device status successfully. |
Required Permissions:
- None
Use MLCameraDeviceStatusFlag to view specific status bit. Call MLCameraGetErrorCode() to obtain the error code if MLCameraDeviceStatusFlag_Error bit is set.
Note: This API can still be used even if MLCameraSetDeviceStatusCallbacks() has been called.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraGetDeviceAvailabilityStatus
MLResult MLCameraGetDeviceAvailabilityStatus(
MLCameraIdentifier cam_id,
bool * out_device_availability_status
)
Poll camera device availability status.
Parameters
MLCameraIdentifier | cam_id | Camera Id for which the availability status is to be queried. |
bool * | out_device_availability_status | Device availability status. |
Returns
MLResult | MLResult_InvalidParam | Failed to obtain device status due to invalid input parameter. |
MLResult | MLResult_Ok | Obtained device status successfully. |
Required Permissions:
- None
Use MLCameraGetDeviceAvailabilityStatus to view specific status.
Note: This API can still be used even if availability status callback is not registered through MLCameraInit call.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraGetErrorCode
MLResult MLCameraGetErrorCode(
MLCameraContext context,
MLCameraError * out_error_code
)
Obtain camera device error code.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
MLCameraError * | out_error_code | Camera device error code. |
Returns
MLResult | MLResult_InvalidParam | Failed to obtain device error code due to invalid input parameter. |
MLResult | MLResult_Ok | Obtained camera device error code successfully. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLCameraGetCameraCharacteristics
MLResult MLCameraGetCameraCharacteristics(
MLCameraContext context,
MLHandle * out_characteristics_handle
)
Obtains handle for retrieving camera characteristics.
Parameters
MLCameraContext | context | Camera context obtained from MLCameraConnect(). |
MLHandle * | out_characteristics_handle | Handle to access camera characteristic metadata. Only valid if result is MLResult_Ok. |
Returns
MLResult | MLResult_InvalidParam | Failed to obtain camera characteristic handle due to invalid input parameter. |
MLResult | MLResult_Ok | Obtained camera characteristic handle successfully. |
MLResult | MLResult_UnspecifiedFailure | Failed due to internal error. |
Required Permissions:
- None
This API provides the handle for retrieving camera characteristics via APIs defined in ml_camera_metadata_v2.h.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
Source code
// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) 2017 Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement,
// located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying
// this distribution may also be found in the top-level NOTICE file
// appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
#pragma once
#include "ml_api.h"
#include "ml_types.h"
#include <string.h>
ML_EXTERN_C_BEGIN
enum {
MLCAMERA_MAXSTREAMS = 2,
};
typedef enum MLCameraIdentifier {
MLCameraIdentifier_MAIN = 0,
MLCameraIdentifier_CV,
MLCameraIdentifier_Ensure32Bits = 0x7FFFFFFF
} MLCameraIdentifier;
typedef enum MLCameraCaptureType {
MLCameraCaptureType_Image = 0,
MLCameraCaptureType_Video,
MLCameraCaptureType_Preview,
MLCameraCaptureType_Ensure32Bits = 0x7FFFFFFF
} MLCameraCaptureType;
typedef enum MLCameraCaptureFrameRate {
MLCameraCaptureFrameRate_None = 0,
MLCameraCaptureFrameRate_15FPS,
MLCameraCaptureFrameRate_30FPS,
MLCameraCaptureFrameRate_60FPS,
MLCameraCaptureFrameRate_Ensure32Bits = 0x7FFFFFFF
} MLCameraCaptureFrameRate;
typedef enum MLCameraMRQuality {
MLCameraMRQuality_648x720 = 1,
MLCameraMRQuality_972x1080 = 2,
MLCameraMRQuality_1944x2160 = 3,
MLCameraMRQuality_960x720 = 4,
MLCameraMRQuality_1440x1080 = 5,
MLCameraMRQuality_2880x2160 = 6,
MLCameraMRQuality_Ensure32Bits = 0x7FFFFFFF
} MLCameraMRQuality;
typedef enum MLCameraConnectFlag {
MLCameraConnectFlag_CamOnly = 0x0,
MLCameraConnectFlag_VirtualOnly = 0x1,
MLCameraConnectFlag_MR = 0x2,
MLCameraConnectFlag_Ensure32Bits = 0x7FFFFFFF
} MLCameraConnectFlag;
typedef enum MLCameraMRBlendType {
MLCameraMRBlendType_Additive = 1,
MLCameraMRBlendType_Ensure32Bits = 0x7FFFFFFF
} MLCameraMRBlendType;
typedef enum MLCameraDisconnectReason {
MLCameraDisconnect_DeviceLost = 0,
MLCameraDisconnect_PriorityLost,
MLCameraDisconnect_Ensure32Bits = 0x7FFFFFFF
} MLCameraDisconnectReason;
typedef enum MLCameraError {
MLCameraError_None = 0,
MLCameraError_Invalid,
MLCameraError_Disabled,
MLCameraError_DeviceFailed,
MLCameraError_ServiceFailed,
MLCameraError_CaptureFailed,
MLCameraError_Ensure32Bits = 0x7FFFFFFF
} MLCameraError;
typedef enum MLCameraOutputFormat {
MLCameraOutputFormat_Unknown,
MLCameraOutputFormat_YUV_420_888,
MLCameraOutputFormat_JPEG,
MLCameraOutputFormat_RGBA_8888,
MLCameraOutputFormat_Ensure32Bits = 0x7FFFFFFF
} MLCameraOutputFormat;
typedef enum MLCameraDeviceStatusFlag {
MLCameraDeviceStatusFlag_Connected = 1 << 0,
MLCameraDeviceStatusFlag_Idle = 1 << 1,
MLCameraDeviceStatusFlag_Streaming = 1 << 2,
MLCameraDeviceStatusFlag_Disconnected = 1 << 3,
MLCameraDeviceStatusFlag_Error = 1 << 4,
MLCameraDeviceStatusFlag_Ensure32Bits = 0x7FFFFFFF
} MLCameraDeviceStatusFlag;
typedef MLHandle MLCameraContext;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraMRConnectInfo {
MLCameraMRQuality quality;
MLCameraMRBlendType blend_type;
MLCameraCaptureFrameRate frame_rate;
} MLCameraMRConnectInfo;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraConnectContext {
uint32_t version;
MLCameraIdentifier cam_id;
MLCameraConnectFlag flags;
bool enable_video_stab;
MLCameraMRConnectInfo mr_info;
} MLCameraConnectContext;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraCaptureStreamCaps {
MLCameraCaptureType capture_type;
int32_t width;
int32_t height;
} MLCameraCaptureStreamCaps;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraCaptureStreamConfig {
MLCameraCaptureType capture_type;
int32_t width;
int32_t height;
MLCameraOutputFormat output_format;
MLHandle native_surface_handle;
} MLCameraCaptureStreamConfig;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraCaptureConfig {
uint32_t version;
MLCameraCaptureFrameRate capture_frame_rate;
uint32_t num_streams;
MLCameraCaptureStreamConfig stream_config[MLCAMERA_MAXSTREAMS];
} MLCameraCaptureConfig;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraPlaneInfo {
uint32_t version;
uint32_t width;
uint32_t height;
uint32_t stride;
uint32_t bytes_per_pixel;
uint32_t pixel_stride;
uint8_t *data;
uint32_t size;
} MLCameraPlaneInfo;
enum {
MLCamera_MaxImagePlanes = 3
};
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraOutput {
uint32_t version;
uint8_t plane_count;
MLCameraPlaneInfo planes[MLCamera_MaxImagePlanes];
MLCameraOutputFormat format;
} MLCameraOutput;
enum {
MLCameraIntrinsics_MaxDistortionCoefficients = 5
};
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraIntrinsicCalibrationParameters {
uint32_t version;
uint32_t width;
uint32_t height;
MLVec2f focal_length;
MLVec2f principal_point;
float fov;
double distortion[MLCameraIntrinsics_MaxDistortionCoefficients];
} MLCameraIntrinsicCalibrationParameters;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraResultExtras {
uint32_t version;
int64_t frame_number;
MLTime vcam_timestamp;
MLCameraIntrinsicCalibrationParameters *intrinsics;
} MLCameraResultExtras;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraDeviceAvailabilityInfo {
MLCameraIdentifier cam_id;
void *user_data;
} MLCameraDeviceAvailabilityInfo;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraDeviceAvailabilityStatusCallbacks {
uint32_t version;
void (*on_device_available)(const MLCameraDeviceAvailabilityInfo *info);
void (*on_device_unavailable)(const MLCameraDeviceAvailabilityInfo *info);
} MLCameraDeviceAvailabilityStatusCallbacks;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraDeviceStatusCallbacks {
uint32_t version;
void (*on_device_streaming)(void *data);
void (*on_device_idle)(void *data);
void (*on_device_disconnected)(MLCameraDisconnectReason reason, void *data);
void (*on_device_error)(MLCameraError error, void *data);
} MLCameraDeviceStatusCallbacks;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLCameraCaptureCallbacks {
uint32_t version;
void (*on_capture_failed)(const MLCameraResultExtras *extra, void *data);
void (*on_capture_aborted)(void *data);
void (*on_capture_completed)(MLHandle result_metadata_handle, const MLCameraResultExtras *extra, void *data);
void (*on_image_buffer_available)(const MLCameraOutput *output, const MLHandle result_metadata_handle, const MLCameraResultExtras *extra, void *data);
void (*on_video_buffer_available)(const MLCameraOutput *output, const MLHandle result_metadata_handle, const MLCameraResultExtras *extra, void *data);
void (*on_preview_buffer_available)(const MLHandle buffer_handle, const MLHandle result_metadata_handle, const MLCameraResultExtras *extra, void *data);
} MLCameraCaptureCallbacks;
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_STATIC_INLINE void MLCameraConnectContextInit(MLCameraConnectContext *inout_context) {
if (inout_context) {
memset(inout_context, 0, sizeof(MLCameraConnectContext));
inout_context->version = 1;
}
}
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_STATIC_INLINE void MLCameraCaptureConfigInit(MLCameraCaptureConfig *inout_config) {
if (inout_config) {
memset(inout_config, 0, sizeof(MLCameraCaptureConfig));
inout_config->version = 1;
}
}
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_STATIC_INLINE void MLCameraDeviceAvailabilityStatusCallbacksInit(
MLCameraDeviceAvailabilityStatusCallbacks
*inout_device_availability_status_callbacks) {
if (inout_device_availability_status_callbacks) {
inout_device_availability_status_callbacks->version = 1;
inout_device_availability_status_callbacks->on_device_available = NULL;
inout_device_availability_status_callbacks->on_device_unavailable = NULL;
}
}
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_STATIC_INLINE void MLCameraDeviceStatusCallbacksInit(
MLCameraDeviceStatusCallbacks *inout_device_status_callbacks) {
if (inout_device_status_callbacks) {
inout_device_status_callbacks->version = 1;
inout_device_status_callbacks->on_device_streaming = NULL;
inout_device_status_callbacks->on_device_idle = NULL;
inout_device_status_callbacks->on_device_error = NULL;
inout_device_status_callbacks->on_device_disconnected = NULL;
}
}
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_STATIC_INLINE void MLCameraCaptureCallbacksInit(MLCameraCaptureCallbacks *inout_capture_callbacks) {
if (inout_capture_callbacks) {
inout_capture_callbacks->version = 1;
inout_capture_callbacks->on_capture_failed = NULL;
inout_capture_callbacks->on_capture_aborted = NULL;
inout_capture_callbacks->on_capture_completed = NULL;
inout_capture_callbacks->on_image_buffer_available = NULL;
inout_capture_callbacks->on_video_buffer_available = NULL;
inout_capture_callbacks->on_preview_buffer_available = NULL;
}
}
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraInit(const MLCameraDeviceAvailabilityStatusCallbacks *device_availability_status_callbacks, void *user_data);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraConnect(const MLCameraConnectContext *input_context, MLCameraContext *out_context);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraGetNumSupportedStreams(MLCameraContext context, uint32_t *out_num_supported_streams);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraGetStreamCaps(MLCameraContext context, const uint32_t stream_index,
uint32_t* inout_num_stream_caps, MLCameraCaptureStreamCaps *inout_stream_caps);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraDisconnect(MLCameraContext context);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraDeInit();
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraPreCaptureAEAWB(MLCameraContext context);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraPrepareCapture(MLCameraContext context, const MLCameraCaptureConfig *config, MLHandle *out_request_handle);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraUpdateCaptureSettings(MLCameraContext context);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraSetDeviceStatusCallbacks(MLCameraContext context, const MLCameraDeviceStatusCallbacks *device_status_callbacks, void *data);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraSetCaptureCallbacks(MLCameraContext context, const MLCameraCaptureCallbacks *capture_callbacks, void *data);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraCaptureImage(MLCameraContext context, uint32_t num_images);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraCaptureVideoStart(MLCameraContext context);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraCapturePreviewStart(MLCameraContext context);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraCaptureVideoStop(MLCameraContext context);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraCapturePreviewStop(MLCameraContext context);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraGetDeviceStatus(MLCameraContext context, uint32_t *out_device_status);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraGetDeviceAvailabilityStatus(MLCameraIdentifier cam_id, bool *out_device_availability_status);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraGetErrorCode(MLCameraContext context, MLCameraError *out_error_code);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLCameraGetCameraCharacteristics(MLCameraContext context, MLHandle *out_characteristics_handle);
ML_EXTERN_C_END