예제 #1
0
        public override bool Parse(AsfParser parser)
        {
            byte propertyFlags = parser.GetByte();

            TypedValue = propertyFlags.ToString();

            ReplicatedDataLengthType = (LengthType)(propertyFlags & 3);
            if (ReplicatedDataLengthType != LengthType.Byte)
            {
                Valid = false;
            }
            Attributes.Add(new FormattedAttribute <LAttribute, string>(LAttribute.ReplicatedDataLengthType, ReplicatedDataLengthType.PrettyPrint()));

            OffsetIntoMediaObjectLengthType = (LengthType)((propertyFlags >>= 2) & 3);
            if (OffsetIntoMediaObjectLengthType != LengthType.DWord)
            {
                Valid = false;
            }
            Attributes.Add(new FormattedAttribute <LAttribute, string>(LAttribute.OffsetIntoMediaObjectLengthType, OffsetIntoMediaObjectLengthType.PrettyPrint()));

            MediaObjectNumberLengthType = (LengthType)((propertyFlags >>= 2) & 3);
            if (MediaObjectNumberLengthType != LengthType.Byte)
            {
                Valid = false;
            }
            Attributes.Add(new FormattedAttribute <LAttribute, string>(LAttribute.MediaObjectNumberLengthType, MediaObjectNumberLengthType.PrettyPrint()));

            LengthType streamNumberLengthType = (LengthType)((propertyFlags >> 2) & 3);

            if (streamNumberLengthType != LengthType.Byte)
            {
                Valid = false;
            }
            Attributes.Add(new FormattedAttribute <LAttribute, string>(LAttribute.StreamNumberLengthType, streamNumberLengthType.PrettyPrint()));

            return(Valid);
        }
        public override bool Parse(AsfParser parser)
        {
            ErrorCorrectionDataLength = (byte)(_errorCorrectionFlags & 0x0F);
            Attributes.Add(new FormattedAttribute <LAttribute, byte>(LAttribute.ErrorCorrectionDataLength, ErrorCorrectionDataLength));

            bool opaqueDataPresent = ((_errorCorrectionFlags >>= 4) & 1) != 0;

            Attributes.Add(new FormattedAttribute <LAttribute, bool>(LAttribute.OpaqueDataPresent, opaqueDataPresent));
            if (opaqueDataPresent)
            {
                Valid = false;
            }

            LengthType errorCorrectionLengthType = (LengthType)((_errorCorrectionFlags >>= 1) & 3);

            Attributes.Add(new FormattedAttribute <LAttribute, string>(LAttribute.ErrorCorrectionLengthType, errorCorrectionLengthType.PrettyPrint()));
            if (errorCorrectionLengthType != 0)
            {
                Valid = false;
            }

            bool errorCorrectionPresent = ((_errorCorrectionFlags >> 2) & 1) != 0;

            Attributes.Add(new FormattedAttribute <LAttribute, bool>(LAttribute.ErrorCorrectionPresent, errorCorrectionPresent));

            return(Valid);
        }
        public override bool Parse(AsfParser parser)
        {
            TypedValue = _lengthTypeFlags.ToString();

            MultiplePayloadsPresent = (_lengthTypeFlags & 1) != 0;
            Attributes.Add(new FormattedAttribute <LAttribute, bool>(LAttribute.MultiplePayloadsPresent, MultiplePayloadsPresent));

            SequenceType = (LengthType)((_lengthTypeFlags >>= 1) & 3);
            if (SequenceType != LengthType.ValueNotPresent)
            {
                Valid = false;
            }
            Attributes.Add(new FormattedAttribute <LAttribute, string>(LAttribute.SequenceType, SequenceType.PrettyPrint()));

            PaddingLengthType = (LengthType)((_lengthTypeFlags >>= 2) & 3);
            Attributes.Add(new FormattedAttribute <LAttribute, string>(LAttribute.PaddingLengthType, PaddingLengthType.PrettyPrint()));

            PacketLengthType = (LengthType)((_lengthTypeFlags >>= 2) & 3);
            Attributes.Add(new FormattedAttribute <LAttribute, string>(LAttribute.PacketLengthType, PacketLengthType.PrettyPrint()));

            bool errorCorrectionPresent = ((_lengthTypeFlags >>= 2) & 1) != 0;

            Attributes.Add(new FormattedAttribute <LAttribute, bool>(LAttribute.ErrorCorrectionPresent, errorCorrectionPresent));

            return(Valid);
        }