Example #1
0
        internal static RtpStream CreateStream(RtpListener rtpListener, uint ssrc, string ipaddress, SdesData sdes)
        {
            string sPT = sdes.GetPrivateExtension(Rtcp.PEP_PAYLOADTYPE);
            PayloadType pt = (PayloadType)Enum.Parse(typeof(PayloadType), sPT);

            // RtpStreamFec
            string fecData = sdes.GetPrivateExtension(Rtcp.PEP_FEC);
            if(fecData != null)
            {
                string[] args = fecData.Split(new char[]{':'});
                ushort dataPxExp = ushort.Parse(args[0]);
                ushort fecPxExp = ushort.Parse(args[1]);

                if(fecPxExp == 0)
                {
                    throw new ArgumentOutOfRangeException("fecPxExp", fecPxExp, "Must be >= 1");
                }
                
                // Frame based Fec
                if(dataPxExp == 0)
                {
                    return new RtpStreamFFec(rtpListener, ssrc, ipaddress, sdes, pt, fecPxExp);
                }
                else // Constant Fec
                {
                    return new RtpStreamCFec(rtpListener, ssrc, ipaddress, sdes, pt, dataPxExp, fecPxExp);
                }
            }

            // RtpStream
            return new RtpStream(rtpListener, ssrc, ipaddress,sdes, pt);
        }
Example #2
0
        internal static RtpStream CreateStream(RtpListener rtpListener, uint ssrc, string ipaddress, SdesData sdes)
        {
            string      sPT = sdes.GetPrivateExtension(Rtcp.PEP_PAYLOADTYPE);
            PayloadType pt  = (PayloadType)Enum.Parse(typeof(PayloadType), sPT);

            // RtpStreamFec
            string fecData = sdes.GetPrivateExtension(Rtcp.PEP_FEC);

            if (fecData != null)
            {
                string[] args      = fecData.Split(new char[] { ':' });
                ushort   dataPxExp = ushort.Parse(args[0]);
                ushort   fecPxExp  = ushort.Parse(args[1]);

                if (fecPxExp == 0)
                {
                    throw new ArgumentOutOfRangeException("fecPxExp", fecPxExp, "Must be >= 1");
                }

                // Frame based Fec
                if (dataPxExp == 0)
                {
                    return(new RtpStreamFFec(rtpListener, ssrc, ipaddress, sdes, pt, fecPxExp));
                }
                else // Constant Fec
                {
                    return(new RtpStreamCFec(rtpListener, ssrc, ipaddress, sdes, pt, dataPxExp, fecPxExp));
                }
            }

            // RtpStream
            return(new RtpStream(rtpListener, ssrc, ipaddress, sdes, pt));
        }
Example #3
0
        internal static RtpStream CreateStream2(RtpListener rtpListener, uint ssrc, string ipaddress, SdesData sdes)
        {
            string sPT = sdes.GetPrivateExtension(Rtcp.PEP_PAYLOADTYPE);
            PayloadType pt = PayloadType.JPEG;

            // RtpStream
            return new RtpStream(rtpListener, ssrc, ipaddress, sdes, pt);
        }
Example #4
0
        internal static RtpStream CreateStream2(RtpListener rtpListener, uint ssrc, string ipaddress, SdesData sdes)
        {
            string      sPT = sdes.GetPrivateExtension(Rtcp.PEP_PAYLOADTYPE);
            PayloadType pt  = PayloadType.JPEG;

            // RtpStream
            return(new RtpStream(rtpListener, ssrc, ipaddress, sdes, pt));
        }