Skip to main content
Version: 14 Oct 2024

MLCameraDeviceStatusCallbacks

Module: Camera

More...

#include <ml_camera_v2.h>

Public Attributes

TypeName
uint32_tversion
void()(void data)on_device_streaming
Callback is invoked when the camera is streaming.
void()(void data)on_device_idle
Callback is invoked when the camera stops streaming.
void()(MLCameraDisconnectReason reason, void data)on_device_disconnected
Callback is invoked when the camera is disconnected.
void()(MLCameraError error, void data)on_device_error
Callback is invoked when the camera encountered errors.

Detailed Description

struct MLCameraDeviceStatusCallbacks;

Device status callbacks to be implemented by client to receive device status if callback mechanism is used.


Public Attributes Documentation

version

uint32_t version;

Version of this structure.


on_device_streaming

void(*)(void *data) on_device_streaming;

Callback is invoked when the camera is streaming.

TypeDescription
void()(void data))(void *data)

Parameters

dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetDeviceStatusCallbacks.

on_device_idle

void(*)(void *data) on_device_idle;

Callback is invoked when the camera stops streaming.

TypeDescription
void()(void data))(void *data)

Parameters

dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetDeviceStatusCallbacks.

on_device_disconnected

void(*)(MLCameraDisconnectReason reason, void *data) on_device_disconnected;

Callback is invoked when the camera is disconnected.

TypeDescription
void()(MLCameraDisconnectReason reason, void data))(MLCameraDisconnectReason reason, void *data)

Parameters

reasonRepresents the reason for disconnection.
dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetDeviceStatusCallbacks.

on_device_error

void(*)(MLCameraError error, void *data) on_device_error;

Callback is invoked when the camera encountered errors.

TypeDescription
void()(MLCameraError error, void data))(MLCameraError error, void *data)

Parameters

errorRepresents the error type when happened.
dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetDeviceStatusCallbacks.

Invalid: The camera device is not available.

Disabled: The camera device can't be opened due to a device policy.

Device error: The camera device encountered a fatal error such as the Headset device has lost connection or the hardware comm bus is busy and not be able to response and caused a timeout.

Service error: The camera service has encountered a fatal error and could not provide service.

Capture failed: The capture request has failed. on_capture_failed or on_capture_buffer_lost callbacks will be invoked when this error happens.