/// <summary>
        /// Cleans up any resources being used.
        /// </summary>
        internal void Dispose()
        {
            if (m_IsDisposed)
            {
                return;
            }
            m_IsDisposed = true;

            m_pSession = null;
            m_pParticipant = null;

            Closed = null;
            Timeout = null;
            SenderReport = null;
            PacketReceived = null;
        }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Owner RTP session.</param>
 /// <param name="ssrc">Synchronization source ID.</param>
 /// <exception cref="ArgumentNullException">Is raised when <b>session</b> is null reference.</exception>
 internal RTP_Source_Remote(RTP_Session session, uint ssrc) : base(session, ssrc) {}
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="session">Owner RTP session.</param>
        /// <param name="ssrc">Onwer synchronization source.</param>
        /// <param name="packetSeqNo">RTP packet <b>SeqNo</b> value.</param>
        /// <exception cref="ArgumentNullException">Is riased when <b>session</b> or <b>ssrc</b> is null reference.</exception>
        internal RTP_ReceiveStream(RTP_Session session, RTP_Source ssrc, ushort packetSeqNo)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (ssrc == null)
            {
                throw new ArgumentNullException("ssrc");
            }

            m_pSession = session;
            m_pSSRC = ssrc;

            // RFC 3550 A.1.
            InitSeq(packetSeqNo);
            m_MaxSeqNo = (ushort) (packetSeqNo - 1);
            m_Probation = MIN_SEQUENTIAL;
        }
Exemple #4
0
        /// <summary>
        /// Cleans up any resources being used.
        /// </summary>
        internal virtual void Dispose()
        {
            if (m_State == RTP_SourceState.Disposed)
            {
                return;
            }
            OnDisposing();
            SetState(RTP_SourceState.Disposed);

            m_pSession = null;
            m_pRtcpEP = null;
            m_pRtpEP = null;

            Closed = null;
            Disposing = null;
            StateChanged = null;
        }
Exemple #5
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="session">Owner RTP session.</param>
        /// <param name="ssrc">Synchronization source ID.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>session</b> is null reference.</exception>
        internal RTP_Source(RTP_Session session, uint ssrc)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            m_pSession = session;
            m_SSRC = ssrc;
        }
        /// <summary>
        /// Raises <b>SessionCreated</b> event.
        /// </summary>
        /// <param name="session">RTP session.</param>
        private void OnSessionCreated(RTP_Session session)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            if (SessionCreated != null)
            {
                SessionCreated(this, new EventArgs<RTP_Session>(session));
            }
        }
        /// <summary>
        /// Creates new RTP session.
        /// </summary>
        /// <param name="localEP">Local RTP end point.</param>
        /// <param name="clock">RTP media clock.</param>
        /// <returns>Returns created session.</returns>
        /// <exception cref="ObjectDisposedException">Is raised when this class is Disposed and this method is accessed.</exception>
        /// <exception cref="ArgumentNullException">Is raised when <b>localEP</b> or <b>clock</b> is null reference.</exception>
        public RTP_Session CreateSession(RTP_Address localEP, RTP_Clock clock)
        {
            if (m_IsDisposed)
            {
                throw new ObjectDisposedException(GetType().Name);
            }
            if (localEP == null)
            {
                throw new ArgumentNullException("localEP");
            }
            if (clock == null)
            {
                throw new ArgumentNullException("clock");
            }

            RTP_Session session = new RTP_Session(this, localEP, clock);
            session.Disposed += delegate(object s, EventArgs e) { m_pSessions.Remove((RTP_Session) s); };
            m_pSessions.Add(session);

            OnSessionCreated(session);

            return session;
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="session">Owner RTP session.</param>
        /// <param name="ssrc">Synchronization source ID.</param>
        /// <param name="rtcpEP">RTCP end point.</param>
        /// <param name="rtpEP">RTP end point.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>session</b>,<b>rtcpEP</b> or <b>rtpEP</b> is null reference.</exception>
        internal RTP_Source_Local(RTP_Session session, uint ssrc, IPEndPoint rtcpEP, IPEndPoint rtpEP)
            : base(session, ssrc)
        {
            if (rtcpEP == null)
            {
                throw new ArgumentNullException("rtcpEP");
            }
            if (rtpEP == null)
            {
                throw new ArgumentNullException("rtpEP");
            }

            SetRtcpEP(rtcpEP);
            SetRtpEP(rtpEP);
        }