private static void UnregisterDeviceStateChangedCallback() { CameraErrorFactory.ThrowIfError(Native.UnsetDeviceStateChangedCallback(_deviceStateCallbackId), "Unsetting device state changed callback failed"); _deviceStateChangedCallback = null; _deviceStateCallbackId = 0; }
private static void UnregisterDeviceStateChangedCallback() { Native.UnsetDeviceStateChangedCallback(_deviceStateCallbackId). ThrowIfFailed("Failed to unset device state changed callback."); _deviceStateChangedCallback = null; _deviceStateCallbackId = 0; }
private static void RegisterDeviceStateChangedCallback() { _deviceStateChangedCallback = (CameraDevice device, CameraDeviceState state, IntPtr userData) => { _deviceStateChanged?.Invoke(null, new CameraDeviceStateChangedEventArgs(device, state)); }; CameraErrorFactory.ThrowIfError(Native.SetDeviceStateChangedCallback(_deviceStateChangedCallback, IntPtr.Zero, out _deviceStateCallbackId), "Failed to set device state changed callback"); Log.Info(CameraLog.Tag, "add callbackId " + _deviceStateCallbackId.ToString()); }
private static void RegisterDeviceStateChangedCallback() { _deviceStateChangedCallback = (device, state, _) => { _deviceStateChanged?.Invoke(null, new CameraDeviceStateChangedEventArgs(device, state)); }; Native.SetDeviceStateChangedCallback(_deviceStateChangedCallback, IntPtr.Zero, out _deviceStateCallbackId). ThrowIfFailed("Failed to set device state changed callback."); Log.Info(CameraLog.Tag, "add callbackId " + _deviceStateCallbackId.ToString()); }