Exemplo n.º 1
0
 void InitializeNewContext(AmtEncodingInstruction inst, uint currentIndex)
 {
     mCurrentContext = new AmtEncoderContext
     {
         Category = inst.Category,
         First    = currentIndex,
         Last     = currentIndex,
     };
     mContexts.Add(mCurrentContext);
 }
Exemplo 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);
                    }
                }
            }
        }
Exemplo n.º 3
0
 public void Clear()
 {
     mContexts.Clear();
     mInstructions.Clear();
     mCurrentContext = null;
 }
Exemplo n.º 4
0
 public AmtIncrementalChunkifier()
 {
     mContexts       = new List <AmtEncoderContext>();
     mInstructions   = new List <AmtRecordInstruction>();
     mCurrentContext = null;
 }