Esempio n. 1
0
        /// <summary>
        /// Read a list of keys
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="categoryName"></param>
        /// <returns></returns>
        protected UInt32 ReadKeyList(MXFReader reader, string categoryName, string singleItem)
        {
            UInt32 nofItems   = reader.ReadD();
            UInt32 objectSize = reader.ReadD();             // useless size of objects, always 16 according to specs

            MXFObject keylist = new MXFObject(categoryName, reader.Position);

            if (nofItems < UInt32.MaxValue)
            {
                for (int n = 0; n < nofItems; n++)
                {
                    MXFRefKey key = new MXFRefKey(reader, objectSize, singleItem);
                    keylist.AddChild(key);
                }
            }
            this.AddChild(keylist);
            return(nofItems);
        }
Esempio n. 2
0
        /// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x3F05: this.EditUnitByteCount = reader.ReadD(); return(true);

            case 0x3F06: this.IndexSID = reader.ReadD(); return(true);

            case 0x3F07: this.BodySID = reader.ReadD(); return(true);

            case 0x3F0C: this.IndexStartPosition = reader.ReadL(); return(true);

            case 0x3F0D: this.IndexDuration = reader.ReadL(); return(true);

            case 0x3F0B:
                this.IndexEditRateNum = reader.ReadD();
                this.IndexEditRateDen = reader.ReadD();
                return(true);

            case 0x3F0A:                      // Index entry array
            {
                this.NbIndexEntries = reader.ReadD();
                UInt32 entryLength = reader.ReadD();

                if (this.NbIndexEntries > 0)
                {
                    MXFObject indexCollection = this.AddChild("IndexEntries");

                    for (UInt64 i = 0; i < this.NbIndexEntries; i++)
                    {
                        long next = reader.Position + entryLength;

                        indexCollection.AddChild(new MXFIndexEntry(this.IndexStartPosition + i, reader));

                        reader.Seek(next);
                    }
                }
            }
                return(true);

            case 0x3F09:                      // Delta entry array
            {
                this.NbDeltaEntries = reader.ReadD();
                UInt32 entryLength = reader.ReadD();

                if (this.NbDeltaEntries > 0)
                {
                    MXFObject deltaCollection = this.AddChild("DeltaEntries");
                    for (int i = 0; i < this.NbDeltaEntries; i++)
                    {
                        long next = reader.Position + entryLength;

                        deltaCollection.AddChild(new MXFDeltaEntry(reader));

                        reader.Seek(next);
                    }
                }
            }
                return(true);
            }
            return(false);            // Not parsed, use default parsing
        }