internal RtcpSender(IPEndPoint destinationEP, IRtpSession rtpSession) { this.destinationEP = destinationEP; this.rtpSession = rtpSession; Initialize(); }
internal RtpSenderFFec(IRtpSession session, string name, PayloadType pt, Hashtable priExns, ushort cFecPx, uint ssrc) : base(session, name, pt, priExns, ssrc) { fecPercent = cFecPx; pcFecType = 2; }
internal static RtpSender CreateInstance(IRtpSession session, string name, PayloadType pt, Hashtable priExns, ushort cDataPx, ushort cFecPx, uint ssrc) { // Validate before adding to private extensions if (cFecPx == 0) { throw new ArgumentOutOfRangeException("cFecPx", cFecPx, Strings.MustBePositive); } // Add the relevant private extension for FEC Hashtable fecExns = null; if (priExns != null) { fecExns = (Hashtable)priExns.Clone(); } else { fecExns = new Hashtable(); } fecExns[Rtcp.PEP_FEC] = cDataPx.ToString(CultureInfo.InvariantCulture) + ":" + cFecPx.ToString(CultureInfo.InvariantCulture); // Call generic class factory return(CreateInstance(session, name, pt, fecExns, ssrc)); }
/// <summary> /// Class factory for creating all RtpSenders /// </summary> internal static RtpSender CreateInstance(IRtpSession session, string name, PayloadType pt, Hashtable priExns, uint ssrc) { if (priExns != null) { // Fec RtpSenders string fecData = (string)priExns[Rtcp.PEP_FEC]; if (fecData != null) { string[] args = fecData.Split(new char[] { ':' }); ushort cDataPx = ushort.Parse(args[0], CultureInfo.InvariantCulture); ushort cFecPx = ushort.Parse(args[1], CultureInfo.InvariantCulture); // Validates in case private extensions were modified elsewhere than method below if (cFecPx == 0) { throw new ArgumentOutOfRangeException("cFecPx", cFecPx, Strings.MustBePositive); } if (cDataPx == 0) { // Frame based Fec return(new RtpSenderFFec(session, name, pt, priExns, cFecPx, ssrc)); } else { // Constant Fec return(new RtpSenderCFec(session, name, pt, priExns, cDataPx, cFecPx, ssrc)); } } } // Regular old RtpSender return(new RtpSender(session, name, pt, priExns, ssrc)); }
/// <summary> /// Class factory for creating all RtpSenders /// </summary> internal static RtpSender CreateInstance(IRtpSession session, string name, PayloadType pt, Hashtable priExns, Hashtable paraPay) { if(priExns != null) { // Fec RtpSenders string fecData = (string)priExns[Rtcp.PEP_FEC]; if(fecData != null) { string[] args = fecData.Split(new char[]{':'}); ushort cDataPx = ushort.Parse(args[0]); ushort cFecPx = ushort.Parse(args[1]); // Validates in case private extensions were modified elsewhere than method below if(cFecPx == 0) { throw new ArgumentOutOfRangeException("cFecPx", cFecPx, "Must be >= 1"); } if(cDataPx == 0) { // Frame based Fec return new RtpSenderFFec(session, name, pt, priExns, cFecPx); } else { // Constant Fec return new RtpSenderCFec(session, name, pt, priExns, cDataPx, cFecPx); } } } // Regular old RtpSender return new RtpSender(session, name, pt, priExns, paraPay); }
internal RtcpListener(IPEndPoint nextHopEP, IRtpSession rtpSession) { this.rtpSession = rtpSession; this.nextHopEP = nextHopEP; this.groupEP = nextHopEP; Initialize(); }
internal RtpSenderCFec(IRtpSession session, string name, PayloadType pt, Hashtable priExns, ushort cDataPx, ushort cFecPx, uint ssrc) : base(session, name, pt, priExns, ssrc) { pcFecType = 1; this.cDataPx = cDataPx; this.cFecPx = cFecPx; SetEncoder(); InitializeDCStorage(); }
public RtpListener(RtpSession rtpSession) { this.rtpSession = rtpSession; returnBufferHandler = new ReturnBufferHandler(ReturnBuffer); getBufferHandler = new GetBufferHandler(GetBuffer); InitializeBufferPool(); InitializePerformanceCounters(); InitializeNetwork(); InitializeThreads(); }
public RtpListener(IPEndPoint nextHopEP, IPEndPoint groupEP, RtpSession rtpSession) { this.rtpSession = rtpSession; this.nextHopEP = nextHopEP; this.groupEP = groupEP; returnBufferHandler = new ReturnBufferHandler(ReturnBuffer); getBufferHandler = new GetBufferHandler(GetBuffer); InitializeBufferPool(); InitializePerformanceCounters(); InitializeNetwork(); InitializeThreads(); }
internal RtpSender(IRtpSession rtpSession, string name, PayloadType payloadType, Hashtable priExns, uint ssrc) { if (Thread.CurrentThread.Name == null) { Thread.CurrentThread.Name = "RtpSender - " + name; } this.ssrc = ssrc; // 0 indicates that a random value should be chosen... this.rtpSession = rtpSession; this.payloadType = payloadType; // 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(CultureInfo.InvariantCulture)); 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, CultureInfo.InvariantCulture); } } ResetState(); }
internal RtpSenderFec(IRtpSession session, string name, PayloadType pt, Hashtable priExns) : base(session, name, pt, priExns, 0) { }
internal RtcpSender(IRtpSession rtpSession) { this.rtpSession = rtpSession; Initialize(); }
internal static RtpSender CreateInstance(IRtpSession session, string name, PayloadType pt, Hashtable priExns, ushort cDataPx, ushort cFecPx) { return(CreateInstance(session, name, pt, priExns, cDataPx, cFecPx, 0)); }
internal RtcpSender(IPEndPoint destinationEP,IRtpSession rtpSession) { this.destinationEP = destinationEP; this.rtpSession = rtpSession; Initialize(); }
internal static RtpSender CreateInstance(IRtpSession session, string name, PayloadType pt, Hashtable priExns, ushort cDataPx, ushort cFecPx) { return CreateInstance(session, name, pt, priExns, cDataPx, cFecPx, 0); }
internal RtpSenderFFec(IRtpSession session, string name, PayloadType pt, Hashtable priExns, ushort cFecPx) : base(session, name, pt, priExns, null) { fecPercent = cFecPx; pcFecType = 2; }
internal static RtpSender CreateInstance(IRtpSession session, string name, PayloadType pt, Hashtable priExns, ushort cDataPx, ushort cFecPx) { // Validate before adding to private extensions if(cFecPx == 0) { throw new ArgumentOutOfRangeException("cFecPx", cFecPx, "Must be >= 1"); } // Add the relevant private extension for FEC Hashtable fecExns = null; if(priExns != null) { fecExns = (Hashtable)priExns.Clone(); } else { fecExns = new Hashtable(); } fecExns[Rtcp.PEP_FEC] = cDataPx.ToString() + ":" + cFecPx.ToString(); // Call generic class factory return CreateInstance(session, name, pt, fecExns, null); }
internal RtpSenderFec(IRtpSession session, string name, PayloadType pt, Hashtable priExns,uint ssrc) : base(session, name, pt, priExns,ssrc) {}
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(); }
internal RtpSenderFec(IRtpSession session, string name, PayloadType pt, Hashtable priExns, Hashtable paraPay) : base(session, name, pt, priExns, paraPay) {}
internal RtpSenderCFec(IRtpSession session, string name, PayloadType pt, Hashtable priExns, ushort cDataPx, ushort cFecPx) : base(session, name, pt, priExns, null) { pcFecType = 1; this.cDataPx = cDataPx; this.cFecPx = cFecPx; SetEncoder(); InitializeDCStorage(); }