Beispiel #1
0
        static SegmentTimeline LoadSegmentTimeline(XElement element)
        {
            var ns     = element.GetDefaultNamespace().NamespaceName;
            var result = new SegmentTimeline();

            result.AnyAttr.AddRange(element.Attributes());

            result.S.AddRange(element.Elements(XName.Get("S", ns)).Select(LoadSegmentTimelineS));
            result.Any.AddRange(element.Elements());

            return(result);
        }
        private static IEnumerable <SmoothStreamingMediaStreamIndexC> CreateChunks(SegmentTimeline segmentTimeline)
        {
            int i = 0;

            foreach (var s in segmentTimeline.S)
            {
                for (int repeatIndex = 0; repeatIndex <= s.R; repeatIndex++)
                {
                    var c = new SmoothStreamingMediaStreamIndexC();
                    c.n = i;
                    c.t = s.T;
                    c.d = s.D;
                    //c.d = ConvertTimeToTimescale(track.Duration, mvhd.TimeScale, track.TimeScale) - entriesDuration;

                    yield return(c);

                    i++;
                }
            }
        }
        static SegmentTimeline LoadSegmentTimeline(XElement element)
        {
            var ns = element.GetDefaultNamespace().NamespaceName;
            var result = new SegmentTimeline();

            result.AnyAttr.AddRange(element.Attributes());

            result.S.AddRange(element.Elements(XName.Get("S", ns)).Select(LoadSegmentTimelineS));
            result.Any.AddRange(element.Elements());

            return result;
        }
        private static IEnumerable<SmoothStreamingMediaStreamIndexC> CreateChunks(SegmentTimeline segmentTimeline)
        {
            int i = 0;

            foreach (var s in segmentTimeline.S)
            {
                for (int repeatIndex = 0; repeatIndex <= s.R; repeatIndex++)
                {
                    var c = new SmoothStreamingMediaStreamIndexC();
                    c.n = i;
                    c.t = s.T;
                    c.d = s.D;
                    //c.d = ConvertTimeToTimescale(track.Duration, mvhd.TimeScale, track.TimeScale) - entriesDuration;

                    yield return c;
                    i++;

                }
            }
        }