public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            parser.GetUShort(Attribute.SubSequenceIdentifer);
            parser.GetByte(Attribute.LayerNumber);
            byte flags        = parser.GetByte();
            bool durationFlag = (flags & 0x80) == 0x80;
            bool avgRateFlag  = (flags & 0x40) == 0x40;
            byte reserved     = (byte)(flags & 0x3F);

            parser.AddAttribute(new FormattedAttribute <Attribute, bool>(Attribute.DurationFlag, durationFlag));
            parser.AddAttribute(new FormattedAttribute <Attribute, bool>(Attribute.AvgRateFlag, avgRateFlag));
            parser.AddAttribute(new FormattedAttribute <Attribute, byte>(Attribute.Reserved, reserved));
            parser.CheckAttribute(Attribute.Reserved, reserved == 0, false);

            if (durationFlag)
            {
                parser.GetUInt(Attribute.Duration);
            }

            if (avgRateFlag)
            {
                parser.GetByte(Attribute.AccurateStatisticsFlag);
                parser.GetUShort(Attribute.AvgBitRate);
                parser.GetUShort(Attribute.AvgFrameRate);
            }

            parser.GetTable(Attribute.DependencyInfo, Attribute.NumReferences, NumberOfEntriesType.Byte, 32, () => new DependencyInfo(), parser.BytesRemaining);

            return(Valid);
        }
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            switch (_atomType)
            {
            case AtomType.ChunkOffset32Bit:
                parser.GetTable(Attribute.ChunkOffsetTable, Attribute.NumberOfEntries, NumberOfEntriesType.UInt, 4, () => new ChunkOffsetTableAttribute(AtomType.ChunkOffset32Bit), parser.BytesRemaining);
                break;

            case AtomType.ChunkOffset64Bit:
                parser.GetTable(Attribute.ChunkOffsetTable, Attribute.NumberOfEntries, NumberOfEntriesType.UInt, 8, () => new ChunkOffsetTableAttribute(AtomType.ChunkOffset64Bit), parser.BytesRemaining);
                break;
            }
            return(Valid);
        }
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            parser.GetTable(Attribute.TimeToSampleTable, Attribute.NumberOfEntries, NumberOfEntriesType.UInt, 8, () => new TimeToSampleTableEntry(), parser.BytesRemaining);

            return(Valid);
        }
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            parser.GetTable(Attribute.FeatureEntities, Attribute.NumberOfFeatureEntities, NumberOfEntriesType.UInt, 16, () => new FeatureEntity(), parser.BytesRemaining);

            return(Valid);
        }
예제 #5
0
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            parser.GetUInt(Attribute.GroupingType);

            parser.GetTable(Attribute.SampleToGroupTable, Attribute.EntryCount, NumberOfEntriesType.UInt, 8, () => new SampleToGroupEntry(), parser.BytesRemaining);

            return(Valid);
        }
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            parser.GetTable(Attribute.EditListTable, Attribute.NumberOfEntries, NumberOfEntriesType.UInt, 12, () => new EditListTableEntry(), parser.BytesRemaining);

            // TODO add check: The last edit in a track should never be an empty edit
            // Empty edits have the media time set to -1

            return(Valid);
        }
예제 #7
0
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            const int EntrySize       = 4;
            uint      numberOfEntries = (uint)(parser.BytesRemaining / EntrySize);

            parser.AddAttribute(new FormattedAttribute <Attribute, uint>(Attribute.TableSize, numberOfEntries));

            parser.GetTable(Attribute.TrackIDTable, Attribute.TableSize, numberOfEntries, EntrySize, () => new TrackID(), parser.BytesRemaining);

            return(Valid);
        }
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            uint sampleSize = parser.GetUInt(Attribute.SampleSize);

            if (sampleSize == 0)                // If the sample size is 0 than only read the number of samples in the track
            {
                parser.GetTable(Attribute.SampleSizeTable, Attribute.NumberOfEntries, NumberOfEntriesType.UInt, 4, () => new SampleSizeTableAttribute(), parser.BytesRemaining);
            }
            else
            {
                parser.GetUInt(Attribute.SampleCount);                  // Read the number on samples in the track
            }

            return(Valid);
        }
예제 #9
0
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            int colorTableSeed = parser.GetInt(Attribute.ColorTableSeed);

            parser.CheckAttribute(Attribute.ColorTableSeed, colorTableSeed == 0);
            ushort colorTableFlags = parser.GetUShort(Attribute.ColorTableFlags);

            parser.CheckAttribute(Attribute.ColorTableFlags, colorTableFlags == 0x8000);

            uint colorTableSize = parser.GetUShort(Attribute.ColorTableSize);

            colorTableSize++;                   // The color table size is zero-relative; 0 means there is one color in the array
            parser.GetTable(Attribute.ColorArray, Attribute.ColorTableSize, colorTableSize, 8, () => new Color(), parser.BytesRemaining);

            return(Valid);
        }