audio/ARM_CMMF_codecs/FrameTable/Src/FrameTable.cpp
branchRCL_3
changeset 20 67584cc761d1
parent 0 40261b775718
equal deleted inserted replaced
19:8184f75a63d4 20:67584cc761d1
    44 
    44 
    45 
    45 
    46 
    46 
    47 // CONSTANTS
    47 // CONSTANTS
    48 
    48 
    49 const TInt KBuffersToKeep = 3;
       
    50 
       
    51 const TInt KLowResPeriodMs = 1000; // approximate interval for entries stored in low res table is 1 sec
    49 const TInt KLowResPeriodMs = 1000; // approximate interval for entries stored in low res table is 1 sec
    52 
    50 
    53 
    51 const TInt KHighResLengthMs = 5000; // approximate cummulative Length of the enteries stored in the high res table is 5 sec
    54 
    52 
    55 // ============================ MEMBER FUNCTIONS ===============================
    53 // ============================ MEMBER FUNCTIONS ===============================
    56 
    54 
    57 
    55 
    58 
    56 
   298 
   296 
   299             status = iFrameTable.Append(bufRefPos);
   297             status = iFrameTable.Append(bufRefPos);
   300 
   298 
   301             ASSERT(status == KErrNone);
   299             ASSERT(status == KErrNone);
   302 
   300 
   303             if (iOkToShrink)
   301             if(!iOkToShrink)
   304 
       
   305                 {
   302                 {
   306 
   303                 if( iFrameTable.Count() >= ( KHighResLengthMs / iMsecPerFrame ) )
   307                 DP0(_L("CFrameTable::SubmitTableEntry removing an entry "));
   304                     {
   308 
   305                     DP0(_L("CFrameTable::SubmitTableEntry iOkToShrink = ETrue now"));
       
   306                     iOkToShrink = ETrue;
       
   307                     }
       
   308                 }
       
   309             else
       
   310                 {
   309                 iFrameTable.Remove(0);
   311                 iFrameTable.Remove(0);
   310 
       
   311                 }
   312                 }
   312 
   313 
   313             }
   314             }
   314 
   315 
   315         else
   316         else
  1078 
  1079 
  1079 
  1080 
  1080 
  1081 
  1081     iFrameTable.Reset();
  1082     iFrameTable.Reset();
  1082 
  1083 
  1083     iBufCnt = 0;
       
  1084 
       
  1085     iOkToShrink = EFalse;
  1084     iOkToShrink = EFalse;
  1086 
  1085 
  1087     }
  1086     }
  1088 
  1087 
  1089 
  1088 
  1097 //	
  1096 //	
  1098 
  1097 
  1099 EXPORT_C void CFrameTable::ShrinkTable()
  1098 EXPORT_C void CFrameTable::ShrinkTable()
  1100 
  1099 
  1101     { // gets called from controller decoder when switching to next buffer
  1100     { // gets called from controller decoder when switching to next buffer
  1102 
  1101 	//function is no longer required
  1103     DP0(_L("CFrameTable::ShrinkTable"));
  1102 	//decision to start shrinking is now part of CFrameTable itself.
  1104 
  1103 	//Not removing this function as it may be needed later on.
  1105     if (iBufCnt < KBuffersToKeep)
       
  1106 
       
  1107         {
       
  1108 
       
  1109         iBufCnt++;
       
  1110 
       
  1111         }
       
  1112 
       
  1113     else
       
  1114 
       
  1115         {
       
  1116 
       
  1117         iOkToShrink = ETrue;
       
  1118 
       
  1119         DP0(_L("CFrameTable::ShrinkTable ok to shrink"));
       
  1120 
       
  1121         }
       
  1122 
       
  1123     }
  1104     }
  1124 
  1105 
  1125 
  1106 
  1126 
  1107 
  1127 EXPORT_C TInt CFrameTable::SetSourceReference(TUint aTimeMs, TUint aPos)
  1108 EXPORT_C TInt CFrameTable::SetSourceReference(TUint aTimeMs, TUint aPos)