/// <summary> /// Default constructor. /// </summary> /// <param name="stream">RTP receive stream.</param> public RTP_ReceiveStreamInfo(RTP_ReceiveStream stream) { if (stream == null) { throw new ArgumentNullException("stream"); } m_pStream = stream; }
/// <summary> /// Cleans up any resource being used. /// </summary> public void Dispose() { if (m_IsDisposed) { return; } Stop(); this.Error = null; m_pAudioOutDevice = null; m_pRTP_Stream = null; m_pAudioCodecs = null; m_pActiveCodec = null; }
/// <summary> /// Default constructor. /// </summary> /// <param name="audioOutDevice">Audio-out device used to play out RTP audio.</param> /// <param name="stream">RTP receive stream which audio to play.</param> /// <param name="codecs">Audio codecs with RTP payload number. For example: 0-PCMU,8-PCMA.</param> /// <exception cref="ArgumentNullException">Is raised when <b>audioOutDevice</b>,<b>stream</b> or <b>codecs</b> is null reference.</exception> public AudioOut_RTP(AudioOutDevice audioOutDevice,RTP_ReceiveStream stream,Dictionary<int,AudioCodec> codecs) { if(audioOutDevice == null){ throw new ArgumentNullException("audioOutDevice"); } if(stream == null){ throw new ArgumentNullException("stream"); } if(codecs == null){ throw new ArgumentNullException("codecs"); } m_pAudioOutDevice = audioOutDevice; m_pRTP_Stream = stream; m_pAudioCodecs = codecs; }
/// <summary> /// Default constructor. /// </summary> /// <param name="audioOutDevice">Audio-out device used to play out RTP audio.</param> /// <param name="stream">RTP receive stream which audio to play.</param> /// <param name="codecs">Audio codecs with RTP payload number. For example: 0-PCMU,8-PCMA.</param> /// <exception cref="ArgumentNullException">Is raised when <b>audioOutDevice</b>,<b>stream</b> or <b>codecs</b> is null reference.</exception> public AudioOut_RTP(AudioOutDevice audioOutDevice, RTP_ReceiveStream stream, Dictionary <int, AudioCodec> codecs) { if (audioOutDevice == null) { throw new ArgumentNullException("audioOutDevice"); } if (stream == null) { throw new ArgumentNullException("stream"); } if (codecs == null) { throw new ArgumentNullException("codecs"); } m_pAudioOutDevice = audioOutDevice; m_pRTP_Stream = stream; m_pAudioCodecs = codecs; }
/// <summary> /// Default constructor. /// </summary> /// <param name="stream">RTP receive stream.</param> /// <param name="codecs">Audio codecs with RTP payload number. For example: 0-PCMU,8-PCMA.</param> public wfrm_Receive(RTP_ReceiveStream stream, Dictionary <int, AudioCodec> codecs) { if (stream == null) { throw new ArgumentNullException("stream"); } if (codecs == null) { throw new ArgumentNullException("codecs"); } // Force window handle creation. IntPtr handle = this.Handle; m_pRTP_Stream = stream; m_AudioCodecs = codecs; InitUI(); m_pTimer = new Timer(); m_pTimer.Interval = 500; m_pTimer.Tick += delegate(object s1, EventArgs e1){ try{ if (m_pRTP_Stream.IsDisposed) { return; } m_pCodec.Text = m_pAudioOut.ActiveCodec != null ? m_pAudioOut.ActiveCodec.Name : "unknown"; m_pPacketsReceived.Text = m_pRTP_Stream.PacketsReceived.ToString(); m_pKBReceived.Text = (m_pRTP_Stream.BytesReceived / 1000).ToString("n2"); } catch { } }; m_pTimer.Start(); }