Exemple #1
0
        internal RtpSender(IRtpSession rtpSession, string name, PayloadType payloadType, Hashtable priExns, Hashtable paraPay)
        {
            if (Thread.CurrentThread.Name == null)
            {
                Thread.CurrentThread.Name = "RtpSender - " + name;
            }

            this.rtpSession  = rtpSession;
            this.payloadType = payloadType;
            this.payloadPara = paraPay;

            // Leave everything but CName and Name blank in order to reduce Rtcp bandwidth
            sdes = new SdesData(rtpSession.Sdes.CName, name);

            // Add private extensions
            sdes.SetPrivateExtension(Rtcp.PEP_SOURCE, Rtcp.PED_STREAM);
            sdes.SetPrivateExtension(Rtcp.PEP_PAYLOADTYPE, ((int)payloadType).ToString());

            InitializeNetwork();
            InitializeFrame();
            InitializePerformanceCounters();

            // This needs to be called after InitializeNetwork
            if (priExns != null)
            {
                foreach (DictionaryEntry de in priExns)
                {
                    sdes.SetPrivateExtension((string)de.Key, (string)de.Value);
                }

                string dbpString = (string)priExns[Rtcp.PEP_DBP];
                if (dbpString != null)
                {
                    DelayBetweenPackets = short.Parse(dbpString);
                }
            }

            ResetState();
        }
Exemple #2
0
        internal RtpSender(IRtpSession rtpSession, string name, PayloadType payloadType, Hashtable priExns, Hashtable paraPay)
        {
            if(Thread.CurrentThread.Name == null)
            {
                Thread.CurrentThread.Name = "RtpSender - " + name;
            }

            this.rtpSession = rtpSession;
            this.payloadType = payloadType;
            this.payloadPara = paraPay;

            // Leave everything but CName and Name blank in order to reduce Rtcp bandwidth
            sdes = new SdesData(rtpSession.Sdes.CName, name);

            // Add private extensions
            sdes.SetPrivateExtension(Rtcp.PEP_SOURCE, Rtcp.PED_STREAM);
            sdes.SetPrivateExtension(Rtcp.PEP_PAYLOADTYPE, ((int)payloadType).ToString());

            InitializeNetwork();
            InitializeFrame();
            InitializePerformanceCounters();

            // This needs to be called after InitializeNetwork
            if( priExns != null )
            {
                foreach(DictionaryEntry de in priExns)
                {
                    sdes.SetPrivateExtension((string)de.Key, (string)de.Value);
                }

                string dbpString = (string)priExns[Rtcp.PEP_DBP];
                if( dbpString != null )
                    DelayBetweenPackets = short.Parse(dbpString);
            }

            ResetState();
        }