Skip to main content
Version: 14 Oct 2024

MLCameraCaptureCallbacks

Module: Camera

Capture callbacks to be implemented by client to receive capture status if callback mechanism is used. More...

#include <ml_camera_v2.h>

Public Attributes

TypeName
uint32_tversion
void()(const MLCameraResultExtras extra, void *data)on_capture_failed
Callback is invoked when a capture has failed when the camera device failed to produce a capture result for the request.
void()(void data)on_capture_aborted
Callback is invoked when an ongoing video or preview capture or both are aborted due to an error. This is not valid for MR Capture.
void()(MLHandle result_metadata_handle, const MLCameraResultExtras extra, void *data)on_capture_completed
Callback is invoked when capturing single frame is completed and result is available. For MRCapture null metadata handle.
void()(const MLCameraOutput output, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void data)on_image_buffer_available
Callback is invoked when a captured image buffer is available with MLCameraCaptureType_Image.
void()(const MLCameraOutput output, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void data)on_video_buffer_available
Callback is invoked when a captured video frame buffer is available with MLCameraCaptureType_Video.
void()(const MLHandle buffer_handle, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void *data)on_preview_buffer_available
Callback is invoked when a preview video frame buffer is available with MLCameraCaptureType_Preview.

Detailed Description

struct 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

Deprecated since 1.4.0. Scheduled for removal.


Public Attributes Documentation

version

uint32_t version;

Version of this structure.


on_capture_failed

void(*)(const MLCameraResultExtras *extra, void *data) on_capture_failed;

Callback is invoked when a capture has failed when the camera device failed to produce a capture result for the request.

TypeDescription
void()(const MLCameraResultExtras extra, void *data))(const MLCameraResultExtras extra, void data)

Parameters

extraCarries capture result information of current captured frame.
dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetCaptureCallbacks.

on_capture_aborted

void(*)(void *data) on_capture_aborted;

Callback is invoked when an ongoing video or preview capture or both are aborted due to an error. This is not valid for MR Capture.

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

Parameters

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

on_capture_completed

void(*)(MLHandle result_metadata_handle, const MLCameraResultExtras *extra, void *data) on_capture_completed;

Callback is invoked when capturing single frame is completed and result is available. For MRCapture null metadata handle.

TypeDescription
void()(MLHandle result_metadata_handle, const MLCameraResultExtras extra, void *data))(MLHandle result_metadata_handle, const MLCameraResultExtras extra, void data)

Parameters

result_metadata_handleRepresents camera result metadata which could be used as input handle for camera result metadata related functions.
extraCarries capture result information of current captured frame.
dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetCaptureCallbacks.

on_image_buffer_available

void(*)(const MLCameraOutput *output, const MLHandle result_metadata_handle, const MLCameraResultExtras *extra, void *data) on_image_buffer_available;

Callback is invoked when a captured image buffer is available with MLCameraCaptureType_Image.

TypeDescription
void()(const MLCameraOutput output, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void data))(const MLCameraOutput output, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void *data)

Parameters

outputProvides image properties and buffer pointer to image data.
result_metadata_handleHandle to metadata of captured frame.
extraCarries capture result information of current captured frame.
dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetCaptureCallbacks.

on_video_buffer_available

void(*)(const MLCameraOutput *output, const MLHandle result_metadata_handle, const MLCameraResultExtras *extra, void *data) on_video_buffer_available;

Callback is invoked when a captured video frame buffer is available with MLCameraCaptureType_Video.

TypeDescription
void()(const MLCameraOutput output, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void data))(const MLCameraOutput output, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void *data)

Parameters

outputProvides video frame properties and buffer pointer to video frame data.
result_metadata_handleHandle to metadata of captured frame.
extraCarries capture result information of current captured frame.
dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetCaptureCallbacks.

on_preview_buffer_available

void(*)(const MLHandle buffer_handle, const MLHandle result_metadata_handle, const MLCameraResultExtras *extra, void *data) on_preview_buffer_available;

Callback is invoked when a preview video frame buffer is available with MLCameraCaptureType_Preview.

TypeDescription
void()(const MLHandle buffer_handle, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void *data))(const MLHandle buffer_handle, const MLHandle result_metadata_handle, const MLCameraResultExtras extra, void data)

Parameters

buffer_handleHandle of preview buffer allocated for preview.
result_metadata_handleHandle to metadata of captured frame.
extraCarries capture result information of current captured frame.
dataCustom data to be returned when callback is triggered. This data passed in MLCameraSetCaptureCallbacks.

This callback is not valid for MR Capture since it does not have preview support.