Esempio n. 1
0
 void InitializeNewContext(AmtEncodingInstruction inst, uint currentIndex)
 {
     mCurrentContext = new AmtEncoderContext
     {
         Category = inst.Category,
         First    = currentIndex,
         Last     = currentIndex,
     };
     mContexts.Add(mCurrentContext);
 }
Esempio n. 2
0
        public void Chunk(List <AmtEncodingInstruction> instructions)
        {
            var contexts = new List <AmtEncoderContext>();
            AmtEncoderContext currentContext = null;
            var count = (uint)instructions.Count;

            for (uint i = 0; i < count; ++i)
            {
                var inst = instructions[(int)i];
                if (currentContext == null)
                {
                    currentContext = new AmtEncoderContext
                    {
                        Category = inst.Category,
                        First    = i,
                        Last     = i,
                    };
                    contexts.Add(currentContext);
                }
                else
                {
                    if (currentContext.Category == inst.Category)
                    {
                        currentContext.Last = i;
                    }
                    else
                    {
                        currentContext = new AmtEncoderContext
                        {
                            Category = inst.Category,
                            First    = i,
                            Last     = i,
                        };
                        contexts.Add(currentContext);
                    }
                }
            }
        }
Esempio n. 3
0
 public void Clear()
 {
     mContexts.Clear();
     mInstructions.Clear();
     mCurrentContext = null;
 }
Esempio n. 4
0
 public AmtIncrementalChunkifier()
 {
     mContexts       = new List <AmtEncoderContext>();
     mInstructions   = new List <AmtRecordInstruction>();
     mCurrentContext = null;
 }