Exemplo n.º 1
0
        private void SaveVideoSettings()
        {
            _deviceConfigLoader.SaveConfig(_deviceNameAccessor);

            var cameraDeviceName = SelectedCameraDevice;
            var docDeviceName    = SelectedDocDevice;

            var videoVga = SelectedVedioVGA;
            var docVga   = SelectedDocVGA;

            var videoRate    = SelectedVedioRate;
            var videoDocRate = SelectedDocRate;

            _configManager.MainVideoInfo = new VideoInfo();
            _configManager.DocVideoInfo  = new VideoInfo();

            if (string.IsNullOrEmpty(SelectedCameraDevice) && string.IsNullOrEmpty(SelectedDocDevice))
            {
                HasErrorMsg("-1", "未选择任何视频采集源!");
            }

            if (!string.IsNullOrEmpty(SelectedCameraDevice))
            {
                if (!string.IsNullOrEmpty(videoVga))
                {
                    var videoVgaWith   = int.Parse(videoVga.Split('*')[0]);
                    var videoVgaHeight = int.Parse(videoVga.Split('*')[1]);

                    _configManager.MainVideoInfo.DisplayWidth  = videoVgaWith;
                    _configManager.MainVideoInfo.DisplayHeight = videoVgaHeight;
                }

                _configManager.MainVideoInfo.VideoDevice  = cameraDeviceName;
                _configManager.MainVideoInfo.VideoBitRate = videoRate;
                _configManager.MainVideoInfo.ColorSpace   = SelectedCameraColorSpace.Colorsapce;
            }

            if (!string.IsNullOrEmpty(SelectedDocDevice))
            {
                if (!string.IsNullOrEmpty(docVga))
                {
                    var docVgaWith   = int.Parse(docVga.Split('*')[0]);
                    var docVgaHeight = int.Parse(docVga.Split('*')[1]);

                    _configManager.DocVideoInfo.DisplayHeight = docVgaHeight;
                    _configManager.DocVideoInfo.DisplayWidth  = docVgaWith;
                }

                var docRate = SelectedDocRate;

                _configManager.DocVideoInfo.VideoBitRate = docRate;
                _configManager.DocVideoInfo.VideoDevice  = docDeviceName;
                _configManager.DocVideoInfo.ColorSpace   = SelectedDocColorSpace.Colorsapce;
            }

            //Common.ConfigManager.WriteConfig();
        }
Exemplo n.º 2
0
        private void SaveSetting()
        {
            _deviceConfigLoader.SaveConfig(_deviceNameAccessor);

            //if (_meetingService == null)
            //{
            //    _configManager.AudioInfo = new AudioInfo();
            //}
            //if (_meetingService == null) return;
            //_meetingService.SetDefaultDevice(AudioSourceType, SelectedAudioSource);
            //_meetingService.SetDefaultDevice(DocSourceType, SelectedDocAudioSource);
            //_meetingService.SetDefaultDevice(AudioOutPutDeviceType, SelectedAudioOutPutDevice);
            //_meetingService.SetAudioSampleRate(SelectedSampleRate);
            //_meetingService.SetAudioBitRate(SelectedAac);
            //保存设置到本地配置文件
            _configManager.AudioInfo.AAC = SelectedAac;
            _configManager.AudioInfo.AudioOutPutDevice     = SelectedAudioOutPutDevice;
            _configManager.AudioInfo.AudioSammpleDevice    = SelectedAudioSource;
            _configManager.AudioInfo.SampleRate            = SelectedSampleRate;
            _configManager.AudioInfo.DocAudioSammpleDevice = SelectedDocAudioSource;
            _localDataManager.SaveSettingConfigData(_configManager);
        }
Exemplo n.º 3
0
        private void SaveSetting()
        {
            try
            {
                _deviceConfigLoader.SaveConfig(_deviceNameAccessor);

                var cameraDeviceName = SelectedCameraDevice;
                var docDeviceName    = SelectedDocDevice;
                var videoVga         = SelectedVedioVGA;
                var docVga           = SelectedDocVGA;
                var videoRate        = SelectedVedioRate;
                _configManager.MainVideoInfo = new VideoInfo();
                _configManager.DocVideoInfo  = new VideoInfo();

                if (string.IsNullOrEmpty(SelectedCameraDevice) && string.IsNullOrEmpty(SelectedDocDevice))
                {
                    throw new Exception("未选择任何视频采集源!");
                }

                if (!string.IsNullOrEmpty(SelectedCameraDevice))
                {
                    if (!string.IsNullOrEmpty(videoVga))
                    {
                        var videoVgaWith   = int.Parse(videoVga.Split('*')[0]);
                        var videoVgaHeight = int.Parse(videoVga.Split('*')[1]);

                        _configManager.MainVideoInfo.DisplayWidth  = videoVgaWith;
                        _configManager.MainVideoInfo.DisplayHeight = videoVgaHeight;
                    }
                    //视频设置
                    //var result1 = _meetingService.SetDefaultDevice(CameraDeviceType, cameraDeviceName);
                    //if (result1.HasError)
                    //    throw new Exception(MessageManager.SaveError);
                    //var result2 = _meetingService.SetVideoBitRate(CameraDeviceType, videoRate);
                    //if (result2.HasError)
                    //    throw new Exception(MessageManager.SaveError);
                    //var result3 = _meetingService.SetVideoResolution(CameraDeviceType, videoVgaWith, videoVgaHeight);
                    //if (result3.HasError)
                    //    throw new Exception(MessageManager.SaveError);

                    _configManager.MainVideoInfo.VideoDevice  = cameraDeviceName;
                    _configManager.MainVideoInfo.VideoBitRate = videoRate;
                    _configManager.MainVideoInfo.ColorSpace   = SelectedCameraColorSpace.Colorsapce;
                }

                if (!string.IsNullOrEmpty(SelectedDocDevice))
                {
                    if (!string.IsNullOrEmpty(docVga))
                    {
                        var docVgaWith   = int.Parse(docVga.Split('*')[0]);
                        var docVgaHeight = int.Parse(docVga.Split('*')[1]);

                        _configManager.DocVideoInfo.DisplayHeight = docVgaHeight;
                        _configManager.DocVideoInfo.DisplayWidth  = docVgaWith;
                    }

                    var docRate = SelectedDocRate;

                    //课件设置
                    //var result4 = _meetingService.SetDefaultDevice(DocDeviceType, docDeviceName);
                    //if (result4.HasError)
                    //    throw new Exception(MessageManager.SaveError);
                    //var result5 = _meetingService.SetVideoBitRate(DocDeviceType, docRate);
                    //if (result5.HasError)
                    //    throw new Exception(MessageManager.SaveError);
                    //var result6 = _meetingService.SetVideoResolution(DocDeviceType, docVgaWith, docVgaHeight);
                    //if (result6.HasError)
                    //    throw new Exception(MessageManager.SaveError);
                    _configManager.DocVideoInfo.VideoBitRate = docRate;
                    _configManager.DocVideoInfo.VideoDevice  = docDeviceName;
                    _configManager.DocVideoInfo.ColorSpace   = SelectedDocColorSpace.Colorsapce;
                }
                if (!string.IsNullOrEmpty(SelectedDocDevice) || !string.IsNullOrEmpty(SelectedCameraDevice))
                {
                    _localDataManager.SaveSettingConfigData(_configManager);
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"视频设置SaveSetting() exception:{ex}");
                MessageQueueManager.Instance.AddError(ex.Message);
            }
        }