multimediacommscontroller/mmccinterface/src/mmcccodecinformation.cpp
changeset 32 f2ed1fc4c163
parent 0 1bce908db942
child 59 b0e4b01681c5
--- a/multimediacommscontroller/mmccinterface/src/mmcccodecinformation.cpp	Thu Jun 24 14:41:11 2010 +0300
+++ b/multimediacommscontroller/mmccinterface/src/mmcccodecinformation.cpp	Fri Jul 09 13:14:28 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;
+    }