예제 #1
0
        private void ReadMdia(ref TrakInfo trackData, BoxInfo mdiaBox)
        {
            var     maxLen = mdiaBox.BoxOffset + mdiaBox.Offset;
            BoxInfo?box    = null;

            do
            {
                box = NextBox(maxLen);
                if (box != null)
                {
                    if (box.Value.Type.Check(mdhd))
                    {
                        ReadMdhd(ref trackData);
                    }
                    if (box.Value.Type.Check(hdlr))
                    {
                        ReadHdlr(ref trackData);
                    }
                    if (box.Value.Type.Check(minf))
                    {
                        ReadMinf(ref trackData, box.Value);
                    }
                    SeekNext(box.Value);
                }
            } while (!(box == null || box.Value.Last));
        }
예제 #2
0
        private TrakInfo ReadTrak(BoxInfo trakBox)
        {
            var     maxLen   = trakBox.BoxOffset + trakBox.Offset;
            var     trakData = new TrakInfo();
            BoxInfo?box      = null;

            do
            {
                box = NextBox(maxLen);
                if (box != null)
                {
                    if (box.Value.Type.Check(tkhd))
                    {
                        ReadTkhd(ref trakData);
                    }
                    if (box.Value.Type.Check(mdia))
                    {
                        ReadMdia(ref trakData, box.Value);
                    }
                    if (box.Value.Type.Check(tref))
                    {
                        ReadTref(ref trakData, box.Value);
                    }
                    SeekNext(box.Value);
                }
            } while (!(box == null || box.Value.Last));
            return(trakData);
        }
예제 #3
0
        private void ReadChap(ref TrakInfo trakData, BoxInfo box2)
        {
            var len = (box2.Offset - 8) / 4;

            if (len > 0 && len < 1024)
            {
                trakData.Chaps = new uint[len];
                for (uint i = 0; i < len; i++)
                {
                    trakData.Chaps[i] = ReadUint32();
                }
            }
        }
예제 #4
0
        private void ReadMinf(ref TrakInfo trakData, BoxInfo box2)
        {
            var     maxLen = box2.BoxOffset + box2.Offset;
            BoxInfo?box    = null;

            do
            {
                box = NextBox(maxLen);
                if (box != null)
                {
                    if (box.Value.Type.Check(stbl))
                    {
                        ReadStbl(ref trakData, box.Value);
                    }
                    SeekNext(box.Value);
                }
            } while (!(box == null || box.Value.Last));
        }
예제 #5
0
 private void SeekNext(BoxInfo box)
 {
     stream.Seek(SeekOrigin.Begin, box.BoxOffset);
     stream.Seek(SeekOrigin.Current, box.Offset);
 }