/// <summary> /// Default constructor. /// </summary> /// <param name="source">RTP source.</param> /// <exception cref="ArgumentNullException">Is raised when <b>source</b> is null reference.</exception> public RTP_SourceInfo(RTP_Source source) { if (source == null) { throw new ArgumentNullException("source"); } m_pSource = source; }
/// <summary> /// This method is called when participant source state changes. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event data.</param> private void Source_StateChanged(object sender, EventArgs e) { if (m_IsDisposed) { return; } RTP_Source source = (RTP_Source)sender; if (source.State == RTP_SourceState.Disposed) { return; } // Move processing to UI thread. this.BeginInvoke(new MethodInvoker(delegate(){ TreeNode nodeParticipant = null; if (source is RTP_Source_Remote) { nodeParticipant = FindParticipantNode(((RTP_Source_Remote)source).Participant); } else { nodeParticipant = FindParticipantNode(((RTP_Source_Local)source).Participant); } if (nodeParticipant != null) { foreach (TreeNode nodeSource in nodeParticipant.Nodes[0].Nodes) { if (nodeSource.Text == source.SSRC.ToString()) { if (source.State == RTP_SourceState.Active) { TreeNode nodeSourceStream = nodeSource.Nodes.Add("RTP Stream"); if (source is RTP_Source_Local) { nodeSourceStream.Tag = new RTP_SendStreamInfo(((RTP_Source_Local)source).Stream); } else { nodeSourceStream.Tag = new RTP_ReceiveStreamInfo(((RTP_Source_Remote)source).Stream); } } break; } } } })); }