multimediacommscontroller/mmccinterface/src/mmcccodecinformation.cpp
branchRCL_3
changeset 18 817c922b90eb
parent 0 1bce908db942
--- a/multimediacommscontroller/mmccinterface/src/mmcccodecinformation.cpp	Thu Jul 15 19:04:32 2010 +0300
+++ b/multimediacommscontroller/mmccinterface/src/mmcccodecinformation.cpp	Thu Aug 19 10:18:22 2010 +0300
@@ -37,6 +37,7 @@
 const TUint KDefaultPreference = EMdaPriorityPreferenceNone;
 const TUint KDefaultPriority = EMdaPriorityNormal;
 const TInt KDefaultModeChangePeriod = 1;
+const TUint KMccSecsToMicroSecs = 1000000;
 
 
 // MACROS
@@ -136,7 +137,16 @@
     iFrameSize = codecInfo.iFrameSize;
     iHwFrameTime = codecInfo.iHwFrameTime;
     
-    iKeepAliveTimer = codecInfo.iKeepaliveInterval;
+    if( (codecInfo.iKeepaliveInterval / KMccSecsToMicroSecs) > KMaxTUint8 )
+    	{
+    	iKeepAliveTimer = KMaxTUint8;
+    	iKeepAliveTimerMicroSecs = KMaxTUint8 * KMccSecsToMicroSecs;	
+    	}
+    else
+    	{
+    	iKeepAliveTimer = codecInfo.iKeepaliveInterval / KMccSecsToMicroSecs;
+    	iKeepAliveTimerMicroSecs = codecInfo.iKeepaliveInterval;	
+    	}
     iKeepAlivePT = codecInfo.iKeepalivePT;
     iKeepAliveData = codecInfo.iKeepaliveData;
     
@@ -188,7 +198,7 @@
     codecInfo.iRedundantPayload = iRedundancyPT;
     codecInfo.iNeighbor = iNeighbor;
     codecInfo.iModeChangePeriod = iModeChangePeriod;
-    codecInfo.iKeepaliveInterval = iKeepAliveTimer;
+    codecInfo.iKeepaliveInterval = iKeepAliveTimerMicroSecs;
     codecInfo.iKeepalivePT = iKeepAlivePT;
     codecInfo.iKeepaliveData = iKeepAliveData;
     codecInfo.iMaxRed = iMaxRed;
@@ -924,6 +934,7 @@
 TInt CMccCodecInformation::SetKeepAliveTimer( TUint8 aTimerValue )
     {
     iKeepAliveTimer = aTimerValue;
+    iKeepAliveTimerMicroSecs = aTimerValue * KMccSecsToMicroSecs;
     return KErrNone;    
     }
 
@@ -983,3 +994,34 @@
     {
     return iKeepAliveData;
     }
+
+// -----------------------------------------------------------------------------
+// CMccCodecInformation:SetKeepAliveTimerMicroSecs
+// Default implementation
+// -----------------------------------------------------------------------------
+// 
+TInt CMccCodecInformation::SetKeepAliveTimerMicroSecs( 
+									TUint32 aTimerValueMicroSecs )
+    {
+    if( (aTimerValueMicroSecs / KMccSecsToMicroSecs) > KMaxTUint8 )
+    	{
+    	iKeepAliveTimer = KMaxTUint8;
+    	iKeepAliveTimerMicroSecs = KMaxTUint8 * KMccSecsToMicroSecs;	
+    	}
+    else
+    	{
+    	iKeepAliveTimer = aTimerValueMicroSecs / KMccSecsToMicroSecs;	
+    	iKeepAliveTimerMicroSecs = aTimerValueMicroSecs;
+    	}
+    return KErrNone;    
+    }
+
+// -----------------------------------------------------------------------------
+// CMccCodecInformation:KeepAliveTimerMicroSecs
+// Default implementation
+// -----------------------------------------------------------------------------
+// 
+TUint32 CMccCodecInformation::KeepAliveTimerMicroSecs() const
+    {
+    return iKeepAliveTimerMicroSecs;
+    }