public override void Read(BoxReader reader)
        {
            using (SizeChecker checker = new SizeChecker(this, reader)) {
                base.Read(reader);
                this.TrackFragmentHeaderBox.Read(reader);
                this.TrackFragmentRunBox.Read(reader);

                while (checker.DataLeft() > 8)
                {
                    // it appears that Independent and Disposable Sample Box is optional
                    BoxType nextbox = reader.PeekNextBoxType();
                    if (nextbox == BoxTypes.IndependentAndDisposableSamplesBox)
                    {
                        this.IndependentAndDisposableSamplesBox = new IndependentAndDisposableSamplesBox(this.TrackFragmentRunBox.Samples.Count);
                        this.IndependentAndDisposableSamplesBox.Read(reader);
                        continue;
                    }

                    if (nextbox == BoxTypes.UUID)
                    {
                        UserUniqueIDBox = new UserUniqueIDBox();
                        UserUniqueIDBox.Read(reader);
                        continue;
                    }

                    break;                                                     // this shouldn't happen, and it should force the SizeChecker to throw an exception as it means we didn't read everything...
                }
            }
        }
Beispiel #2
0
        public override void Read(BoxReader reader)
        {
            using (SizeChecker checker = new SizeChecker(this, reader)) {
                base.Read(reader);
                this.TrackFragmentHeaderBox.Read(reader);
                this.TrackFragmentRunBox.Read(reader);

                                while (checker.DataLeft() > 8) {
                                    // it appears that Independent and Disposable Sample Box is optional
                                    BoxType nextbox = reader.PeekNextBoxType();
                                    if (nextbox == BoxTypes.IndependentAndDisposableSamplesBox) {
                                        this.IndependentAndDisposableSamplesBox = new IndependentAndDisposableSamplesBox(this.TrackFragmentRunBox.Samples.Count);
                                        this.IndependentAndDisposableSamplesBox.Read(reader);
                                        continue;
                                    }

                                    if (nextbox == BoxTypes.UUID) {
                                        UserUniqueIDBox = new UserUniqueIDBox();
                                        UserUniqueIDBox.Read(reader);
                                        continue;
                                    }

                                    break; // this shouldn't happen, and it should force the SizeChecker to throw an exception as it means we didn't read everything...
                                }
            }
        }
Beispiel #3
0
 public override void Read(BoxReader reader)
 {
     using (SizeChecker checker = new SizeChecker(this, reader))
     {
       base.Read(reader);
         UserType = reader.ReadBytes(4);
                     UserData = reader.ReadBytes((int)checker.DataLeft());
     }
 }
Beispiel #4
0
 public override void Read(BoxReader reader)
 {
     using (SizeChecker checker = new SizeChecker(this, reader))
     {
         base.Read(reader);
         UserType = reader.ReadBytes(4);
         UserData = reader.ReadBytes((int)checker.DataLeft());
     }
 }