예제 #1
0
        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            TrackID = stream.ReadBEUInt32();

            if ((Flags & TrackFragmentFlags.BaseDataOffsetPresent) == TrackFragmentFlags.BaseDataOffsetPresent)
            {
                BaseDataOffset = stream.ReadBEUInt64();
            }
            if ((Flags & TrackFragmentFlags.SampleDrescriptionIndexPresent) == TrackFragmentFlags.SampleDrescriptionIndexPresent)
            {
                SampleDescriptionIndex = stream.ReadBEUInt32();
            }
            if ((Flags & TrackFragmentFlags.DefaultSampleDurationPresent) == TrackFragmentFlags.DefaultSampleDurationPresent)
            {
                DefaultSampleDuration = stream.ReadBEUInt32();
            }
            if ((Flags & TrackFragmentFlags.DefaultSampleSizePresent) == TrackFragmentFlags.DefaultSampleSizePresent)
            {
                DefaultSampleSize = stream.ReadBEUInt32();
            }
            if ((Flags & TrackFragmentFlags.DefaultSampleFlagsPresent) == TrackFragmentFlags.DefaultSampleFlagsPresent)
            {
                DefaultSampleFlags = new SampleFlags(stream.ReadBEUInt32());
            }

            if ((Flags & TrackFragmentFlags.DurationIsEmpty) == TrackFragmentFlags.DurationIsEmpty)
            {
                DurationIsEmpty = true;
            }
        }
예제 #2
0
        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            TrackID = stream.ReadBEUInt32();

            if ((Flags & TrackFragmentFlags.BaseDataOffsetPresent) == TrackFragmentFlags.BaseDataOffsetPresent)
                BaseDataOffset = stream.ReadBEUInt64();
            if ((Flags & TrackFragmentFlags.SampleDrescriptionIndexPresent) == TrackFragmentFlags.SampleDrescriptionIndexPresent)
                SampleDescriptionIndex = stream.ReadBEUInt32();
            if ((Flags & TrackFragmentFlags.DefaultSampleDurationPresent) == TrackFragmentFlags.DefaultSampleDurationPresent)
                DefaultSampleDuration = stream.ReadBEUInt32();
            if ((Flags & TrackFragmentFlags.DefaultSampleSizePresent) == TrackFragmentFlags.DefaultSampleSizePresent)
                DefaultSampleSize = stream.ReadBEUInt32();
            if ((Flags & TrackFragmentFlags.DefaultSampleFlagsPresent) == TrackFragmentFlags.DefaultSampleFlagsPresent)
                DefaultSampleFlags = new SampleFlags(stream.ReadBEUInt32());

            if ((Flags & TrackFragmentFlags.DurationIsEmpty) == TrackFragmentFlags.DurationIsEmpty)
                DurationIsEmpty = true;
        }
예제 #3
0
        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            uint sampleCount = stream.ReadBEUInt32();

            if ((Flags & TrackRunFlags.DataOffsetPresent) == TrackRunFlags.DataOffsetPresent)
            {
                DataOffset = stream.ReadBEInt32();
            }

            if ((Flags & TrackRunFlags.FirstSampleFlagsPresent) == TrackRunFlags.FirstSampleFlagsPresent)
            {
                FirstSampleFlags = new SampleFlags(stream.ReadBEUInt32());
            }

            for (uint i = 0; i < sampleCount; i++)
            {
                TrackRunEntry entry = new TrackRunEntry();
                if ((Flags & TrackRunFlags.SampleDurationPresent) == TrackRunFlags.SampleDurationPresent)
                {
                    entry.SampleDuration = stream.ReadBEUInt32();
                }
                if ((Flags & TrackRunFlags.SampleSizePresent) == TrackRunFlags.SampleSizePresent)
                {
                    entry.SampleSize = stream.ReadBEUInt32();
                }
                if ((Flags & TrackRunFlags.SampleFlagsPresent) == TrackRunFlags.SampleFlagsPresent)
                {
                    entry.SampleFlags = new SampleFlags(stream.ReadBEUInt32());
                }
                if ((Flags & TrackRunFlags.SampleCompositionTimeOffsetsPresent) == TrackRunFlags.SampleCompositionTimeOffsetsPresent)
                {
                    entry.SampleCompositionTimeOffset = stream.ReadBEUInt32();
                }

                _Entries.Add(entry);
            }
        }