// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) (2018-2024) 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%
// Disable warnings about missing documentation for native interop.
#pragma warning disable 1591
namespace UnityEngine.XR.MagicLeap
{
using System;
///
/// MLCamera class exposes static functions to query camera related
/// functions. Most functions are currently a direct pass through functions to the
/// native C-API functions and incur no overhead.
///
public partial class MLCameraBase
{
///
/// This class defines the C# interface to the C functions/structures in "ml_camera.h".
///
internal partial class NativeBindings
{
public delegate void DeviceAvailabilityStatusDelegate(ref MLCameraDeviceAvailabilityInfo info);
///
/// A generic delegate for camera events.
///
/// Custom data returned when the callback is triggered, user metadata.
public delegate void OnDataCallback(IntPtr data);
///
/// A delegate for camera error events.
///
/// The type of error that was reported.
/// Custom data returned when the callback is triggered, user metadata.
public delegate void OnErrorDataCallback(MLCamera.ErrorType error, IntPtr data);
///
/// A delegate for image buffer events.
///
/// The camera output type.
/// Custom data returned when the callback is triggered, user metadata.
public delegate void OnOutputRefDataCallback(ref MLCameraOutput output, IntPtr data);
///
/// A delegate for camera preview events.
///
/// A handle to the metadata.
/// Custom data returned when the callback is triggered, user metadata.
public delegate void OnHandleDataCallback(ulong metadataHandle, IntPtr data);
///
/// A delegate for camera capture events.
///
/// A structure containing extra result information.
/// Custom data returned when the callback is triggered, user metadata.
public delegate void OnResultExtrasRefDataCallback(ref MLCameraResultExtras extra, IntPtr data);
///
/// A delegate for camera capture events with additional information.
///
/// A handle to the metadata.
/// A structure containing extra result information.
/// Custom data returned when the callback is triggered, user metadata.
public delegate void OnHandleAndResultExtrasRefDataCallback(MLCamera.Metadata metadataHandle,
ref MLCameraResultExtras extra, IntPtr data);
public delegate void OnCaptureFailedDelegate(ref MLCameraResultExtras extra, IntPtr data);
public delegate void OnCaptureAbortedDelegate(IntPtr data);
public delegate void OnPreviewBufferAvailableDelegate(ulong bufferHandle, ulong metadataHandle,
ref MLCameraResultExtras extra, IntPtr data);
public delegate void OnDeviceStreamingDelegate(IntPtr data);
public delegate void OnDeviceIdleDelegate(IntPtr data);
public delegate void OnImageBufferAvailableDelegate(ref MLCameraOutput output, ulong metadataHandle,
ref MLCameraResultExtras extra, IntPtr data);
public delegate void OnVideoBufferAvailableDelegate(ref MLCameraOutput output, ulong metadataHandle,
ref MLCameraResultExtras extra, IntPtr data);
public delegate void OnDeviceErrorDelegate(MLCamera.ErrorType error, IntPtr data);
public delegate void OnDeviceDisconnectedDelegate(MLCamera.DisconnectReason reason, IntPtr data);
public delegate void OnCaptureCompletedDelegate(ulong metadataHandle, ref MLCameraResultExtras extra, IntPtr data);
}
}
}