コード例 #1
0
        public bool GetLiveParam()
        {
            AggregatedConfig configManager = GlobalData.Instance.AggregatedConfig;

            try
            {
                if (configManager?.LocalLiveStreamInfo == null)
                {
                    return(false);
                }
                LiveParam = new PublishLiveStreamParameter
                {
                    LiveParameter = new LiveParameter()
                    {
                        AudioBitrate  = 64,
                        BitsPerSample = 16,
                        Channels      = 2,
                        IsLive        = true,
                        IsRecord      = false,
                        SampleRate    = 48000,
                        VideoBitrate  = configManager.LocalLiveStreamInfo.LiveStreamBitRate,
                        Width         = configManager.LocalLiveStreamInfo.LiveStreamDisplayWidth,
                        Height        = configManager.LocalLiveStreamInfo.LiveStreamDisplayHeight,
                        Url1          = GlobalData.Instance.AggregatedConfig.LocalLiveStreamInfo.PushLiveStreamUrl,
                    }
                };
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"【get server push live param exception】:{ex}");
                return(false);
            }
            return(true);
        }
コード例 #2
0
        public static VideoInfo GetVideoInfo(string sourceName)
        {
            VideoInfo videoInfo = null;

            AggregatedConfig configManager = GlobalData.Instance.AggregatedConfig;

            if (sourceName == configManager.MainVideoInfo.VideoDevice)
            {
                return(configManager.MainVideoInfo);
            }

            if (sourceName == configManager.DocVideoInfo.VideoDevice)
            {
                return(configManager.DocVideoInfo);
            }

            if (sourceName == "DesktopCapture")
            {
                videoInfo = new VideoInfo();

                videoInfo.DisplayWidth  = 1280;
                videoInfo.DisplayHeight = 720;
                videoInfo.VideoBitRate  = 1200;
                videoInfo.ColorSpace    = (int)VideoColorSpace.YUY2;
                return(videoInfo);
            }

            return(videoInfo);
        }
コード例 #3
0
        //methods
        public void InitializeBindingDataSource()
        {
            CachedCameras     = new List <string>();
            CachedMicrophones = new List <string>();
            CachedSpeakers    = new List <string>();

            MainCameras      = new ObservableCollection <string>();
            SecondaryCameras = new ObservableCollection <string>();

            MainMicrophones        = new ObservableCollection <string>();
            SecondaryMicrophones   = new ObservableCollection <string>();
            Speakers               = new List <string>();
            MeetingConfigResult    = new AggregatedConfig();
            MeetingConfigParameter = new MeetingSetting();

            ConfigItemTag = new ConfigItemTag();
        }
コード例 #4
0
        public static AudioInfo GetAudioInfo(string sourceName)
        {
            AudioInfo audioInfo = null;


            AggregatedConfig configManager = GlobalData.Instance.AggregatedConfig;

            if (sourceName == configManager.AudioInfo.AudioSammpleDevice || sourceName == configManager.AudioInfo.DocAudioSammpleDevice)
            {
                return(configManager.AudioInfo);
            }

            audioInfo = new AudioInfo()
            {
                AAC        = 64000,
                SampleRate = 48000,
            };

            return(audioInfo);
        }
コード例 #5
0
        public bool GetRecordParam()
        {
            AggregatedConfig configManager = GlobalData.Instance.AggregatedConfig;

            try
            {
                if (configManager?.RecordInfo == null)
                {
                    return(false);
                }
                RecordParam = new PublishLiveStreamParameter()
                {
                    LiveParameter = new LiveParameter()
                    {
                        AudioBitrate  = 64,
                        BitsPerSample = 16,
                        Channels      = 2,
                        SampleRate    = configManager.AudioInfo.SampleRate,
                        VideoBitrate  = configManager.RecordInfo.RecordBitRate,
                        Width         = configManager.RecordInfo.RecordDisplayWidth,
                        Height        = configManager.RecordInfo.RecordDisplayHeight,
                        IsRecord      = true,
                        IsLive        = false,
                        FilePath      = configManager.RecordInfo.RecordDirectory,
                    },
                    MediaType  = MediaType.StreamMedia,
                    StreamType = StreamType.Live,
                };

                RecordDirectory = configManager.RecordInfo.RecordDirectory;

                return(true);
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"【get record param exception】:{ex}");
                return(false);
            }
        }
コード例 #6
0
        public void CloneConfig(AggregatedConfig newConfig)
        {
            RunEnvironment    = newConfig.RunEnvironment;
            UserCenterAddress = newConfig.UserCenterAddress;
            RtServerAddress   = newConfig.RtServerAddress;
            ServerVersionInfo = newConfig.ServerVersionInfo;
            DeviceNo          = newConfig.DeviceNo;
            DeviceKey         = newConfig.DeviceKey;

            AccountAutoLogin.IsAutoLogin = newConfig.AccountAutoLogin.IsAutoLogin;
            AccountAutoLogin.UserName    = newConfig.AccountAutoLogin.UserName;
            AccountAutoLogin.Password    = newConfig.AccountAutoLogin.Password;

            MainCamera.CodeRate   = newConfig.MainCamera.CodeRate;
            MainCamera.Name       = newConfig.MainCamera.Name;
            MainCamera.Resolution = newConfig.MainCamera.Resolution;

            SecondaryCamera.CodeRate   = newConfig.SecondaryCamera.CodeRate;
            SecondaryCamera.Name       = newConfig.SecondaryCamera.Name;
            SecondaryCamera.Resolution = newConfig.SecondaryCamera.Resolution;

            AudioConfig.CodeRate            = newConfig.AudioConfig.CodeRate;
            AudioConfig.MainMicrophone      = newConfig.AudioConfig.MainMicrophone;
            AudioConfig.SampleRate          = newConfig.AudioConfig.SampleRate;
            AudioConfig.SecondaryMicrophone = newConfig.AudioConfig.SecondaryMicrophone;
            AudioConfig.Speaker             = newConfig.AudioConfig.Speaker;

            LocalLiveConfig.CodeRate          = newConfig.LocalLiveConfig.CodeRate;
            LocalLiveConfig.Resolution        = newConfig.LocalLiveConfig.Resolution;
            LocalLiveConfig.PushLiveStreamUrl = newConfig.LocalLiveConfig.PushLiveStreamUrl;
            LocalLiveConfig.IsEnabled         = newConfig.LocalLiveConfig.IsEnabled;
            RemoteLiveConfig.CodeRate         = newConfig.RemoteLiveConfig.CodeRate;
            RemoteLiveConfig.Resolution       = newConfig.RemoteLiveConfig.Resolution;
            RemoteLiveConfig.IsEnabled        = newConfig.RemoteLiveConfig.IsEnabled;
            RecordConfig.CodeRate             = newConfig.RecordConfig.CodeRate;
            RecordConfig.Resolution           = newConfig.RecordConfig.Resolution;
            RecordConfig.RecordPath           = newConfig.RecordConfig.RecordPath;
        }