Пример #1
0
        private void ExtractService(XmlNode l, Service s)
        {
            s.Name = l.Attributes["name"].Value;
            s.FreeCaMode = l.Attributes["free_ca_mode"].Value=="1";
            s.Type = Convert.ToInt32(l.Attributes["type"].Value);
            s.Pcr = Convert.ToInt32(l.Attributes["pcr"].Value);
            s.Pmt = Convert.ToInt32(l.Attributes["pmt"].Value);
            s.Sid = Convert.ToInt32(l.Attributes["sid"].Value);
            s.Tsid = Convert.ToInt32(l.Attributes["tsid"].Value);
            s.Nid = Convert.ToInt32(l.Attributes["nid"].Value);
            s.Onid = Convert.ToInt32(l.Attributes["onid"].Value);
            s.Provider = l.Attributes["provider"].Value;

            foreach (var item in l["ca_list"].ChildNodes)
            {
                CA  ca = new CA();
                ExtractCA((XmlNode)item, ca);
                s.CAList.Add(ca);
            }

            foreach (var item in l["streams"])
            {
                Stream stream = new Stream();
                ExtractStream((XmlNode)item, stream);
                s.Streams.Add(stream);
            }
        }
Пример #2
0
        private void ExtractStream(XmlNode l, Stream s)
        {
            s.Type = Convert.ToInt32(l.Attributes["type"].Value);
            s.Type2 = l.Attributes["type2"].Value;
            s.Pid = Convert.ToInt32(l.Attributes["pid"].Value);

            if (l.Attributes["application_name"] != null)
            {
                s.ApplicationName = l.Attributes["application_name"].Value;
            }

            foreach (var item in l["ca_list"].ChildNodes)
            {
                CA ca = new CA();
                ExtractCA((XmlNode)item, ca);
                s.CAList.Add(ca);
            }
        }
Пример #3
0
        private void ExtractCA(XmlNode l, CA ca)
        {
            ca.Pid = Convert.ToInt32(l.Attributes["CA_PID"].Value);
            ca.SystemId = Convert.ToInt32(l.Attributes["CA_system_ID"].Value);

            if (l.Attributes["private_bytes"].Value != string.Empty)
            {
                ca.PrivateBytes = ExtractBytes(l.Attributes["private_bytes"].Value);
            }
        }