Esempio n. 1
0
        /// <summary>
        /// Developer should change the work mode to transcode or playback in order to enhance download speed
        /// </summary>
        private async void Mode()
        {
            var current = await cameraHandler.GetCameraWorkModeAsync();

            var currMode = current.value?.value;

            if (currMode != CameraWorkMode.PLAYBACK && currMode != CameraWorkMode.TRANSCODE)
            {
                var msg = new CameraWorkModeMsg
                {
                    value = CameraWorkMode.TRANSCODE
                };
                SDKError err = await cameraHandler.SetCameraWorkModeAsync(msg);

                System.Diagnostics.Debug.WriteLine("Mode {0})", err.ToString());
            }
            else
            {
                var msg = new CameraWorkModeMsg
                {
                    value = CameraWorkMode.SHOOT_PHOTO
                };
                SDKError err = await cameraHandler.SetCameraWorkModeAsync(msg);

                System.Diagnostics.Debug.WriteLine("Mode {0})", err.ToString());
            }
        }
Esempio n. 2
0
        private async Task <SDKError> SetCameraWorkMode(CameraWorkMode mode)
        {
            CameraWorkModeMsg workMode = new CameraWorkModeMsg
            {
                value = mode,
            };
            SDKError retCode = await DJISDKManager.Instance.ComponentManager.GetCameraHandler(0, 0).SetCameraWorkModeAsync(workMode);

            return(retCode);
        }
Esempio n. 3
0
        private async void SetCameraWorkMode(CameraWorkMode mode)
        {
            if (DJISDKManager.Instance.ComponentManager != null)
            {
                CameraWorkModeMsg workMode = new CameraWorkModeMsg
                {
                    value = mode,
                };
                var retCode = await DJISDKManager.Instance.ComponentManager.GetCameraHandler(0, 0).SetCameraWorkModeAsync(workMode);

                if (retCode != SDKError.NO_ERROR)
                {
                    OutputTB.Text = "Set camera work mode to " + mode.ToString() + "failed, result code is " + retCode.ToString();
                }
            }
            else
            {
                OutputTB.Text = "SDK hasn't been activated yet.";
            }
        }