/// <summary>
            /// Update the MLCamera characteristics.
            /// </summary>
            /// <returns>
            /// MLResult.Result will be <c>MLResult.Code.Ok</c> if obtained camera characteristic handle successfully.
            /// MLResult.Result will be <c>MLResult.Code.InvalidParam</c> if failed to obtain camera characteristic handle due to invalid input parameter.
            /// MLResult.Result will be <c>MLResult.Code.MediaGenericUnexpectedNull</c> if failed to capture raw image due to null pointer.
            /// MLResult.Result will be <c>MLResult.Code.AllocFailed</c> if failed to allocate memory.
            /// MLResult.Result will be <c>MLResult.Code.PrivilegeDenied</c> if a required permission is missing.
            /// </returns>
            internal MLResult PopulateCharacteristics()
            {
                MLResult.Code resultCode;

                ulong cameraCharacteristicsHandle = MagicLeapNativeBindings.InvalidHandle;

                resultCode = MLCameraNativeBindings.MLCameraGetCameraCharacteristics(ref cameraCharacteristicsHandle);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get camera characteristics for MLCamera. Reason: {0}", result);
                    return(result);
                }

                ulong  controlAEModeCount          = 0;
                IntPtr controlAEAvailableModesData = IntPtr.Zero;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAEAvailableModes(cameraCharacteristicsHandle, ref controlAEAvailableModesData, ref controlAEModeCount);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get camera control AE available modes for MLCamera. Reason: {0}", result);
                    return(result);
                }

                this.ControlAEModesAvailable = new List <MLCamera.MetadataControlAEMode>();
                int[] controlAEModeArray = new int[controlAEModeCount];
                Marshal.Copy(controlAEAvailableModesData, controlAEModeArray, 0, (int)controlAEModeCount);
                for (int i = 0; i < controlAEModeArray.Length; ++i)
                {
                    this.ControlAEModesAvailable.Add((MLCamera.MetadataControlAEMode)controlAEModeArray[i]);
                }

                ulong  colorCorrectionAberrationModeCount = 0;
                IntPtr colorCorrectionAberrationModesData = IntPtr.Zero;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetColorCorrectionAvailableAberrationModes(cameraCharacteristicsHandle, ref colorCorrectionAberrationModesData, ref colorCorrectionAberrationModeCount);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get color correction aberration modes available for MLCamera. Reason: {0}", result);
                    return(result);
                }

                this.ColorCorrectionAberrationModesAvailable = new List <MLCamera.MetadataColorCorrectionAberrationMode>((int)colorCorrectionAberrationModeCount);
                int[] aberrationModeArray = new int[colorCorrectionAberrationModeCount];
                Marshal.Copy(colorCorrectionAberrationModesData, aberrationModeArray, 0, (int)colorCorrectionAberrationModeCount);
                for (int i = 0; i < aberrationModeArray.Length; ++i)
                {
                    this.ColorCorrectionAberrationModesAvailable.Add((MLCamera.MetadataColorCorrectionAberrationMode)aberrationModeArray[i]);
                }

                int[] compensationRange = new int[2];
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAECompensationRange(cameraCharacteristicsHandle, compensationRange);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get control AE compensation range. Reason: {0}", result);
                    return(result);
                }

                this.AECompensationRange = new AECompensationRangeValues(compensationRange[0], compensationRange[1]);

                MLCameraNativeBindings.MLCameraMetadataRationalNative rational = new MLCameraNativeBindings.MLCameraMetadataRationalNative();
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAECompensationStep(cameraCharacteristicsHandle, ref rational);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get control AE compensation step. Reason: {0}", result);
                    return(result);
                }

                this.AECompensationStepNumerator   = rational.Numerator;
                this.AECompensationStepDenominator = rational.Denominator;

                this.AECompensationStep = (float)this.AECompensationStepNumerator / (float)this.AECompensationStepDenominator;

                float availableMaxDigitalZoom = 0.0f;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetScalerAvailableMaxDigitalZoom(cameraCharacteristicsHandle, ref availableMaxDigitalZoom);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get max available digital zoom. Reason: {0}", result);
                    return(result);
                }

                this.AvailableMaxDigitalZoom = availableMaxDigitalZoom;

                int sensorOrientation = 0;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetSensorOrientation(cameraCharacteristicsHandle, ref sensorOrientation);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get sensor orientation. Reason: {0}", result);
                    return(result);
                }

                this.SensorOrientation = sensorOrientation;

                MLCamera.MetadataControlAELock controlAELockAvailable = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAELockAvailable(cameraCharacteristicsHandle, ref controlAELockAvailable);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get control AE lock available. Reason: {0}", result);
                    return(result);
                }

                this.ControlAELockAvailable = controlAELockAvailable;

                ulong  controlAWBModeCount          = 0;
                IntPtr controlAWBAvailableModesData = IntPtr.Zero;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAWBAvailableModes(cameraCharacteristicsHandle, ref controlAWBAvailableModesData, ref controlAWBModeCount);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get camera control ABW available modes for MLCamera. Reason: {0}", result);
                    return(result);
                }

                this.ControlAWBModesAvailable = new List <MLCamera.MetadataControlAWBMode>();
                int[] awbModeArray = new int[controlAWBModeCount];
                Marshal.Copy(controlAWBAvailableModesData, awbModeArray, 0, (int)controlAWBModeCount);
                for (int i = 0; i < awbModeArray.Length; ++i)
                {
                    this.ControlAWBModesAvailable.Add((MLCamera.MetadataControlAWBMode)awbModeArray[i]);
                }

                MLCamera.MetadataControlAWBLock controlAWBLockAvailable = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAWBLockAvailable(cameraCharacteristicsHandle, ref controlAWBLockAvailable);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get control AWB lock available. Reason: {0}", result);
                    return(result);
                }

                this.ControlAWBLockAvailable = controlAWBLockAvailable;

                int[] sensorInfoActiveArraySize = new int[4];

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetSensorInfoActiveArraySize(cameraCharacteristicsHandle, sensorInfoActiveArraySize);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get sensor info active array size. Reason: {0}", result);
                    return(result);
                }

                this.SensorInfoActiveArraySize = new SensorInfoActiveArraySizeValues(
                    sensorInfoActiveArraySize[0],
                    sensorInfoActiveArraySize[1],
                    sensorInfoActiveArraySize[2],
                    sensorInfoActiveArraySize[3]);

                ulong  scalerProcessedSizesCount = 0;
                IntPtr scalerProcessedSizesData  = IntPtr.Zero;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetScalerProcessedSizes(cameraCharacteristicsHandle, ref scalerProcessedSizesData, ref scalerProcessedSizesCount);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get scaler processed sizes. Reason: {0}", result);
                    return(result);
                }

                int[] scalerProcessedSizesDataArray = new int[scalerProcessedSizesCount];
                Marshal.Copy(scalerProcessedSizesData, scalerProcessedSizesDataArray, 0, (int)scalerProcessedSizesCount);
                this.ScalerProcessedSizes = new List <ScalerProcessedSize>((int)scalerProcessedSizesCount);
                for (int i = 0; i < (int)scalerProcessedSizesCount; i += 2)
                {
                    int width  = scalerProcessedSizesDataArray[i];
                    int height = scalerProcessedSizesDataArray[i + 1];
                    ScalerProcessedSize newSize = new ScalerProcessedSize(width, height);
                    this.ScalerProcessedSizes.Add(newSize);
                }

                ulong  streamConfigurationsCount = 0;
                IntPtr streamConfigurationsData  = IntPtr.Zero;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetScalerAvailableStreamConfigurations(cameraCharacteristicsHandle, ref streamConfigurationsData, ref streamConfigurationsCount);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get scaler available stream configurations. Reason: {0}", result);
                    return(result);
                }

                int[] streamConfigurationsDataArray = new int[streamConfigurationsCount];
                Marshal.Copy(streamConfigurationsData, streamConfigurationsDataArray, 0, (int)streamConfigurationsCount);

                this.ScalerAvailableStreamConfigurations = new List <StreamConfiguration>();
                for (int i = 0; i < (int)streamConfigurationsCount; i += 4)
                {
                    StreamConfiguration config = new StreamConfiguration(
                        (MLCamera.MetadataScalerAvailableFormats)streamConfigurationsDataArray[i],
                        streamConfigurationsDataArray[i + 1],
                        streamConfigurationsDataArray[i + 2],
                        (MLCamera.MetadataScalerAvailableStreamConfigurations)streamConfigurationsDataArray[i + 3]);

                    this.ScalerAvailableStreamConfigurations.Add(config);
                }

                int[] sensorInfoSensitivityRange = new int[2];
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetSensorInfoSensitivityRange(cameraCharacteristicsHandle, sensorInfoSensitivityRange);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get sensor info sensitivity range. Reason: {0}", result);
                    return(result);
                }

                this.SensorInfoSensitivityRange = new SensorInfoSensitivityRangeValues(sensorInfoSensitivityRange[0], sensorInfoSensitivityRange[1]);

                long[] sensorInfoExposureTimeRange = new long[2];
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetSensorInfoExposureTimeRange(cameraCharacteristicsHandle, sensorInfoExposureTimeRange);

                if (!MLResult.IsOK(resultCode))
                {
                    MLResult result = MLResult.Create(resultCode);
                    MLPluginLog.ErrorFormat("MLCamera.GeneralSettings.PopulateCharacteristics failed to get sensor info exposure time range. Reason: {0}", result);
                    return(result);
                }

                this.SensorInfoExposureTimeRange = new SensorInfoExposureTimeRangeValues(sensorInfoExposureTimeRange[0], sensorInfoExposureTimeRange[1]);

                return(MLResult.Create(MLResult.Code.Ok));
            }
            /// <summary>
            /// Populate the camera result settings.
            /// </summary>
            /// <param name="prepareHandle">A pointer to the camera prepare handle.</param>
            /// <returns>
            /// MLResult.Result will be <c>MLResult.Code.Ok</c> if completed successfully.
            /// MLResult.Result will be <c>MLResult.Code.UnspecifiedFailure</c> if failed due to internal error.
            /// MLResult.Result will be <c>MLResult.Code.InvalidParam</c> if an invalid parameter was provided.
            /// MLResult.Result will be <c>MLResult.Code.PrivilegeDenied</c> if a required permission is missing.
            /// </returns>
            internal MLResult.Code PopulateSettings(ulong prepareHandle)
            {
                MLResult.Code resultCode = MLResult.Code.Ok;

                MLCamera.MetadataColorCorrectionMode colorCorrectionMode = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetColorCorrectionModeResultMetadata(prepareHandle, ref colorCorrectionMode);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get color correction mode for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ColorCorrectionMode = colorCorrectionMode;

                MLCameraNativeBindings.MLCameraMetadataRationalNative[] colorCorrectionTransform = new MLCameraNativeBindings.MLCameraMetadataRationalNative[9];
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetColorCorrectionTransformResultMetadata(prepareHandle, colorCorrectionTransform);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get color correction transform matrix for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ColorCorrectionTransform = new MLCamera.ColorCorrectionTransform(
                    colorCorrectionTransform[0].ToFloat(),
                    colorCorrectionTransform[1].ToFloat(),
                    colorCorrectionTransform[2].ToFloat(),
                    colorCorrectionTransform[3].ToFloat(),
                    colorCorrectionTransform[4].ToFloat(),
                    colorCorrectionTransform[5].ToFloat(),
                    colorCorrectionTransform[6].ToFloat(),
                    colorCorrectionTransform[7].ToFloat(),
                    colorCorrectionTransform[8].ToFloat());

                MLCamera.MetadataColorCorrectionAberrationMode colorCorrectionAberrationMode = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetColorCorrectionAberrationModeResultMetadata(prepareHandle, ref colorCorrectionAberrationMode);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get color correction aberration mode for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ColorCorrectionAberrationMode = colorCorrectionAberrationMode;

                float[] colorCorrectionGains = new float[4];
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetColorCorrectionGainsResultMetadata(prepareHandle, colorCorrectionGains);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get color correction gains for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                // The order of this, red, greenEven, greenOdd, blue, was taken from the android developer site for the color corrections gain vector
                // https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector
                this.ColorCorrectionGains = new MLCamera.ColorCorrectionGains(colorCorrectionGains[0], colorCorrectionGains[1], colorCorrectionGains[2], colorCorrectionGains[3]);

                MLCamera.MetadataControlAEAntibandingMode controlAEAntiBandingMode = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAEAntibandingModeResultMetadata(prepareHandle, ref controlAEAntiBandingMode);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get control AE antibanding mode for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ControlAEAntibandingMode = controlAEAntiBandingMode;

                int controlAEExposureCompensation = 0;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAEExposureCompensationResultMetadata(prepareHandle, ref controlAEExposureCompensation);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get control AE exposure compensation for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.AEExposureCompensation = controlAEExposureCompensation;

                MLCamera.MetadataControlAELock controlAELock = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAELockResultMetadata(prepareHandle, ref controlAELock);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get control AE lock for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ControlAELock = controlAELock;

                MLCamera.MetadataControlAEMode controlAEMode = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAEModeResultMetadata(prepareHandle, ref controlAEMode);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get control ae mode for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ControlAEMode = controlAEMode;

                int[] controlAETargetFPSRangeArray = new int[2];
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAETargetFPSRangeResultMetadata(prepareHandle, controlAETargetFPSRangeArray);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get control AE target fps for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ControlAETargetFPSRange = new MLCamera.ControlAETargetFPSRange(controlAETargetFPSRangeArray[0], controlAETargetFPSRangeArray[1]);

                MLCamera.MetadataControlAEState controlAEState = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAEStateResultMetadata(prepareHandle, ref controlAEState);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get control AE state for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ControlAEState = controlAEState;

                MLCamera.MetadataControlAWBLock controlAWBLock = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAWBLockResultMetadata(prepareHandle, ref controlAWBLock);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get control AWB lock for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ControlAWBLock = controlAWBLock;

                MLCamera.MetadataControlAWBState controlAWBState = 0;
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetControlAWBStateResultMetadata(prepareHandle, ref controlAWBState);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get control AWB state for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ControlAWBState = controlAWBState;

                long sensorExposureTime = 0;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetSensorExposureTimeResultMetadata(prepareHandle, ref sensorExposureTime);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get sensor exposure time for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.SensorExposureTime = sensorExposureTime;

                int sensorySensitivity = 0;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetSensorSensitivityResultMetadata(prepareHandle, ref sensorySensitivity);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get sensor sensitivity for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.SensorSensitivity = sensorySensitivity;

                long sensorTimestamp = 0;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetSensorTimestampResultMetadata(prepareHandle, ref sensorTimestamp);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get sensor time stamp for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.SensorTimestamp = sensorTimestamp;

                int[] scalerCropRegionArray = new int[4];
                resultCode = MLCameraNativeBindings.MLCameraMetadataGetScalerCropRegionResultMetadata(prepareHandle, scalerCropRegionArray);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get scaler crop region for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.ScalerCropRegion = new MLCamera.ScalerCropRegion(scalerCropRegionArray[0], scalerCropRegionArray[1], scalerCropRegionArray[2], scalerCropRegionArray[3]);

                long sensorFrameDuration = 0;

                resultCode = MLCameraNativeBindings.MLCameraMetadataGetSensorFrameDurationResultMetadata(prepareHandle, ref sensorFrameDuration);
                if (!MLResult.IsOK(resultCode))
                {
                    MLPluginLog.ErrorFormat("MLCamera.ResultSettings.PopulateSettings failed to get sensor frame duration for prepare handle {0}. Reason: {1}", prepareHandle, resultCode);
                    return(resultCode);
                }

                this.SensorFrameDuration = sensorFrameDuration;

                return(resultCode);
            }