示例#1
0
        public Mp4File(Mp4Stream stream, Mp4BoxFactory factory, bool moovOnly)
        {
            this.Boxes = new List <Mp4Box>();
            bool flag = true;

            while (flag)
            {
                long   position = stream.Position;
                Mp4Box item     = factory.Read(stream);
                if (item != null)
                {
                    this.Boxes.Add(item);
                    if (item.Type == Mp4BoxType.MOOV)
                    {
                        this.Movie = new Mp4Movie((Mp4MoovBox)item, stream);
                        if (moovOnly)
                        {
                            flag = false;
                        }
                    }
                    else if (item.Type == Mp4BoxType.FTYP)
                    {
                        this.FileType = (Mp4FtypBox)item;
                    }
                    else if ((item.Type == Mp4BoxType.MDAT) && (this.Movie == null))
                    {
                        this.MoovIsBeforeMdat = false;
                    }
                }
                else
                {
                    flag = false;
                }
            }
        }
示例#2
0
        public Mp4RtpHintSampleEntry(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.RTP_)
        {
            uint fieldsSize = this.GetFieldsSize();

            this.ReadFields(stream);
            base.ReadChildren(stream, factory, (long)((size - 8) - fieldsSize));
        }
        public Mp4AudioSampleEntry(uint size, uint format, Mp4Stream stream, Mp4BoxFactory factory) : base(size, format)
        {
            this.ReadFields(stream);
            uint fieldsSize = this.GetFieldsSize();

            base.ReadChildren(stream, factory, (long)((size - 8) - fieldsSize));
        }
 public Mp4MpegAudioSampleEntry(uint size, uint type, Mp4Stream stream, Mp4BoxFactory factory) : base(size, type, stream, factory)
 {
     this.Esds = base.GetChild <Mp4EsdsBox>(Mp4BoxType.ESDS);
     if ((this.Esds == null) && (base.QtVersion > 0))
     {
         this.Esds = this.FindChild <Mp4EsdsBox>("wave/esds");
     }
 }
示例#5
0
        public Mp4VisualSampleEntry(uint size, uint format, Mp4Stream stream, Mp4BoxFactory factory) : base(size, format)
        {
            this.Predefined2 = new byte[12];
            uint fieldsSize = this.GetFieldsSize();

            this.ReadFields(stream);
            base.ReadChildren(stream, factory, (long)((size - 8) - fieldsSize));
        }
示例#6
0
        public Mp4SampleEntry(uint size, uint type, Mp4Stream stream, Mp4BoxFactory factory) : base(size, type)
        {
            this.Reserved = new byte[6];
            uint fieldsSize = this.GetFieldsSize();

            this.ReadFields(stream);
            base.ReadChildren(stream, factory, (long)((size - 8) - fieldsSize));
        }
示例#7
0
        public void ReadChildren(Mp4Stream stream, Mp4BoxFactory factory, long size)
        {
            this.Children = new List <Mp4Box>();
            Mp4Box item           = null;
            long   bytesAvailable = size;

            factory.PushContext(base.Type);
            while ((bytesAvailable > 0L) && ((item = factory.Read(stream, ref bytesAvailable)) != null))
            {
                item.Parent = this;
                this.Children.Add(item);
            }
            factory.PopContext();
        }
示例#8
0
        public Mp4DrefBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.DREF, 0L, stream)
        {
            uint num = stream.ReadUInt32();

            this.Entries = new List <Mp4Box>((int)num);
            uint num2           = num;
            long bytesAvailable = (size - 12) - 4;

            while (num2-- > 0)
            {
                Mp4Box item = null;
                while ((item = factory.Read(stream, ref bytesAvailable)) != null)
                {
                    this.Entries.Add(item);
                }
            }
        }
示例#9
0
        public Mp4StsdBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.STSD, 0L, stream)
        {
            uint num = stream.ReadUInt32();

            factory.PushContext(base.Type);
            long bytesAvailable = (size - 12) - 4;

            this.Entries = new List <Mp4Box>((int)num);
            for (int i = 0; i < num; i++)
            {
                Mp4Box item = factory.Read(stream, ref bytesAvailable);
                if (item != null)
                {
                    this.Entries.Add(item);
                }
            }
            factory.PopContext();
        }
示例#10
0
 public Mp4EncvSampleEntry(uint size, uint type, Mp4Stream stream, Mp4BoxFactory factory) : base(size, type, stream, factory)
 {
 }
示例#11
0
 public Mp4MoofBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.MOOF, 0L, stream, factory)
 {
 }
示例#12
0
 public Mp4Hvc1SampleEntry(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.HVC1, stream, factory)
 {
     this.HvccBox = base.GetChild <Mp4HvccBox>(Mp4BoxType.HVCC);
 }
示例#13
0
 public Mp4Mp4aSampleEntry(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.MP4A, stream, factory)
 {
 }
示例#14
0
 public Mp4TrakBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.TRAK, 0L, stream, factory)
 {
     this.TkhdBox = this.FindChild <Mp4TkhdBox>("tkhd");
     this.MdhdBox = this.FindChild <Mp4MdhdBox>("mdia/mdhd");
 }
示例#15
0
 public Mp4File(Mp4Stream stream, Mp4BoxFactory factory) : this(stream, factory, false)
 {
 }
示例#16
0
 public Mp4EdtsBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.EDTS, 0L, stream, factory)
 {
 }
示例#17
0
 public Mp4MetaBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.META, 0L, stream, factory)
 {
 }
示例#18
0
 public Mp4MvexBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.MVEX, 0L, stream, factory)
 {
 }
示例#19
0
 public Mp4EncvSampleEntry(uint size, Mp4Stream stream, Mp4BoxFactory factory) : this(size, Mp4BoxType.ENCV, stream, factory)
 {
 }
示例#20
0
 public Mp4DrmiSampleEntry(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.DRMI, stream, factory)
 {
 }
示例#21
0
 public Mp4MoovBox(uint size, ulong largeSize, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.MOOV, largeSize, stream, factory)
 {
 }
示例#22
0
 public Mp4ContainerBox(uint size, uint type, ulong largeSize, Mp4Stream stream, Mp4BoxFactory factory) : base(size, type, largeSize)
 {
     if (this.HeaderSize == 12)
     {
         stream.Position += 4L;
     }
     this.ReadChildren(stream, factory, size - this.HeaderSize);
 }
示例#23
0
 public Mp4StblBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.STBL, 0L, stream, factory)
 {
 }
示例#24
0
 public Mp4TrefBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.TREF, 0L, stream, factory)
 {
 }
示例#25
0
 public Mp4DinfBox(uint size, Mp4Stream stream, Mp4BoxFactory factory) : base(size, Mp4BoxType.DINF, 0L, stream, factory)
 {
 }