Exemplo n.º 1
0
        private void RegisterDeviceConnectionChangedCallback()
        {
            Native.DeviceConnectionChangedCallback callback = (ref Native.CameraDeviceStruct device, bool status, IntPtr userData) =>
            {
                DeviceConnectionChanged?.Invoke(this, new CameraDeviceConnectionChangedEventArgs(ref device, status));
            };

            Native.SetDeviceConnectionChangedCallback(Handle, callback, IntPtr.Zero, out connectionCallbackId).
            ThrowIfFailed("Failed to set device connection changed callback");
        }
Exemplo n.º 2
0
        private void RegisterDeviceConnectionChangedCallback()
        {
            _deviceConnectionChangedCallback = (ref Native.CameraDeviceStruct device, bool status, IntPtr userData) =>
            {
                Log.Debug(CameraLog.Tag, "Invoke DeviceConnectionChanged event");
                _deviceConnectionChanged?.Invoke(this, new CameraDeviceConnectionChangedEventArgs(ref device, status));
            };

            Native.SetDeviceConnectionChangedCallback(Handle, _deviceConnectionChangedCallback, IntPtr.Zero, out _connectionCallbackId).
            ThrowIfFailed("Failed to set device connection changed callback");

            Log.Debug(CameraLog.Tag, $"callbackId[{_connectionCallbackId}]");
        }