Exemplo n.º 1
0
        public static Attribut ParseInvariant(string value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            //Contract.EndContractBlock();

            var listValues = value.Split(new char[] { ':' }, 2);


            Attribut returnValue;

            // Call parser of child type
            Type childType;

            attributMap.TryGetValue(listValues[0], out childType);
            if (childType != null)
            {
                if (listValues[0] == AttributRtpMap.NAME)
                {
                    returnValue = new AttributRtpMap();
                }
                else if (listValues[0] == AttributFmtp.NAME)
                {
                    returnValue = new AttributFmtp();
                }
                else
                {
                    returnValue = new Attribut(listValues[0]);
                }
            }
            else
            {
                returnValue = new Attribut(listValues[0]);
            }
            // Parse the value. Note most attributes have a value but recvonly does not have a value
            if (listValues.Count() > 1)
            {
                returnValue.ParseValue(listValues[1]);
            }

            return(returnValue);
        }
Exemplo n.º 2
0
 private static void ParseAttributes(Rtsp.Sdp.SdpFile sdpData, int x, out string control, out Rtsp.Sdp.AttributFmtp fmtp, out Rtsp.Sdp.AttributRtpMap rtpmap)
 {
     control = "";
     fmtp    = null;
     rtpmap  = null;
     foreach (Rtsp.Sdp.Attribut attrib in sdpData.Medias[x].Attributs)
     {
         if (attrib.Key.Equals("control"))
         {
             control = attrib.Value;
         }
         if (attrib.Key.Equals("fmtp"))
         {
             fmtp = attrib as Rtsp.Sdp.AttributFmtp;
         }
         if (attrib.Key.Equals("rtpmap"))
         {
             rtpmap = attrib as Rtsp.Sdp.AttributRtpMap;
         }
     }
 }