Ejemplo n.º 1
0
        public override bool Parse(QtParser parser)
        {
            if (!base.Parse(parser))
            {
                return(false);
            }

            ushort regionSize = parser.GetUShort(Attribute.RegionSize);

            parser.Parse(new RegionBounderyBox());
            parser.CheckAttribute(Attribute.RegionSize, regionSize == parser.BytesRemaining);
            if (Valid)
            {
                parser.GetHexDump(Attribute.ClippingRegionData, regionSize);
            }
            return(Valid);
        }
Ejemplo n.º 2
0
        // for (i=0; i< numOfSequenceParameterSets; i++) {
        //   unsigned int(16) sequenceParameterSetLength ;
        //   bit(8*sequenceParameterSetLength) sequenceParameterSetNALUnit;
        // }
        //
        // for (i=0; i< numOfPictureParameterSets; i++) {
        //   unsigned int(16) pictureParameterSetLength;
        //   bit(8*pictureParameterSetLength) pictureParameterSetNALUnit;
        // }
        private static IDataPacket CreateNalUnit(QtParser parser, byte setCount, Attribute attribute)
        {
            long beginOffset    = parser.Position;
            int  totalSetLength = 0;

            for (int i = 0; i < setCount; i++)
            {
                ushort setLength = parser.GetUShort();
                parser.Position += setLength;
                totalSetLength  += setLength + sizeof(ushort);
            }
            if (totalSetLength > 0)
            {
                parser.Position = beginOffset;
                parser.GetHexDump <Attribute>(attribute, totalSetLength);

                return(parser.GetDataPacket(beginOffset, totalSetLength));
            }
            return(null);
        }
Ejemplo n.º 3
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);
        }