Пример #1
0
        static void PopulateRepresentationBase(XElement element, RepresentationBase result)
        {
            var ns = element.GetDefaultNamespace().NamespaceName;

            result.Profiles          = (string)element.Attribute("profiles");
            result.Width             = element.Attribute("width").GetNullableUInt();
            result.Height            = element.Attribute("height").GetNullableUInt();
            result.Sar               = (string)element.Attribute("sar");
            result.FrameRate         = (string)element.Attribute("frameRate");
            result.AudioSamplingRate = (string)element.Attribute("audioSamplingRate");
            result.MimeType          = (string)element.Attribute("mimeType");
            result.SegmentProfiles   = (string)element.Attribute("segmentProfiles");
            result.Codecs            = (string)element.Attribute("codecs");
            result.MaximumSAPPeriod  = element.Attribute("maximumSAPPeriod").GetNullableDouble();
            result.StartWithSAP      = element.Attribute("startWithSAP").GetNullableUInt();
            result.MaxPlayoutRate    = element.Attribute("maxPlayoutRate").GetNullableDouble();
            result.CodingDependency  = element.Attribute("codingDependency").GetNullableBool();
            result.ScanType          = element.Attribute("scanType").GetNullableEnum <VideoScan>();
            result.AnyAttr.AddRange(element.Attributes());

            result.FramePacking.AddRange(element.Elements(XName.Get("FramePacking", ns)).Select(LoadDescriptor));
            result.AudioChannelConfiguration.AddRange(element.Elements(XName.Get("AudioChannelConfiguration", ns)).Select(LoadDescriptor));
            result.ContentProtection.AddRange(element.Elements(XName.Get("ContentProtection", ns)).Select(LoadDescriptor));
            result.Any.AddRange(element.Elements());
        }
Пример #2
0
        static void PopulateRepresentationBase(XElement element, RepresentationBase result)
        {
            var ns = element.GetDefaultNamespace().NamespaceName;
            result.Profiles = (string)element.Attribute("profiles");
            result.Width = element.Attribute("width").GetNullableUInt();
            result.Height = element.Attribute("height").GetNullableUInt();
            result.Sar = (string)element.Attribute("sar");
            result.FrameRate = (string)element.Attribute("frameRate");
            result.AudioSamplingRate = (string)element.Attribute("audioSamplingRate");
            result.MimeType = (string)element.Attribute("mimeType");
            result.SegmentProfiles = (string)element.Attribute("segmentProfiles");
            result.Codecs = (string)element.Attribute("codecs");
            result.MaximumSAPPeriod = element.Attribute("maximumSAPPeriod").GetNullableDouble();
            result.StartWithSAP = element.Attribute("startWithSAP").GetNullableUInt();
            result.MaxPlayoutRate = element.Attribute("maxPlayoutRate").GetNullableDouble();
            result.CodingDependency = element.Attribute("codingDependency").GetNullableBool();
            result.ScanType = element.Attribute("scanType").GetNullableEnum<VideoScan>();
            result.AnyAttr.AddRange(element.Attributes());

            result.FramePacking.AddRange(element.Elements(XName.Get("FramePacking", ns)).Select(LoadDescriptor));
            result.AudioChannelConfiguration.AddRange(element.Elements(XName.Get("AudioChannelConfiguration", ns)).Select(LoadDescriptor));
            result.ContentProtection.AddRange(element.Elements(XName.Get("ContentProtection", ns)).Select(LoadDescriptor));
            result.Any.AddRange(element.Elements());
        }