Пример #1
0
        public MediaDescription(string[] sdpLines, ref int index)
        {
            //Create a MediaDescriptionLine.
            MediaDescriptionLine = new Sdp.Lines.SessionMediaDescriptionLine(sdpLines, ref index);

            //Parse remaining optional entries
            for (int e = sdpLines.Length; index < e;)
            {
                string line = sdpLines[index];

                //NullOrEmptyOrWhiteSpace...

                if (line.StartsWith("m="))
                {
                    //Found the start of another MediaDescription
                    break;
                }
                else
                {
                    SessionDescriptionLine parsed;

                    if (SessionDescriptionLine.TryParse(sdpLines, ref index, out parsed))
                    {
                        m_Lines.Add(parsed);
                    }
                    else
                    {
                        index++;
                    }
                }
            }
        }
Пример #2
0
 public MediaDescription(MediaType mediaType, int mediaPort, string mediaProtocol, string mediaFormat, bool shouldDispose = true)
     : base(shouldDispose)
 {
     MediaDescriptionLine = new Sdp.Lines.SessionMediaDescriptionLine();
     MediaType            = mediaType;
     MediaPort            = mediaPort;
     MediaProtocol        = mediaProtocol;
     MediaFormat          = mediaFormat;
 }
Пример #3
0
        public MediaDescription(MediaType mediaType, int mediaPort, string mediaProtocol, string mediaFormat)
        {
            MediaDescriptionLine = new Sdp.Lines.SessionMediaDescriptionLine();

            MediaType     = mediaType;
            MediaPort     = mediaPort;
            MediaProtocol = mediaProtocol;
            MediaFormat   = mediaFormat;
        }
Пример #4
0
        public MediaDescription(MediaDescription other, bool shouldDispose = true) : base(shouldDispose)
        {
            if (Common.IDisposedExtensions.IsNullOrDisposed(other))
            {
                throw new ArgumentNullException(nameof(other));
            }
            MediaDescriptionLine = other.MediaDescriptionLine;

            foreach (Sdp.SessionDescriptionLine line in other.Lines)
            {
                Add(line);
            }
        }