/// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x3D0D: this.Emphasis = reader.ReadB(); return(true);

            case 0x3D0F: this.BlockStartOffset = reader.ReadW(); return(true);

            case 0x3D08: this.AuxiliaryBitsMode = reader.ReadB(); return(true);

            case 0x3D10:
                this.ChannelStatusMode = new byte[localTag.Size];
                reader.Read(this.ChannelStatusMode, localTag.Size);
                return(true);

            case 0x3D11:
                this.FixedChannelStatusData = new byte[localTag.Size];
                reader.Read(this.FixedChannelStatusData, localTag.Size);
                return(true);

            case 0x3D12:
                this.UserDataMode = new byte[localTag.Size];
                reader.Read(this.UserDataMode, localTag.Size);
                return(true);

            case 0x3D13:
                this.FixedUserData = new byte[localTag.Size];
                reader.Read(this.FixedUserData, localTag.Size);
                return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 2
0
        public MXFANCPacket(MXFReader reader)
            : base(reader)
        {
            this.LineNumber            = reader.ReadW();
            this.WrappingType          = (MXFANCWrappingType)reader.ReadB();
            this.PayloadSamplingCoding = (MXFANCPayloadCoding)reader.ReadB();
            this.PayloadSampleCount    = reader.ReadW();

            this.Length = this.PayloadSampleCount;
            if (this.PayloadSamplingCoding == MXFANCPayloadCoding.Coding_10_bit_luma_samples ||
                this.PayloadSamplingCoding == MXFANCPayloadCoding.Coding_10_bit_color_difference_samples ||
                this.PayloadSamplingCoding == MXFANCPayloadCoding.Coding_10_bit_luma_and_color_difference_samples)
            {
                this.Length = 4 * (this.PayloadSampleCount / 3);                 // 3 samples are stored in 4 bytes
            }

            // Skip 8 bytes (seems to be data but cannot find any meaning in the spec!)
            UInt32 unknownData1 = reader.ReadD();
            UInt32 unknownData2 = reader.ReadD();

            // Length Alignment
            this.Length = 4 * ((this.Length + 3) / 4);

            if (this.Length > 3)
            {
                // Read the DID
                this.DID  = reader.ReadB();
                this.SDID = reader.ReadB();
                this.Size = reader.ReadB();

                UInt16 combinedID = (UInt16)((((UInt16)this.DID) << 8) | this.SDID);
                if (m_DIDDescription.ContainsKey(combinedID))
                {
                    this.ContentDescription = m_DIDDescription[combinedID];
                }
                else
                {
                    this.ContentDescription = "<unknown content>";
                }

                switch (combinedID)
                {
                case 0x6101:                         // CDP
                    this.AddChild(new MXFCDPPacket(reader));
                    break;

                case 0x4105:                         // AFD
                    break;

                case 0x4302:                         // OP47
                    break;

                default:
                    // Read the real payload without the did/sdid/size
                    this.Payload = new byte[this.Length - 3];
                    reader.Read(this.Payload, this.Length - 3);
                    break;
                }
            }
        }
        /// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x3D0A: this.BlockAlign = reader.ReadW(); return(true);

            case 0x3D0B: this.SequenceOffset = reader.ReadB(); return(true);

            case 0x3D09: this.AveragesBytesPerSecond = reader.ReadD(); return(true);

            case 0x3D32: this.ChannelAssignment = reader.ReadKey(); return(true);

            case 0x3D29: this.PeakEnvelopeVersion = reader.ReadD(); return(true);

            case 0x3D2A: this.PeakEnvelopeFormat = reader.ReadD(); return(true);

            case 0x3D2B: this.PointsPerPeakValue = reader.ReadD(); return(true);

            case 0x3D2C: this.PeakEnvelopeBlockSize = reader.ReadD(); return(true);

            case 0x3D2D: this.PeakChannels = reader.ReadD(); return(true);

            case 0x3D2E: this.PeakFrames = reader.ReadD(); return(true);

            case 0x3D2F: this.PeakOfPeaksPosition = reader.ReadL(); return(true);

            case 0x3D30: this.PeakEnvelopeTimestamp = reader.ReadTimestamp(); return(true);

            case 0x3D31:
                this.PeakEnvelopeData = new byte[localTag.Size];
                reader.Read(this.PeakEnvelopeData, localTag.Size);
                return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 4
0
 public MXFCDPFuture(MXFReader reader, byte sectionID)
     : base(reader)
 {
     this.SectionID = sectionID;
     this.Length    = reader.ReadB();
     this.Data      = new byte[this.Length];
     reader.Read(this.Data, this.Length);
 }
Esempio n. 5
0
        public MXFEntrySVCInfo(MXFReader reader)
            : base(reader)
        {
            this.Length = 7;             // Fixed

            byte b0 = reader.ReadB();

            if ((b0 & 0x40) != 0)
            {
                this.CaptionServiceNumber = (byte)(b0 & 0x1F);
            }
            else
            {
                this.CaptionServiceNumber = (byte)(b0 & 0x3F);
            }

            this.Data = new byte[6];
            reader.Read(this.Data, 6);

            this.DataString = System.Text.Encoding.ASCII.GetString(this.Data);
        }