public void SSRCMapDataSetup(string sdp, string streamType, string reportType)
        {
            var dict = Instance.ParseSdp(sdp, "a=ssrc:");

            foreach (var d in dict)
            {
                SSRCData ssrcData = new SSRCData();

                ssrcData.ssrc = d.Key;

                foreach (var k in d.Value)
                {
                    if (k.Key == "cname")
                    {
                        ssrcData.cname = k.Value.Replace("\r", "");
                    }

                    if (k.Key == "msid")
                    {
                        ssrcData.msid = k.Value.Replace("\r", "");
                    }

                    if (k.Key == "mslabel")
                    {
                        ssrcData.mslabel = k.Value.Replace("\r", "");
                    }

                    if (k.Key == "label")
                    {
                        ssrcData.label = k.Value.Replace("\r", "");

                        if (k.Value.ToLower().Contains("audio"))
                        {
                            ssrcData.mediaType = "audio";
                        }

                        if (k.Value.ToLower().Contains("video"))
                        {
                            ssrcData.mediaType = "video";
                        }

                        if (k.Value.ToLower().Contains("screen"))
                        {
                            ssrcData.mediaType = "screen";
                        }
                    }
                }

                ssrcData.streamType     = streamType;
                ssrcData.reportType     = reportType;
                ssrcData.userID         = userID;
                ssrcData.localStartTime = DateTime.UtcNow.ToUnixTimeStampMiliseconds();

                Instance.ssrcDataList.Add(ssrcData);
            }
        }
Beispiel #2
0
        public void SSRCMapDataSetup(string sdp)
        {
            var dict = ParseSdp(sdp, "a=ssrc:");

            foreach (var d in dict)
            {
                SSRCData ssrcData = new SSRCData();

                ssrcData.ssrc = d.Key;

                foreach (var k in d.Value)
                {
                    if (k.Key == "cname")
                    {
                        ssrcData.cname = k.Value;
                    }
                    if (k.Key == "msid")
                    {
                        ssrcData.msid = k.Value;
                    }
                    if (k.Key == "mslabel")
                    {
                        ssrcData.mslabel = k.Value;
                    }
                    if (k.Key == "label")
                    {
                        ssrcData.label = k.Value;
                    }
                }

                ssrcData.streamType = StreamType.inbound.ToString();
                ssrcData.reportType = ReportType.local.ToString();
                ssrcData.mediaType  = MediaType.audio.ToString();
                ssrcData.userID     = GetLocalPeerName();

                ssrcData.localStartTime = DateTime.UtcNow.ToUnixTimeStampMiliseconds();

                ssrcDataList.Add(ssrcData);
            }
        }