Пример #1
0
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            if (!CheckComponentSubType(ComponentSubType.tmcd))
            {
                Valid = false;
                return(Valid);
            }

            uint reserved = parser.GetUInt();

            if (reserved == 0)
            {
                parser.AddAttribute(new FormattedAttribute <QtSampleDescriptionAtom.Attribute, int>(QtSampleDescriptionAtom.Attribute.Reserved, (int)reserved));
                parser.GetShort(QtSampleDescriptionAtom.Attribute.Reserved);
                parser.GetShort(QtSampleDescriptionAtom.Attribute.DataReferenceIndex);
                reserved = parser.GetUInt(Attribute.Reserved1);
                parser.CheckAttribute(Attribute.Reserved1, reserved == 0, true);
                parser.Parse(new Flags());
                parser.GetInt(Attribute.TimeScale);
                parser.GetInt(Attribute.FrameDuration);
                parser.GetByte(Attribute.NumberOfFrames);
                reserved = parser.GetThreeBytes(Attribute.Reserved2);
                parser.CheckAttribute(Attribute.Reserved2, reserved == 0, false);

                if (parser.BytesRemaining > 0)
                {
                    parser.GetHexDump(QtAtom.Attribute.AdditionalData, (int)parser.BytesRemaining);
                }
            }
            else
            {
                ParseTcmiAtom(parser, reserved);
            }
            return(Valid);
        }
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            parser.GetInt(Attribute.Reserved);
            parser.GetShort(Attribute.Reserved);
            parser.GetShort(Attribute.DataReferenceIndex);

            return(this.Valid);
        }
Пример #3
0
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            parser.GetUInt(Attribute.PreloadStartTime);
            parser.GetInt(Attribute.PreloadDuration);
            parser.GetFlags <Attribute, PreloadFlags>(Attribute.PreloadFlags, 4);
            parser.GetFlags <Attribute, DefaultHints>(Attribute.DefaultHints, 4);

            return(this.Valid);
        }
Пример #4
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);
        }
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            parser.GetFlags <Attribute, Flag>(Attribute.Flags, 4);

            uint dataReferenceType = parser.GetFourCC(Attribute.DataReferenceType);
            int  dataReferenceSize = parser.GetInt(Attribute.DataReferenceSize);

            if (dataReferenceType == (uint)DataReferenceType.alis)
            {
                parser.GetUInt(Attribute.DataReference);                 // TODO test
            }
            else if (dataReferenceType == (uint)DataReferenceType.url_)
            {
                uint maxUrlLength = (uint)QtDetector.Configurable[QtDetector.ConfigurationKey.ReferenceMovieDataReferenceMaxUrlLength];
                parser.GetCString(Attribute.DataReference, maxUrlLength);
            }
            return(this.Valid);
        }