예제 #1
0
        public static string QoSBandwidthToString(tmedia_bandwidth_level_t bl)
        {
            switch (bl)
            {
            case tmedia_bandwidth_level_t.tmedia_bl_low:
            {
                string result = "Low";
                return(result);
            }

            case tmedia_bandwidth_level_t.tmedia_bl_medium:
            {
                string result = "Medium";
                return(result);
            }

            case tmedia_bandwidth_level_t.tmedia_bl_hight:
            {
IL_17:
                string result = "High";
                return(result);
            }
            }

            return("");
            //goto IL_17;
        }
예제 #2
0
        String BandwidthToString(tmedia_bandwidth_level_t bl)
        {
            switch (bl)
            {
            case tmedia_bandwidth_level_t.tmedia_bl_hight:
            default:
                return(ScreenOptions.QOS_BANDWIDTH_HIGH);

            case tmedia_bandwidth_level_t.tmedia_bl_low:
                return(ScreenOptions.QOS_BANDWIDTH_LOW);

            case tmedia_bandwidth_level_t.tmedia_bl_medium:
                return(QOS_BANDWIDTH_MEDIUM);
            }
        }
예제 #3
0
        public static int QoSMotionRankFromBandwidth(tmedia_bandwidth_level_t bw)
        {
            int result;

            switch (bw)
            {
            case tmedia_bandwidth_level_t.tmedia_bl_low:
                result = 1;
                return(result);

            case tmedia_bandwidth_level_t.tmedia_bl_hight:
            case tmedia_bandwidth_level_t.tmedia_bl_unrestricted:
                result = 4;
                return(result);
            }
            result = 2;
            return(result);
        }
예제 #4
0
        bool UpdateQoS()
        {
            tmedia_pref_video_size_t prefVideoSize  = (this.comboBoxPrefVideoSize.SelectedValue as PrefVideoSize).Value;
            tmedia_bandwidth_level_t bandwidthLevel = Configuration.QoSBandwidthFromString(this.comboBoxPreconditionBandwidth.SelectedValue.ToString());

            this.configurationService.Set(Configuration.ConfFolder.QOS, Configuration.ConfEntry.PREF_VIDEO_SIZE, prefVideoSize.ToString());
            this.configurationService.Set(Configuration.ConfFolder.QOS, Configuration.ConfEntry.USE_ZERO_VIDEO_ARTIFACTS,
                                          this.checkBoxZeroVideoArtifactsEnable.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS,
                                          this.checkBoxSessionTimersEnable.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS_REFRESHER, this.comboBoxSessionTimerRefreser.SelectedValue.ToString());
            this.configurationService.Set(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS_TIMEOUT, this.textBoxSessionTimersTimeout.Text);

            this.configurationService.Set(Configuration.ConfFolder.QOS, Configuration.ConfEntry.PRECOND_STRENGTH,
                                          Configuration.QoSStrengthFromString(this.comboBoxPreconditionStrength.SelectedValue.ToString()).ToString());
            this.configurationService.Set(Configuration.ConfFolder.QOS, Configuration.ConfEntry.PRECOND_TYPE,
                                          Configuration.QoSTypeFromString(this.comboBoxPreconditionType.SelectedValue.ToString()).ToString());
            this.configurationService.Set(Configuration.ConfFolder.QOS, Configuration.ConfEntry.BANDWIDTH, bandwidthLevel.ToString());


            // Transmit values to the native part (global)
            if (this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS, Configuration.DEFAULT_QOS_SESSION_TIMERS))
            {
                MediaSessionMgr.defaultsSetInviteSessionTimers(
                    this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS_TIMEOUT, Configuration.DEFAULT_QOS_SESSION_TIMERS_TIMEOUT),
                    this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS_REFRESHER, Configuration.DEFAULT_QOS_SESSION_TIMERS_REFRESHER));
            }
            else
            {
                MediaSessionMgr.defaultsSetInviteSessionTimers(0, null);
            }
            MediaSessionMgr.defaultsSetPrefVideoSize(prefVideoSize);
            MediaSessionMgr.defaultsSetVideoZeroArtifactsEnabled(this.checkBoxZeroVideoArtifactsEnable.IsChecked.Value);
            MediaSessionMgr.defaultsSetVideoMotionRank(Configuration.QoSMotionRankFromBandwidth(bandwidthLevel));

            return(true);
        }
예제 #5
0
        public static tmedia_bandwidth_level_t defaultsGetBandwidthLevel()
        {
            tmedia_bandwidth_level_t ret = (tmedia_bandwidth_level_t)tinyWRAPPINVOKE.MediaSessionMgr_defaultsGetBandwidthLevel();

            return(ret);
        }
예제 #6
0
        public static bool defaultsSetBandwidthLevel(tmedia_bandwidth_level_t bl)
        {
            bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetBandwidthLevel((int)bl);

            return(ret);
        }
 public static bool defaultsSetBandwidthLevel(tmedia_bandwidth_level_t bl)
 {
     bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetBandwidthLevel((int)bl);
     return ret;
 }
예제 #8
0
        /// <summary>
        /// Starts the manager
        /// </summary>
        /// <returns></returns>
        public bool Start()
        {
            bool ret = true;

            LOG.Debug("Start Service Manager");


            ret &= this.LogService.Start();
            ret &= this.ConfigurationService.Start();

            ret &= this.Win32ScreenService.Start();
            ret &= this.SipService.Start();
            ret &= this.XcapService.Start();
            ret &= this.ContactService.Start();
            ret &= this.HistoryService.Start();
            ret &= this.SoundService.Start();
            ret &= this.StateMonitorService.Start();

            // Register plugins
            // MediaSessionMgr.registerAudioPluginFromFile("audio_webrtc.dll");

            // Set user preferences (global defaults)
            // could be changed per session
            MediaSessionMgr.defaultsSetAgcEnabled(true);
            MediaSessionMgr.defaultsSetEchoSuppEnabled(true);
            MediaSessionMgr.defaultsSetEchoTail(100);
            MediaSessionMgr.defaultsSetEchoSkew(0);
            MediaSessionMgr.defaultsSetNoiseSuppEnabled(true);
            MediaSessionMgr.defaultsSetVadEnabled(false);
            MediaSessionMgr.defaultsSetJbMaxLateRate(1);
            MediaSessionMgr.defaultsSetRtcpEnabled(true);
            MediaSessionMgr.defaultsSetRtcpMuxEnabled(true);
            MediaSessionMgr.defaultsSetOpusMaxCaptureRate(16000); /* Because of WebRTC AEC only 8000 and 16000 are supported */
            MediaSessionMgr.defaultsSetOpusMaxPlaybackRate(48000);
            MediaSessionMgr.defaultsSetAudioChannels(1, 1);       // mono for both
            MediaSessionMgr.defaultsSetAudioPtime(20);
            MediaSessionMgr.defaultsSetVideoFps(15);              // default video FPS. Will be updated using the SDP.
            MediaSessionMgr.defaultsSetAvpfMode(tmedia_mode_t.tmedia_mode_optional);
            MediaSessionMgr.defaultsSetBandwidthVideoDownloadMax(-1);
            MediaSessionMgr.defaultsSetBandwidthVideoUploadMax(-1);
            MediaSessionMgr.defaultsSetCongestionCtrlEnabled(true);

            tmedia_bandwidth_level_t bandwidthLevel = (tmedia_bandwidth_level_t)Enum.Parse(typeof(tmedia_bandwidth_level_t), this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.BANDWIDTH, Configuration.DEFAULT_QOS_BANDWIDTH));

            MediaSessionMgr.defaultsSetVideoMotionRank(Configuration.QoSMotionRankFromBandwidth(bandwidthLevel));

            MediaSessionMgr.defaultsSetVolume(this.ConfigurationService.Get(Configuration.ConfFolder.GENERAL, Configuration.ConfEntry.AUDIO_VOLUME, Configuration.DEFAULT_GENERAL_AUDIO_VOLUME));
            if (this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS, Configuration.DEFAULT_QOS_SESSION_TIMERS))
            {
                MediaSessionMgr.defaultsSetInviteSessionTimers(
                    this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS_TIMEOUT, Configuration.DEFAULT_QOS_SESSION_TIMERS_TIMEOUT),
                    this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS_REFRESHER, Configuration.DEFAULT_QOS_SESSION_TIMERS_REFRESHER));
            }
            else
            {
                MediaSessionMgr.defaultsSetInviteSessionTimers(0, null);
            }
            MediaSessionMgr.defaultsSetVideoZeroArtifactsEnabled(this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.USE_ZERO_VIDEO_ARTIFACTS, Configuration.DEFAULT_QOS_USE_ZERO_VIDEO_ARTIFACTS));
            MediaSessionMgr.defaultsSetPrefVideoSize(
                (tmedia_pref_video_size_t)Enum.Parse(typeof(tmedia_pref_video_size_t), this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.PREF_VIDEO_SIZE, Configuration.DEFAULT_QOS_PREF_VIDEO_SIZE), true)
                );

            MediaSessionMgr.defaultsSetSRtpMode(
                (tmedia_srtp_mode_t)Enum.Parse(typeof(tmedia_srtp_mode_t), this.configurationService.Get(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.SRTP_MODE, Configuration.DEFAULT_SECURITY_SRTP_MODE), true)
                );

            MediaSessionMgr.defaultsSetSRtpType(
                (tmedia_srtp_type_t)Enum.Parse(typeof(tmedia_srtp_type_t), this.configurationService.Get(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.SRTP_TYPE, Configuration.DEFAULT_SECURITY_SRTP_TYPE), true)
                );

            MediaSessionMgr.defaultsSetProfile(
                (tmedia_profile_t)Enum.Parse(typeof(tmedia_profile_t), this.configurationService.Get(Configuration.ConfFolder.MEDIA, Configuration.ConfEntry.PROFILE, Configuration.DEFAULT_MEDIA_PROFILE), true)
                );

            MediaSessionMgr.defaultsSetRtpSymetricEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_SYMETRIC_RTP, Configuration.DEFAULT_NATT_USE_SYMETRIC_RTP)
                );
            MediaSessionMgr.defaultsSetIceEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_ICE, Configuration.DEFAULT_NATT_USE_ICE)
                );
            MediaSessionMgr.defaultsSetStunEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_STUN_FOR_SIP, Configuration.DEFAULT_NATT_USE_STUN_FOR_SIP)
                );
            MediaSessionMgr.defaultsSetIceStunEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_STUN_FOR_ICE, Configuration.DEFAULT_NATT_USE_STUN_FOR_ICE)
                );
            MediaSessionMgr.defaultsSetIceTurnEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_TURN_FOR_ICE, Configuration.DEFAULT_NATT_USE_TURN_FOR_ICE)
                );
            MediaSessionMgr.defaultsSetStunServer(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_SERVER, Configuration.DEFAULT_NATT_STUN_SERVER),
                (ushort)this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_PORT, Configuration.DEFAULT_NATT_STUN_PORT)
                );
            MediaSessionMgr.defaultsSetStunCred(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_USERNAME, Configuration.DEFAULT_NATT_STUN_USERNAME),
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_PASSWORD, Configuration.DEFAULT_NATT_STUN_PASSWORD)
                );

            return(ret);
        }
예제 #9
0
 String BandwidthToString(tmedia_bandwidth_level_t bl)
 {
     switch (bl)
     {
         case tmedia_bandwidth_level_t.tmedia_bl_hight:
         default:
             return ScreenOptions.QOS_BANDWIDTH_HIGH;
         case tmedia_bandwidth_level_t.tmedia_bl_low:
             return ScreenOptions.QOS_BANDWIDTH_LOW;
         case tmedia_bandwidth_level_t.tmedia_bl_medium:
             return QOS_BANDWIDTH_MEDIUM;
     }
 }