Пример #1
0
        public OpusCodec(OpusEchoCanceller echoCanceller)
            : base(20)
        {
            EchoCanceller           = echoCanceller;
            DisableFEC              = false;
            PercentLossToTriggerFEC = 5;

            _Padep = new BasicAudioPadep();
        }
Пример #2
0
		public OpusCodec(OpusEchoCanceller echoCanceller)
			: base(20)
		{
            EchoCanceller = echoCanceller;
            DisableFEC = false;
            PercentLossToTriggerFEC = 5;

			_Padep = new BasicAudioPadep();
		}
		// TODO: will move to dispose
		/// <summary>
		/// Stops the conference.
		/// </summary>
		/// <returns>The conference.</returns>
		private void StopConference()
		{
			try
			{
#if __ANDROID__
				// Stop echo canceller.
				OpusEchoCanceller.Stop();
				OpusEchoCanceller = null;
#endif
				conference.OnLinkInit -= LogLinkInit;
				conference.OnLinkUp -= LogLinkUp;
				conference.OnLinkDown -= LogLinkDown;

				conference.OnLinkOfferAnswer -= OnLinkSendOfferAnswer;
				conference.OnLinkCandidate -= OnLinkSendCandidate;
				conference = null;

				videoStream.OnLinkInit -= AddRemoteVideoControl;
				videoStream.OnLinkDown -= RemoveRemoteVideoControl;
				videoStream = null;

				audioStream = null;
			}
			catch (Exception ex)
			{
				FM.Log.Debug(ex.ToString());
			}
		}
		public ConferenceWrapper(string sessionId, 
		                         LocalMedia localMedia)
		{
			this.LocalMedia = localMedia;
			InitAudioAndVideoStreams();

			// Create a conference using our stream descriptions.
			conference = new FM.IceLink.Conference(this.IceServers, new Stream[] { audioStream, videoStream });

			// Use our pre-generated DTLS certificate.
			conference.DtlsCertificate = Certificate;

			// Supply TURN relay credentials in case we are behind a
			// highly restrictive firewall. These credentials will be
			// verified by the TURN server.
			conference.RelayUsername = "******";
			conference.RelayPassword = "******";
			conference.ServerPort = 3478;

			// Add a few event handlers to the conference so we can see
			// when a new P2P link is created or changes state.
			conference.OnLinkInit += LogLinkInit;
			conference.OnLinkUp += LogLinkUp;
			conference.OnLinkDown += LogLinkDown;

			conference.OnLinkOfferAnswer += OnLinkSendOfferAnswer;
			conference.OnLinkCandidate += OnLinkSendCandidate;
			conference.Timeout = ConferenceTimeout;

#if __ANDROID__
			// Start echo canceller.
			OpusEchoCanceller = new OpusEchoCanceller(OpusClockRate, OpusChannels);
			OpusEchoCanceller.Start();
#endif

			this.sessionId = sessionId;
		}