Catchup to latest Symbian^4 GCC_SURGE
authorWilliam Roberts <williamr@symbian.org>
Thu, 22 Jul 2010 16:37:27 +0100
branchGCC_SURGE
changeset 36 e07c9cb4153d
parent 29 11893e44ad1b (current diff)
parent 35 72290a6868df (diff)
Catchup to latest Symbian^4
ipappsrv_info/ipappsrv_metadata/ipappsrv_metadata.mrp
package_definition.xml
--- a/ipappsrv_info/ipappsrv_metadata/ipappsrv_metadata.mrp	Thu Jun 17 22:31:54 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-component           ipappsrv_metadata
-source   \sf\mw\ipappsrv\ipappsrv_info\ipappsrv_metadata 
-source   \sf\mw\ipappsrv\package_definition.xml
-source   \sf\mw\ipappsrv\distribution.policy.s60
-notes_source      \component_defs\release.src
-ipr T 
--- a/ipappsrv_plat/media_control_api/inc/mmccinterfacedef.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/ipappsrv_plat/media_control_api/inc/mmccinterfacedef.h	Thu Jul 22 16:37:27 2010 +0100
@@ -104,6 +104,12 @@
 class TMccVideoSinkSetting
 {
 public:
+    TMccVideoSinkSetting() : iLocation(0,0), iSize(0,0), iVideoPayloadType(0), 
+        iAudioPayloadType(0), iIAPId(0), iDeviceIndex(0), iWindowOrdinalPosition(0),
+        iWindowOrdinalPriority(0), iRotation(EMccNone), iVideoFrameRate(0.0), iEnabled(ETrue)
+        {
+        }
+        
     TPoint iLocation;
     TSize iSize;
     TUint iVideoPayloadType;
@@ -115,6 +121,7 @@
 	TInt iWindowOrdinalPriority;
 	TMccVideoRotation iRotation;	
 	TReal iVideoFrameRate;
+	TBool iEnabled;
 };
 
 typedef TPckgBuf<TMccVideoSinkSetting> TMccVideoSinkSettingBuf;    
--- a/ipappsrv_plat/multimedia_comms_api/inc/mcefilesink.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/ipappsrv_plat/multimedia_comms_api/inc/mcefilesink.h	Thu Jul 22 16:37:27 2010 +0100
@@ -23,7 +23,7 @@
 
 // INCLUDES
 #include <e32std.h>  
-#include <MceMediaSink.h>
+#include <mcemediasink.h>
 
 // FORWARD DECLARATIONS
 
--- a/ipappsrv_plat/multimedia_comms_api/inc/mcertpsink.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/ipappsrv_plat/multimedia_comms_api/inc/mcertpsink.h	Thu Jul 22 16:37:27 2010 +0100
@@ -23,7 +23,7 @@
 
 // INCLUDES
 #include <e32std.h>  
-#include <MceMediaSink.h>
+#include <mcemediasink.h>
 
 // CONSTANTS
 const TMceSinkType KMceRTPSink = 1;
--- a/multimediacommscontroller/mmcccontroller/data/102073F6.rss	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmcccontroller/data/102073F6.rss	Thu Jul 22 16:37:27 2010 +0100
@@ -41,7 +41,7 @@
                     version_no = KIpappsrvEcomVersionNumber;
                     display_name = "MCC Controller";
                     default_data = "";
-                    opaque_data = "<a>0x400000";
+                    opaque_data = "<a>0x400000<t>0x5000";
                     }
                 };
             }
--- a/multimediacommscontroller/mmcccontroller/src/mcccamerahandler.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmcccontroller/src/mcccamerahandler.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -150,6 +150,10 @@
     
     iViewFinderSettings = aSetting;
     
+    if ( !iViewFinderSettings.iEnabled ){
+        __CONTROLLER( "CMccCameraHandler::EnableViewFinderL, param update, exit" )
+        return;
+    }
     __CONTROLLER( "CMccCameraHandler::EnableViewFinderL, starting vf" )
 
     CCamera* cam = IsCameraReady() ? iCamera : NULL;
@@ -217,8 +221,9 @@
 	                       iViewFinderSettings.iSize.iWidth)
     __CONTROLLER_INT2( "CMccCameraHandler::GetViewFinderSettingsL, location",  
 	                       iViewFinderSettings.iLocation.iX, 
-	                       iViewFinderSettings.iLocation.iY)
-    aSetting = iViewFinderSettings;    
+	                       iViewFinderSettings.iLocation.iY)               
+    aSetting = iViewFinderSettings;  
+    aSetting.iEnabled = iViewFinderEnabled;
     __CONTROLLER( "CMccCameraHandler::GetViewFinderSettingsL,exit" )
     }
 
@@ -731,10 +736,16 @@
 void CMccCameraHandler::DoPowerOnComplete( TInt aError )
 	{
 	__CONTROLLER_INT1( "CMccCameraHandler::DoPowerOnComplete, with value", aError )
+	
 	if ( aError == KErrNone )
 		{
 		iState = EPowered;
 		
+	    // Notify observers about success, important to do before VF handling
+		// as VF behaves more nicely at enabling when it sees that media recorder
+		// is already using camera.
+	    NotifyObservers( aError );
+		
 		// Viewfinder was enabled before resource release, enable again.
 		// Also set old camera settings.
 		if ( iViewFinderEnabled )
@@ -757,10 +768,10 @@
 		{
 		__CONTROLLER_INT1( "CMccCameraHandler::DoPowerOnComplete, powering failed", aError )
 		iState = EFailed;
-		}	
-	
-	// Notify observers about success or failure
-    NotifyObservers( aError );
+		
+	    // Notify observers about failure
+	    NotifyObservers( aError );
+		}
     
 	__CONTROLLER( "CMccCameraHandler::DoPowerOnComplete, exit" )
 	}
--- a/multimediacommscontroller/mmcccontroller/tsrc/ut_controller/src/UT_CMccCameraHandler.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmcccontroller/tsrc/ut_controller/src/UT_CMccCameraHandler.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -286,6 +286,22 @@
     iCameraHandler->GetViewFinderSettingsL( settings2 );
     EUNIT_ASSERT_EQUALS( settings2.iSize.iWidth, 0 );
     EUNIT_ASSERT( iCameraHandler->iCamera->iVfStarted == EFalse )
+    
+    // Check that iEnabled in settings is handled correctly
+    iCameraHandler->iViewFinderEnabled = EFalse;
+    settings.iEnabled = EFalse;
+    iCameraHandler->EnableViewFinderL( settings );
+    EUNIT_ASSERT( iCameraHandler->iViewFinderEnabled == EFalse )
+    EUNIT_ASSERT( iCameraHandler->iCamera->iVfStarted == EFalse )
+    iCameraHandler->GetViewFinderSettingsL( settings2 );
+    EUNIT_ASSERT( settings2.iEnabled == EFalse )
+    
+    settings.iEnabled = ETrue;
+    iCameraHandler->EnableViewFinderL( settings );
+    EUNIT_ASSERT( iCameraHandler->iViewFinderEnabled == ETrue )
+    EUNIT_ASSERT( iCameraHandler->iCamera->iVfStarted == EFalse )
+    iCameraHandler->GetViewFinderSettingsL( settings2 );
+    EUNIT_ASSERT( settings2.iEnabled == ETrue )
     }
 
 void UT_CMccCameraHandler::UT_CMccCameraHandler_DisableViewFinderL()
--- a/multimediacommscontroller/mmccfilesourcesink/inc/mccfileaudio.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccfilesourcesink/inc/mccfileaudio.h	Thu Jul 22 16:37:27 2010 +0100
@@ -100,6 +100,7 @@
 	#ifdef EUNIT_TEST
         friend class UT_CMccFileAudio;
         friend class UT_CMccMultiplexer;
+        friend class UT_CMccFileSourceImpl;
     #endif	
 	};
 
--- a/multimediacommscontroller/mmccfilesourcesink/inc/mccfilesourceimpl.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccfilesourcesink/inc/mccfilesourceimpl.h	Thu Jul 22 16:37:27 2010 +0100
@@ -283,6 +283,8 @@
 
         void StopEofTimer(); 
         void EofTimerExpiredL(); // from MMccEofTimerObserver
+        
+        void InvalidVideoFrame( TBool aInvalid = EFalse );
   	  	
     public:
     
--- a/multimediacommscontroller/mmccfilesourcesink/inc/mccfilevideo.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccfilesourcesink/inc/mccfilevideo.h	Thu Jul 22 16:37:27 2010 +0100
@@ -26,6 +26,9 @@
 
 #include "mccfilesourcetypebase.h"
 
+
+const TUint KMccReadFrameFailCountMax = 20;
+
 // FORWARD DECLARATIONS
 class CMccFileSourceImpl;
 class MMccResources;
@@ -53,6 +56,7 @@
 	TFourCC GetFourCC();
 	TCallBack TickCallBack();
 	HBufC8* GetConfigKeyL();
+	TUint32 VideoType() const;
 
 public:
     static TInt TickVideoL( TAny* aObject );
@@ -112,6 +116,9 @@
 	TBool   iIsVideoLeft;
 	TBool   iIsFirstFrame;
 	TFourCC	iFourCC;
+	
+	TInt iReadFrameFailCount;
+	TBool iSendReadFrameFailEvent;
     
 	MMccResources* iMccResources;
 	TUint32 iEndpointId;
--- a/multimediacommscontroller/mmccfilesourcesink/src/mccfilesink.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccfilesourcesink/src/mccfilesink.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -582,6 +582,7 @@
            {
            iAddToTimestamp += ( currDifference + averageTimeStampDifference );
            iTimestamps.Reset();
+		   iPausedDuration = 0;
            
            __FILESINK_CONTROLL_INT1("CMccFileSink::TimeToPlay, iAddToTimestamp=", iAddToTimestamp )  
            }
--- a/multimediacommscontroller/mmccfilesourcesink/src/mccfilesourceimpl.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccfilesourcesink/src/mccfilesourceimpl.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -28,6 +28,7 @@
 #include "mccfilevideo.h"
 #include "mccinternalevents.h"
 #include "mmccinterfacedef.h"
+#include "mccinternaldef.h"
 
 
 
@@ -368,12 +369,14 @@
     
     // Average bitrate is for the whole stream, 
     // subtract audio average to get video average
-    TUint32 averageBitRate = iFileVideo->StreamAverageBitRate() - audioBitRate;
+    TUint32 videoBitRate = iFileVideo->StreamAverageBitRate() - audioBitRate;
+    MccConversionUtility::BitRateSanitize( 
+        videoBitRate, videoBitRate, iFileVideo->VideoType() );
     
     __FILESOURCE_CONTROLL_INT1( "CMccFileSourceImpl::VideoBitRateL, videoBitRate", 
-                               averageBitRate )
+        videoBitRate )
 
-    return averageBitRate;
+    return videoBitRate;
     }
 
 // -----------------------------------------------------------------------------
@@ -1086,6 +1089,27 @@
     
     return startNeeded;
     }
+
+// -----------------------------------------------------------------------------
+// CMccFileSourceImpl::InvalidVideoFrame()
+// -----------------------------------------------------------------------------
+//
+void CMccFileSourceImpl::InvalidVideoFrame( TBool aInvalid )
+	{
+	__FILESOURCE_CONTROLL( 
+	            "CMccFileSourceImpl::InvalidVideoFrame" )
+    if( aInvalid )
+	    {
+	    SendStreamEventToClient( KMccEventCategoryStream, 
+		    	                 KMccStreamIdle );
+		}
+	else
+	    {
+	    SendStreamEventToClient( KMccEventCategoryStream, 
+		    	                 KMccStreamPlaying );
+	    }
+	}
+
     
 #ifndef EKA2
 // DLL interface code
--- a/multimediacommscontroller/mmccfilesourcesink/src/mccfilevideo.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccfilesourcesink/src/mccfilevideo.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -231,7 +231,16 @@
     ExtractH264ParameterSetNALUsL( &configKey, ETrue );
     return configKey;
     }
-    
+
+// -----------------------------------------------------------------------------
+// CMccFileVideo::VideoType
+// -----------------------------------------------------------------------------
+//
+TUint32 CMccFileVideo::VideoType() const
+    {
+    return iType;
+    }
+
 // -----------------------------------------------------------------------------
 // CMccFileVideo::Position
 // -----------------------------------------------------------------------------
@@ -279,10 +288,9 @@
 //
 TReal CMccFileVideo::VideoFrameRateL()
 	{
-	// Round to have zero decimals for clearness sake
-	TReal roundedFrameRate;
-	User::LeaveIfError( Math::Round( roundedFrameRate, iFrameRate, 0 ) );
-    return roundedFrameRate;	
+    TReal modFrameRate;
+    MccConversionUtility::FrameRateSanitizeL( modFrameRate, iFrameRate, iType );
+    return modFrameRate;
 	}
  
 // -----------------------------------------------------------------------------
@@ -402,11 +410,27 @@
 		{
 		__FILESOURCE_CONTROLL( "CMccFileVideo::ReadFrameL, reading frame, NOT OK" )
 		CleanupStack::PopAndDestroy( mediaBuffer );
+	  	if( !iSendReadFrameFailEvent )
+	  	    {
+	  	    iReadFrameFailCount++;
+	  	    if( iReadFrameFailCount >= KMccReadFrameFailCountMax )
+	  	    	{
+	  	    	iSendReadFrameFailEvent = ETrue;
+	  	    	iSource.InvalidVideoFrame( ETrue );
+	  	    	}
+	  	    }
         }
     else
     	{
  		__FILESOURCE_CONTROLL_INT1( "CMccFileVideo::ReadFrameL, reading frame, OK, position", 
  		                            iPosition )   		
+ 		                            
+	    if( iSendReadFrameFailEvent )
+		    {
+		    iSendReadFrameFailEvent = EFalse;
+		    iReadFrameFailCount = 0;
+		    iSource.InvalidVideoFrame( EFalse );
+		    }
 
         DoTimingCorrection( iPosition );
                
--- a/multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/Src/UT_CMCCFileSourceImpl.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/Src/UT_CMCCFileSourceImpl.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -23,6 +23,7 @@
 #include "mmcccodecinformation.h"
 #include "mccresourcepool.h"
 #include "mmccinterfacedef.h"
+#include "mccinternaldef.h"
 #include "mccunittestmacros.h"
 
 
@@ -252,6 +253,12 @@
 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_VideoBitRateLL(  )
     {
     TUint32 videoBitRate = iSourceImp->VideoBitRateL();
+    EUNIT_ASSERT_EQUALS(videoBitRate, KMccH263ProfileZeroMinBitRateIOP); // Low bitrate increased to more interoperable
+    
+    // Test situation where no need to make iop modification for bitrate
+    iSourceImp->iFileVideo->iStreamAverageBitRate = 100000;
+    videoBitRate = iSourceImp->VideoBitRateL();
+    EUNIT_ASSERT_EQUALS(videoBitRate, iSourceImp->iFileVideo->iStreamAverageBitRate - iSourceImp->iFileAudio->iAverageBitRate);
     }
 
 void UT_CMccFileSourceImpl::UT_CMccFileSourceImpl_PositionLL(  )
--- a/multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/Src/UT_CMccFileAudio.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/Src/UT_CMccFileAudio.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -32,6 +32,7 @@
 #include "mmccinterfacedef.h"
 #include "mccresourcepool.h"
 #include "Mcculdatapath.h"
+#include "mccinternaldef.h"
 
 // CONSTRUCTION
 UT_CMccFileAudio* UT_CMccFileAudio::NewL()
@@ -315,7 +316,20 @@
 void UT_CMccFileAudio::UT_CMccFileAudio_VideoFrameRateLL(  )
     {
     TReal videoFrameRate = iAudio->VideoFrameRateL();
+    EUNIT_ASSERT_EQUALS( (TInt)videoFrameRate, 0 );
     TReal videoFrameRate2 = iVideo->VideoFrameRateL();
+    EUNIT_ASSERT_EQUALS( (TInt)videoFrameRate2, 5 );
+    
+    // Test that framerate is limited to more interoperable value if value is too high for codec type
+    iVideo->iType = MP4_TYPE_H263_PROFILE_0;
+    iVideo->iFrameRate = 21;
+    videoFrameRate2 = iVideo->VideoFrameRateL();
+    EUNIT_ASSERT_EQUALS( (TInt)videoFrameRate2, KMccH263ProfileZeroMaxFramerateIOP );
+    
+    iVideo->iType = MP4_TYPE_AVC_PROFILE_BASELINE;
+    iVideo->iFrameRate = 18;
+    videoFrameRate2 = iVideo->VideoFrameRateL();
+    EUNIT_ASSERT_EQUALS( (TInt)videoFrameRate2, 18 ); // Value not changed for AVC
     }
 
 void UT_CMccFileAudio::UT_CMccFileAudio_StartTimerL(  )
--- a/multimediacommscontroller/mmccshared/inc/mccinternaldef.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccshared/inc/mccinternaldef.h	Thu Jul 22 16:37:27 2010 +0100
@@ -25,6 +25,8 @@
 #include <e32base.h>
 #include <mmf/common/mmfcontroller.h>
 #include <tconvbase64.h>  
+#include <e32math.h>
+#include <3gplibrary/mp4lib.h>
 
 
 #include "rtpdef.h"
@@ -68,6 +70,10 @@
 // Increased RTP socket size in bytes, default socket size is around 4KB
 const TInt KMccIncreasedRtpSocketSize = 10000;
 
+// Values used to force better interoperability against some vendors
+const TReal KMccH263ProfileZeroMaxFramerateIOP = 15;
+const TUint32 KMccH263ProfileZeroMinBitRateIOP = 64001;
+
 // MACROS
 
 #ifdef _DEBUG
@@ -782,6 +788,35 @@
     	User::LeaveIfError( encoder.Encode( aInput, ptrOutput ) );
     	return output;
         }
+    
+    static void FrameRateSanitizeL( 
+        TReal& aSanitizedFrameRate, TReal aOrigFrameRate, TUint32 aVideoType )
+        {
+        // Round to have zero decimals for clearness sake
+        User::LeaveIfError( Math::Round( aSanitizedFrameRate, aOrigFrameRate, 0 ) );
+        
+        if ( aVideoType == MP4_TYPE_H263_PROFILE_0 && 
+             aSanitizedFrameRate > KMccH263ProfileZeroMaxFramerateIOP )
+            {
+            aSanitizedFrameRate = KMccH263ProfileZeroMaxFramerateIOP;
+            }
+        }
+    
+    static void BitRateSanitize( 
+        TUint32& aSanitizedBitRate, TUint32 aOrigBitRate, TUint32 aVideoType )
+        {
+        if ( aVideoType == MP4_TYPE_H263_PROFILE_0 && 
+             aOrigBitRate > 0 && 
+             aOrigBitRate < KMccH263ProfileZeroMinBitRateIOP )
+            {
+            aSanitizedBitRate = KMccH263ProfileZeroMinBitRateIOP;
+            }
+        else 
+            {
+            aSanitizedBitRate = aOrigBitRate;
+            }
+        }
+    
     };
         
 #endif
--- a/multimediacommscontroller/mmccsubcontroller/src/mcccodecconfigurator.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccsubcontroller/src/mcccodecconfigurator.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -667,14 +667,19 @@
                 __SUBCONTROLLER( "AVC" )
                 setting.iVideoFourCC = TFourCC( KMccFourCCIdAVC );
                 }
-            // Round to have zero decimals for clearness sake
-            User::LeaveIfError( Math::Round( setting.iVideoFrameRate, frameRate, 0 ) );
+
+            MccConversionUtility::FrameRateSanitizeL( 
+                setting.iVideoFrameRate, frameRate, videoType );
+            
             setting.iVideoFrameSize.iWidth = videoWidth;
             setting.iVideoFrameSize.iHeight = videoHeight;
             
             // Average bitrate is for the whole stream, 
             // subtract audio average to get video average
             setting.iVideoBitRate = videoAverageBitRate - audioAverageBitRate;
+            
+            MccConversionUtility::BitRateSanitize( 
+                            setting.iVideoBitRate, setting.iVideoBitRate, videoType );
             }
         else
             {
--- a/multimediacommscontroller/mmccsubcontroller/src/mccsymulstream.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccsubcontroller/src/mccsymulstream.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -288,6 +288,15 @@
                                                
             UpdateCodecInformationL( iCodecInfo );
             }
+        else if ( iDatasink->DataSinkType() == KMccRtpSinkUid )
+       	    {
+            CMccRtpDataSink* dataSink = 
+                static_cast<CMccRtpDataSink*>( iDatasink );
+            
+            // For updating keep alive parameters
+            TMccCodecInfoBuffer infoBuffer( iCodecInfo );     
+            dataSink->ConfigureL( infoBuffer );
+       	    }
         }
     else if ( CurrentCodecState() == EStateCodecLoaded ||
               CurrentCodecState() == EStateCodecLoadedAndUpdating )
--- a/multimediacommscontroller/mmccvideosourcesink/group/videosourcesink.mmp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/group/videosourcesink.mmp	Thu Jul 22 16:37:27 2010 +0100
@@ -35,7 +35,6 @@
 SOURCE          mccvideojitterbuffer.cpp
 SOURCE          mccvideosourceimpl.cpp
 SOURCE          mccvideosourcewrapper.cpp
-SOURCE          mccredrawhandler.cpp
 SOURCE          mccvideosourcekeyretriever.cpp
 
 #if (defined WINS)
--- a/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosinkimpl.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosinkimpl.h	Thu Jul 22 16:37:27 2010 +0100
@@ -61,7 +61,6 @@
 class CMccVideoSinkUser;
 class MAsyncEventHandler;
 class MDataSource;
-class CMccRedrawHandler;
 
 // CLASS DECLARATION
 
@@ -453,6 +452,10 @@
         
         TBool AllUsersReady();
         
+        void UpdateScreenTransparencyL(const TMccVideoSinkSetting& aSettings);
+        void DeleteWindowingElements();
+        void CreateWindowingElementsL(const TMccVideoSinkSetting& aSettings);
+        
     private: // Data
     
         RWsSession           iRwSession;
@@ -489,8 +492,6 @@
         
         TBool iPrerollSet;
         
-        CMccRedrawHandler* iRedrawHandler;
-        
         TUint32 iNumPacketsEnqueued;
         
         TTimeIntervalMicroSeconds iPos;
--- a/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosourceimpl.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosourceimpl.h	Thu Jul 22 16:37:27 2010 +0100
@@ -392,7 +392,7 @@
         void RateAdaptationRequestL( const TMccEvent& aInputData, 
                                      TMccEvent& aOutputData );
                                      
-        void DoCodecSpecificConfigurationL( TUid& aEncoderUid );
+        void DoCodecSpecificConfigurationL( TUid& aEncoderUid,TBool& aForceEncapsulationType );
         
         HBufC8* GetFmtpLC( const TMccCodecInfo& aCodecInfo ); 
         
--- a/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosourcewrapper.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/inc/mccvideosourcewrapper.h	Thu Jul 22 16:37:27 2010 +0100
@@ -63,7 +63,8 @@
                     TInt aCameraHandle,
                     const TDesC8& aVideoMimeType = KNullDesC8,
                     TFourCC aAudioType = KFourCCNULL,
-                    TUid aEncoderUid = KNullUid );
+                    TUid aEncoderUid = KNullUid,
+                    TBool aForceEncapsulationType = EFalse );
 
         void PlayL();
         
--- a/multimediacommscontroller/mmccvideosourcesink/src/mccvideosinkimpl.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/src/mccvideosinkimpl.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -31,7 +31,6 @@
 #include "mmcccodecamr.h"
 #include "mccvideosinkuser.h"
 #include "mccdef.h"
-#include "mccredrawhandler.h"
 #include "mccinternaldef.h"
 #include <videoplayer2.h>
 
@@ -139,44 +138,7 @@
     __V_SOURCESINK_CONTROLL_INT1( "CMccVideoSinkImpl rotation:", 
                                   iSettings.iRotation )
     
-	// Create window group
-	TInt groupId = iRwSession.GetFocusWindowGroup();
-    iRwGroup = new (ELeave) RWindowGroup( iRwSession );	
-    
-	User::LeaveIfError( iRwGroup->Construct( groupId, EFalse ) );	
-    iRwGroup->SetName( KMccWindowGroupName );
-    
-    // TBD: use also iWindowOrdinalPriority
-    iRwGroup->SetOrdinalPosition( iSettings.iWindowOrdinalPosition );
-         
-    // Create screen device
-	iDev = new (ELeave) CWsScreenDevice( iRwSession );
-	User::LeaveIfError( iDev->Construct( iSettings.iDeviceIndex ) ); 
-	
-	// Create window
-	iRw = new (ELeave) RWindow( iRwSession );
-    
-    User::LeaveIfError( iRw->Construct( *iRwGroup, (TUint32)iRw ) );
-
-    iRw->SetPosition( iSettings.iLocation );
-    iRw->SetSize( iSettings.iSize );
-    
-    iRw->SetOrdinalPosition( iSettings.iWindowOrdinalPosition );
-        
-	__V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: creating graphics context ..." )
-    User::LeaveIfError( iDev->CreateContext( iGc ) );
-	__V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: graphics context created!" )
-    
-      
-    iRw->Activate();
-    
-    iRwSession.Flush();
-    
-    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: creating redraw handler" )
-    
-    iRedrawHandler = CMccRedrawHandler::NewL( iRwSession, *iRw, *iGc );
-    
-    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: created redraw handler" )
+    CreateWindowingElementsL(iSettings);
       
     // Videoplayer needs to be created last, otherwise destruction
     // order causes problems
@@ -245,14 +207,10 @@
 		}
 		
 	delete iVideoPlayer;
-	
-	delete iRedrawHandler;
+	iVideoPlayer = NULL;
 	
-	delete iGc;
-	delete iDev;
+	DeleteWindowingElements();
 
-    delete iRw;
-    delete iRwGroup;	
 	iRwSession.Close();
 
 	delete iServerName;
@@ -419,7 +377,6 @@
             }
         else
             {
-            iRedrawHandler->BlackDrawingL( ETrue );
             SendStreamEventToClient( KMccStreamStarted, iCurrentUser );
             SetStartedOnce( userEntry, ETrue );
             }   
@@ -777,8 +734,6 @@
 	     user.PacketOverflowState() != CMccVideoSinkUser::EOccured && 
 	     dataSize >= KMccMinPacketSize )
 		{
-		iRedrawHandler->BlackDrawingL( EFalse );
-		
     	__V_SOURCESINK_CONTROLL( 
     	    "CMccVideoSinkImpl::EmptyBufferL, sending packet to helix" )		
       
@@ -837,16 +792,11 @@
         __V_SOURCESINK_CONTROLL_INT1( "CMccVideoSinkImpl rotation:", 
                 aSettings.iRotation )
         
-        __ASSERT_ALWAYS( iRw && iRwGroup && iDev, User::Leave( KErrNotReady ) );
+        // Need to recreate windowing stuff, otherwise orientation switch does not work
+        DeleteWindowingElements();
+        CreateWindowingElementsL(aSettings);
         
-        // TBD: use also aSettings.iWindowOrdinalPriority
-        iRwGroup->SetOrdinalPosition( aSettings.iWindowOrdinalPosition );
-
-        iRw->SetPosition( aSettings.iLocation );
-        iRw->SetSize( aSettings.iSize );
-        iRw->SetOrdinalPosition( aSettings.iWindowOrdinalPosition );
-        
-        iRwSession.Flush();
+        UpdateScreenTransparencyL(aSettings);
             
         SetDisplayWindowL( iRwSession, *iDev, *iRw );
         
@@ -1946,6 +1896,97 @@
         }
     return allUsersReady;
     }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+// 
+void CMccVideoSinkImpl::UpdateScreenTransparencyL(const TMccVideoSinkSetting& aSettings)
+    {
+    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::UpdateScreenTransparencyL" )
+    __ASSERT_ALWAYS( iGc && iRw, User::Leave( KErrNotReady ) );
+    TRect vfRect( TPoint( 0, 0 ), aSettings.iSize );
+    iGc->Activate( *iRw ); 
+    iRw->Invalidate( vfRect );
+    iRw->BeginRedraw( vfRect );
+    iGc->CancelClippingRect();
+    iGc->SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+    iGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    iGc->SetBrushColor( TRgb( 0, 0, 0, 0 ) );
+    iGc->DrawRect( vfRect );
+    iRw->EndRedraw();
+    iGc->Deactivate();
+    iRwSession.Flush();
+    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::UpdateScreenTransparencyL, exit" )
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMccVideoSinkImpl::DeleteWindowingElements()
+    {
+    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::DeleteWindowingElements" )
+    if ( iVideoPlayer && iRw )
+        {
+        __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: removing window from player" )
+        iVideoPlayer->RemoveDisplayWindow( *iRw );
+        }
+    delete iGc;
+    iGc = NULL;
+    delete iDev;
+    iDev = NULL;
+    delete iRw;
+    iRw = NULL;
+    delete iRwGroup;    
+    iRwGroup = NULL;
+    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::DeleteWindowingElements, exit" )
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMccVideoSinkImpl::CreateWindowingElementsL(const TMccVideoSinkSetting& aSettings)
+    {
+    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::CreateWindowingElementsL" )
+        
+    __ASSERT_ALWAYS( !iGc && !iDev && !iRw && !iRwGroup, User::Leave( KErrAlreadyExists ) );
+        
+    TInt groupId = iRwSession.GetFocusWindowGroup();
+    iRwGroup = new (ELeave) RWindowGroup( iRwSession ); 
+    
+    User::LeaveIfError( iRwGroup->Construct( groupId, EFalse ) );   
+    iRwGroup->SetName( KMccWindowGroupName );
+    
+    // TBD: use also iWindowOrdinalPriority
+    iRwGroup->SetOrdinalPosition( aSettings.iWindowOrdinalPosition );
+    iRwGroup->AutoForeground( EFalse );
+       
+    // Create screen device
+    iDev = new (ELeave) CWsScreenDevice( iRwSession );
+    User::LeaveIfError( iDev->Construct( aSettings.iDeviceIndex ) ); 
+    
+    // Create window
+    iRw = new (ELeave) RWindow( iRwSession );
+
+    User::LeaveIfError( iRw->Construct( *iRwGroup, (TUint32)iRw ) );
+    
+    iRw->SetPosition( aSettings.iLocation );
+    iRw->SetSize( aSettings.iSize );
+    
+    iRw->SetOrdinalPosition( aSettings.iWindowOrdinalPosition );
+      
+    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: creating graphics context ..." )
+    User::LeaveIfError( iDev->CreateContext( iGc ) );
+    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl: graphics context created!" )   
+    
+    iRw->Activate();
+    
+    iRwSession.Flush();
+    
+    __V_SOURCESINK_CONTROLL( "CMccVideoSinkImpl::CreateWindowingElementsL, exit" )
+    }
     
 // End of file
 
--- a/multimediacommscontroller/mmccvideosourcesink/src/mccvideosourceimpl.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/src/mccvideosourceimpl.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -166,13 +166,14 @@
             __V_SOURCESINK_CONTROLL( "CMccVideoSourceImpl::SourcePrimeL, prepare fully" )
             
             TUid encoderUid( KNullUid );
-            DoCodecSpecificConfigurationL( encoderUid );
+            TBool forceEncapsulationType( EFalse );
+            DoCodecSpecificConfigurationL( encoderUid, forceEncapsulationType );
             
             __ASSERT_ALWAYS( iVideoCodecFourCC, User::Leave( KErrNotReady ) );
             	
             __V_SOURCESINK_CONTROLL( "CMccVideoSourceImpl::SourcePrimeL, opening source" )		
         	iMediaRecorder->OpenL( iAudioSource, iCameraHandler->Handle(), 
-        		*iVideoCodecFourCC, iAudioFourCC, encoderUid ) ;
+        		*iVideoCodecFourCC, iAudioFourCC, encoderUid, forceEncapsulationType ) ;
             }
         }
     else
@@ -1218,7 +1219,8 @@
 // CMccVideoSourceImpl::DoCodecSpecificConfigurationL
 // ---------------------------------------------------------------------------
 //
-void CMccVideoSourceImpl::DoCodecSpecificConfigurationL( TUid& aEncoderUid )
+void CMccVideoSourceImpl::DoCodecSpecificConfigurationL( 
+    TUid& aEncoderUid, TBool& aForceEncapsulationType )
     {
     __V_SOURCESINK_CONTROLL( "CMccVideoSourceImpl::DoCodecSpecificConfigurationL" )
     
@@ -1264,6 +1266,7 @@
         __V_SOURCESINK_CONTROLL_INT1( "CMccVideoSourceImpl::DoCodecSpecificConfigurationL, EncodingDecodingDeviceUid:", 
     		                              iVideoCodec.iEncodingDecodingDevice.iUid )
         aEncoderUid = iVideoCodec.iEncodingDecodingDevice;
+        aForceEncapsulationType = ETrue;
         }
     else
         {
--- a/multimediacommscontroller/mmccvideosourcesink/src/mccvideosourcewrapper.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/src/mccvideosourcewrapper.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -89,7 +89,8 @@
     TInt aCameraHandle,
     const TDesC8& aVideoMimeType,
     TFourCC aAudioType,
-    TUid aEncoderUid )
+    TUid aEncoderUid,
+    TBool aForceEncapsulationType )
 	{
     __V_SOURCESINK_CONTROLL( "CMccVideoSourceWrapper::OpenL" )	
     
@@ -109,9 +110,12 @@
     		__V_SOURCESINK_CONTROLL_INT1( "SetPreferredVideoEncoderL, uid:", 
     		                              aEncoderUid.iUid )
             iMediaRecorder->SetPreferredVideoEncoderL( aEncoderUid );
+		    }
+		if ( aForceEncapsulationType )
+            {
             __V_SOURCESINK_CONTROLL( "SetPreferredVideoEncapsulationL" )
             iMediaRecorder->SetPreferredVideoEncapsulationL( EDuElementaryStream );
-		    }
+            }
         
         __V_SOURCESINK_CONTROLL( "SetVideoCodingOptionsL" )        
 		//set mediarecorder to insert GOB:s
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/group/UT_CMCCVideoSourceSink.mmp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/group/UT_CMCCVideoSourceSink.mmp	Thu Jul 22 16:37:27 2010 +0100
@@ -44,7 +44,6 @@
 SOURCE                  MccVideoSource.cpp 
 SOURCE                  MccVideoSourceWrapper.cpp
 SOURCE					        MccVideoSourceSinkFactory.cpp
-SOURCE                  MccRedrawHandler.cpp
 SOURCE									mccvideosourcekeyretriever.cpp
 
 SOURCEPATH              ../src
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/src/UT_CMCCVideoSinkImpl.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/src/UT_CMCCVideoSinkImpl.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -41,6 +41,7 @@
 #include "Mcctesteventhandler.h"
 #include "mmcccodecamr.h"
 #include "mccvideosinkuser.h"
+#include "ws_stubs_helper.h"
 
 
 const TInt KVideoSinkTestFramerateNormal = 15;
@@ -761,10 +762,16 @@
     settings.iRotation = EMccNone;
     
     // No change
+    TWsStubsHelper::Reset();
+    TInt numWindowCreated = TWsStubsHelper::NumWindowsCreated();
     iSinkImpl->UpdateSettingsL( settings, EFalse );
+    EUNIT_ASSERT( numWindowCreated == TWsStubsHelper::NumWindowsCreated() );
+    EUNIT_ASSERT( TWsStubsHelper::CurrentDrawMode() != CGraphicsContext::EDrawModeWriteAlpha );
     
     // Force
     iSinkImpl->UpdateSettingsL( settings, ETrue );
+    EUNIT_ASSERT( ++numWindowCreated == TWsStubsHelper::NumWindowsCreated() ); // Window was recreated
+    EUNIT_ASSERT( TWsStubsHelper::CurrentDrawMode() == CGraphicsContext::EDrawModeWriteAlpha );
     
     // Settings changed
     settings.iRotation = EMccClockwise180Degree;
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/src/UT_CMCCVideoSourceImpl.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/src/UT_CMCCVideoSourceImpl.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -338,6 +338,11 @@
     iSourceImpl->SetVideoCodecL( codecInfo );
     iSourceImpl->SourcePrimeL();
     EUNIT_ASSERT( iSourceImpl->iVideoCodecFourCC->Des().FindF( KH263SdpName ) != KErrNotFound );
+    // Encoder uid should not be set in case of H263 is used
+    CCMRMediaRecorderStub* stub = 
+        reinterpret_cast<CCMRMediaRecorderStub*>( iSourceImpl->iMediaRecorder->iMediaRecorder );
+    EUNIT_ASSERT( stub->iEncoderUid == KNullUid );
+    EUNIT_ASSERT( stub->iEncapsulation != EDuElementaryStream ); // Not forced in H263 case
     }
     
 void UT_CMccVideoSourceImpl::UT_CMccVideoSourceImpl_SourcePrimeL2L(  )
@@ -436,6 +441,7 @@
     CCMRMediaRecorderStub* stub = 
         reinterpret_cast<CCMRMediaRecorderStub*>( iSourceImpl->iMediaRecorder->iMediaRecorder );
     EUNIT_ASSERT( stub->iEncoderUid != KNullUid );
+    EUNIT_ASSERT( stub->iEncapsulation == EDuElementaryStream ); // Forced in AVC case
     
     // Multiple codecs prepare
     iSourceImpl->SourceStopL();
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/stubs/inc/CCMRMediaRecorder.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/stubs/inc/CCMRMediaRecorder.h	Thu Jul 22 16:37:27 2010 +0100
@@ -546,6 +546,8 @@
     
     TUid iEncoderUid;
     
+    TVideoDataUnitEncapsulation iEncapsulation;
+    
     };
 
 #endif // CCMRMEDIARECORDER_H
--- a/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/stubs/src/CCMRMediaRecorder_STUB.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/stubs/src/CCMRMediaRecorder_STUB.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -36,6 +36,7 @@
     {
     iCurrentState = CCMRMediaRecorderStub::EStateNone;
     iVideoBitrate = 64000;
+    iEncapsulation = EDuGenericPayload;
     }
 
 CCMRMediaRecorderStub::~CCMRMediaRecorderStub()
@@ -231,9 +232,10 @@
     iEncoderUid = aEncoder;
     }
 
-void CCMRMediaRecorderStub::SetPreferredVideoEncapsulationL(TVideoDataUnitEncapsulation /*aCapsulation*/)
+void CCMRMediaRecorderStub::SetPreferredVideoEncapsulationL(TVideoDataUnitEncapsulation aCapsulation)
     {
     iLastFunctionCall = ETestPreferredEncapsulation;
+    iEncapsulation = aCapsulation;
     }
         
 // STUB STUFF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/multimediacommscontroller/tsrc/stubs/inc/ws_stubs_helper.h	Thu Jul 22 16:37:27 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+#ifndef WSSTUBSHELPER_H
+#define WSSTUBSHELPER_H
+
+//  INCLUDES
+#include <w32std.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*
+*/
+class TWsStubsHelper
+    {
+public:
+    static CGraphicsContext::TDrawMode CurrentDrawMode();   
+    static TInt NumWindowsCreated();
+    static void Reset();
+
+    };
+
+#endif      // WSSTUBSHELPER_H   
+            
+// End of File
--- a/multimediacommscontroller/tsrc/stubs/src/ws_stubs.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommscontroller/tsrc/stubs/src/ws_stubs.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -16,6 +16,26 @@
 */
 
 #include <w32std.h>
+#include "ws_stubs_helper.h"
+
+static CGraphicsContext::TDrawMode testDrawMode = CGraphicsContext::EDrawModeAND;
+static TInt testNumWindowsCreated = 0;
+
+CGraphicsContext::TDrawMode TWsStubsHelper::CurrentDrawMode()
+{
+    return testDrawMode;
+}
+
+TInt TWsStubsHelper::NumWindowsCreated()
+{
+    return testNumWindowsCreated;
+}
+
+void TWsStubsHelper::Reset()
+{
+    testDrawMode = CGraphicsContext::EDrawModeAND;
+    testNumWindowsCreated = 0;
+}
 
 // -----------------------------------------------------------------------------
 // CWindowGc
@@ -48,8 +68,9 @@
     }
 void CWindowGc::SetDrawMode( TDrawMode aDrawingMode )
     {
-    
+    testDrawMode = aDrawingMode;
     }
+
 void CWindowGc::Deactivate()
     {
     
@@ -145,6 +166,7 @@
     }
 TInt RWindow::Construct(const RWindowTreeNode &parent,TUint32 aHandle)
     {
+    testNumWindowsCreated++;
     return KErrNone;
     }
 void RWindow::BeginRedraw(const TRect &aRect)
@@ -262,6 +284,11 @@
     return KErrNone;
     }
 
+void RWindowGroup::AutoForeground(TBool /*aState*/)
+    {
+        
+    }
+
 // -----------------------------------------------------------------------------
 // RDrawableWindow
 // -----------------------------------------------------------------------------
--- a/multimediacommsengine/mmceshared/inc/mcecomaudiocodec.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmceshared/inc/mcecomaudiocodec.h	Thu Jul 22 16:37:27 2010 +0100
@@ -263,7 +263,13 @@
 	* Comfort noise
 	*/
 	TBool iComfortNoiseEnabled;
-	
+
+
+private:    // Friend classes
+
+    #ifdef TEST_EUNIT
+        friend class UT_CMceComAudioCodec;
+    #endif
     };
 
 
--- a/multimediacommsengine/mmceshared/src/mcecomamrwbcodec.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmceshared/src/mcecomamrwbcodec.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -306,6 +306,7 @@
     //if offerer codec represents the sent offer and mcc codec the answer
     
     // Bitrates field contains also additional information, mask it away
+	/*
     TUint mccBitrates = ( aMccCodec.AllowedBitrates() & KMceAllowedAmrWbBitrateAll );
     TUint mceBitrates = ( iAllowedBitrates & KMceAllowedAmrWbBitrateAll );
     
@@ -314,8 +315,9 @@
 	                mceBitrates > mccBitrates ) :
                   ( mceBitrates && mccBitrates == 0 ||
 	                mceBitrates < mccBitrates );
-	
-	User::LeaveIfError( notValid ? KErrNotSupported : KErrNone );
+	                
+	*/
+//	User::LeaveIfError( notValid ? KErrNotSupported : KErrNone );
 	if ( aMccCodec.CodecMode() != (TCodecMode)iCodecMode )
 		{
 		// codec-mode was different, fail.
--- a/multimediacommsengine/mmceshared/src/mcecomaudiocodec.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmceshared/src/mcecomaudiocodec.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -522,6 +522,10 @@
             	
            	aStream.Data().BoundStreamL().RemoveCodecL( boundCnCodec );
             }
+			
+		// update keep alive payload type and data
+	    aMccCodec.SetKeepAlivePT( 120 );
+        aMccCodec.SetKeepAliveData( KNullDesC8 );
     	}
     	
     CleanupStack::PopAndDestroy( searchCodec );
--- a/multimediacommsengine/mmceshared/src/mcecomcodec.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmceshared/src/mcecomcodec.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -228,7 +228,14 @@
     const TDesC8& /*aFmtpValue*/,
     TBool /*aIsStrictMatch*/ )
     {
-    return aRtpmapValue.FindF( iSdpName ) == 0;
+    // find MIME type
+    TInt slashPos = aRtpmapValue.Find( _L8( "/" ) );
+    if ( slashPos != KErrNotFound )
+        {
+        return aRtpmapValue.Left(slashPos).Compare( iSdpName ) == 0;
+        }
+
+    return aRtpmapValue.FindF(iSdpName) == 0;
     }
     
 // -----------------------------------------------------------------------------
--- a/multimediacommsengine/mmceshared/src/mcecomdisplaysink.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmceshared/src/mcecomdisplaysink.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -347,6 +347,7 @@
     displaySetting.iWindowOrdinalPosition = 1;
     displaySetting.iWindowOrdinalPriority = iPriority;
     displaySetting.iRotation = EMccNone;
+    displaySetting.iEnabled = ETrue;
     
     if ( aCodec.Stream() && aCodec.Stream()->iType == KMceVideo )
         {
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/inc/mcesdpsession.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/inc/mcesdpsession.h	Thu Jul 22 16:37:27 2010 +0100
@@ -409,7 +409,8 @@
         
         // old local port, used for refresh
         TUint iOldLocalMediaPort;
-        
+		
+        TBool iStoreRemoteOrigin;
     	//definitions for unit testing
     	MCEMM_UT_DEFINITIONS
 
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemedianegotiated.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemedianegotiated.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -286,9 +286,11 @@
 TMceSipWarningCode TMceMediaNegotiated::TMceAnswererEndState::DecodeL( CSdpDocument& aSdpDocument )
     {
     MCEMM_DEBUG("TMceMediaNegotiated::TMceAnswererEndState::DecodeL(), Entry ");
-        
+    
+    iSession.SdpSession().iStoreRemoteOrigin = EFalse;
     TMceSipWarningCode code =
          iSession.SdpSession().DecodeOfferL( aSdpDocument, iSession );
+    iSession.SdpSession().iStoreRemoteOrigin = ETrue;
     
     MCEMM_DEBUG("TMceMediaNegotiated::TMceAnswererEndState::DecodeL(), Exit ");
     
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemediasdpcodec.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemediasdpcodec.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -916,28 +916,43 @@
                 const TUint8 KAddrOffsetFromNetType = 4;
                 TInt addr_offset = 
                     value.Match( KMatchIp ) + KAddrOffsetFromNetType;
-                TPtrC8 remoteRtcpAddr = value.Mid( addr_offset );
+                TPtrC8 remoteRtcpAddrTxt = value.Mid( addr_offset );
                 
                 const TUint8 KPortOffsetFromIP = 1;
                 TInt port_offset = 
                     value.Match( KMatchIN ) - KPortOffsetFromIP;
-                TPtrC8 remoteRtcpPort = value.Left( port_offset );
-                
+                HBufC8* dataRemoteRtcpPort = value.Left( port_offset ).AllocLC();
+                TPtr8 remoteRtcpPort( dataRemoteRtcpPort->Des() );
+                remoteRtcpPort.TrimAll();
                 TLex8 lexPT( remoteRtcpPort );
                 User::LeaveIfError( lexPT.Val( rtcpPort, EDecimal ) );
                 // copy the address into correct format
                 TBuf16 <KMaxAddressLength> input;
-                input.Copy( remoteRtcpAddr );      
-                
+                input.Copy( remoteRtcpAddrTxt );      
+                input.TrimAll();
                 MCEMM_DEBUG_SVALUE( "Found RTCP address", input )
                 
-                aStream.SetRemoteRtcpMediaAddrL( input );
+                TInetAddr remoteRtcpAddr;
+                User::LeaveIfError( remoteRtcpAddr.Input( input ) ); 
+                TInetAddr localIpAddr( aStream.Session()->iLocalIpAddress );
+                TBool validRemoteRtcpAddr( 
+                    remoteRtcpAddr.IsLoopback() || !localIpAddr.Match( remoteRtcpAddr ) );
+                MCEMM_DEBUG_DVALUE( "Remote RTCP addr valid:", validRemoteRtcpAddr )
+                if ( validRemoteRtcpAddr )
+                    {
+                    aStream.SetRemoteRtcpMediaAddrL( input );
+                    }
+                CleanupStack::PopAndDestroy( dataRemoteRtcpPort );
                 }
             else
                 {
                 // only port present
-                TLex8 lexPT( value );
+                HBufC8* dataRemoteRtcpPort = value.AllocLC();
+                TPtr8 remoteRtcpPort( dataRemoteRtcpPort->Des() );
+                remoteRtcpPort.TrimAll();
+                TLex8 lexPT( remoteRtcpPort );
                 User::LeaveIfError ( lexPT.Val( rtcpPort, EDecimal ) );
+                CleanupStack::PopAndDestroy( dataRemoteRtcpPort );
                 }
 
 			aStream.SetRemoteRtcpMediaPort( rtcpPort );
@@ -1040,9 +1055,9 @@
     else if ( secureSession && aRole == EMceRoleAnswerer && aUpdate )
         {
         // for long session
-        if ( secureSession->iKeyNeedUpdated )
+          if( secureSession->SdpCryptoAttributeCount( aMediaLine ) )
         	{
-        	secureSession->DecodeSecureDesSdpUpdateL( aStream, aMediaLine ) ;
+            secureSession->DecodeSecureDesSdpUpdateL( aStream, aMediaLine ) ;
         	}
         }
     else if ( secureSession && aRole == EMceRoleOfferer )
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesdpsession.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesdpsession.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -95,7 +95,8 @@
             iOOldSchoolProceeding( 0 ),
             iOOldSchoolCompleted( 0 ),
             iIsMaster( ETrue ),
-            iOldLocalMediaPort( 0 )
+            iOldLocalMediaPort( 0 ),
+            iStoreRemoteOrigin ( ETrue )
     {
     iSessionId = GetRandomNumber();
     iSessionVersion = GetRandomNumber();
@@ -508,11 +509,15 @@
         MCEMM_DEBUG("CMceSdpSession::DecodeOfferL(), Exit ")
         return KMceSipWarnIncompatibleMediaFormat;
         }
-        
-    // store the remote o= field
-    StoreRemoteOriginL();
-    // store the remote a= field
-    StoreRemoteMediaFieldsL();
+    
+    //avoid to store the value second time when in nat environment
+    if ( iStoreRemoteOrigin )
+        {
+        // store the remote o= field
+        StoreRemoteOriginL();
+        // store the remote a= field
+        StoreRemoteMediaFieldsL();
+        }
     //set remote ip address
     result = SetRemoteIpAddressL( aSession, aSdpDocument );
     
@@ -921,7 +926,28 @@
     CSdpConnectionField* connfield = aSdpDocument.ConnectionField();
     const TInetAddr* inetAddr = NULL;
     
-    if( connfield )
+    // find "c-" line from media level
+    TInt index = 0;
+    TBool found = ETrue;
+    while( found && index < mediaLines.Count() )
+        {
+        RPointerArray<CSdpConnectionField>& connfields = 
+                                            mediaLines[index]->ConnectionFields();
+        
+        if ( mediaLines[index++]->Port() > 0 )
+            {
+            TInt cfindex = 0;
+	        TBool cffound = EFalse;
+	        while( !cffound && cfindex < connfields.Count() )
+	            {
+	            inetAddr = connfields[cfindex++]->InetAddress();
+	            cffound = MCE_NOT_NULL_PTR( inetAddr );
+	            }
+	        found = cffound;
+            }
+        }
+    
+    if( connfield && !found )
         {
 		inetAddr = connfield->InetAddress();
 		if( inetAddr )
@@ -931,29 +957,6 @@
 		    MCE_SET_REMOTE_IP_ADDR( &aSession, inetAddress );
 		    }
         }
-    
-    if ( !inetAddr )
-        {
-        TInt index = 0;
-        TBool found = ETrue;
-        while( found && index < mediaLines.Count() )
-            {
-            RPointerArray<CSdpConnectionField>& connfields = 
-                                                mediaLines[index]->ConnectionFields();
-            
-            if ( mediaLines[index++]->Port() > 0 )
-                {
-	            TInt cfindex = 0;
-	            TBool cffound = EFalse;
-	            while( !cffound && cfindex < connfields.Count() )
-	                {
-	                inetAddr = connfields[cfindex++]->InetAddress();
-	                cffound = MCE_NOT_NULL_PTR( inetAddr );
-	                }
-	            found = cffound;
-                }
-            }
-        }
         
     if ( inetAddr )
         {
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/inc/UT_CMCESdpSession.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/inc/UT_CMCESdpSession.h	Thu Jul 22 16:37:27 2010 +0100
@@ -120,6 +120,8 @@
          void UT_CMceSdpSession_DecodeOfferL_2L();
          
          void UT_CMceSdpSession_DecodeOfferL_3L( );
+          
+         void UT_CMceSdpSession_DecodeOfferL_4L( );
 
         void UT_CMceSdpSession_ForkLL();
 
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_CMCESdpSession.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_CMCESdpSession.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -210,10 +210,10 @@
 _LIT8( KConnectionField2, "v=0\r\n\
 o=- 123 123 IN IP4 0.0.0.0\r\n\
 s=-\r\n\
-c=IN IP4 10.36.7.239\r\n\
+c=IN IP4 10.36.7.229\r\n\
 t=0 0\r\n\
 m=audio 5000/1 RTP/AVP 96\r\n\
-c=IN IP4 10.36.7.229\r\n\
+c=IN IP4 10.36.7.239\r\n\
 a=rtpmap:96 AMR/8000\r\n\
 m=video 0 RTP/AVP 97\r\n\
 c=IN IP4 193.65.182.50\r\n");
@@ -1333,6 +1333,35 @@
 		
 	CleanupStack::PopAndDestroy( offer3 );						
     }    
+	
+void UT_CMceSdpSession::UT_CMceSdpSession_DecodeOfferL_4L()
+    {	
+    iSdpSession->SetMediaSession( iInSession );
+    iInSession->AttachSDPSessionL( *iSdpSession );
+    
+    TInetAddr remoteIP;
+    remoteIP.SetAddress( INET_ADDR( 10,10,10,10 ) );
+    
+    _LIT8( KMyUserName, "username" );
+    const TInt64 KSessionId( 1234 );
+    const TInt64 KSessionVersion( 5678 );    
+    CSdpOriginField* remoteorigin = 
+            CSdpOriginField::NewL( KMyUserName, KSessionId, KSessionVersion, remoteIP );
+    iSdpSession->iRemoteOrigin = remoteorigin;
+
+    iSdpSession->iStoreRemoteOrigin = EFalse;
+    CSdpDocument* offer = CSdpDocument::DecodeL( KMceMMTestSdpMessage_MT_Confield_In_MediaLine );
+    CleanupStack::PushL( offer );
+    TInt err = iSdpSession->DecodeOfferL( *offer, *iInSession );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( iSdpSession->iRemoteOrigin->InetAddress()->CmpAddr( remoteIP ) );
+
+    iSdpSession->iStoreRemoteOrigin = ETrue;
+    err = iSdpSession->DecodeOfferL( *offer, *iInSession );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( !iSdpSession->iRemoteOrigin->InetAddress()->CmpAddr( remoteIP ) );
+    CleanupStack::PopAndDestroy( offer ); 
+    }
 
 void UT_CMceSdpSession::UT_CMceSdpSession_DecodeOfferLL_CreateAnswer_NOK_1(  )
     {
@@ -2851,6 +2880,13 @@
     "DecodeOffer3L",
     "FUNCTIONALITY",
     SetupL, UT_CMceSdpSession_DecodeOfferL_3L, Teardown)    
+    
+EUNIT_TEST(
+    "iStoreRemoteOrigin - test",
+    "CMceSdpSession",
+    "DecodeOffer4L",
+    "FUNCTIONALITY",
+    SetupL, UT_CMceSdpSession_DecodeOfferL_4L, Teardown) 
 
 EUNIT_TEST(
     "ForkL - test",
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_cmcemediasdpcodec.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_cmcemediasdpcodec.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -908,6 +908,42 @@
     EUNIT_ASSERT( mediaStream->iRemoteRtcpAddress.IsUnspecified() )
     audioLine->AttributeFields().ResetAndDestroy();
     
+    // Rtcp attribute has incorrectly our local address, it should not be used
+    mediaStream->Session()->iLocalIpAddress.Input( _L("10.20.30.40") );
+    rtcp = CSdpAttributeField::DecodeLC( _L8( "a=rtcp:5020 IN IP4 10.20.30.40\r\n" ) );
+    audioLine->AttributeFields().AppendL( rtcp );
+    CleanupStack::Pop( rtcp );
+    iSdpCodec->DecodeRemoteRtcpFieldL( *audioLine, *mediaStream );
+    EUNIT_ASSERT_EQUALS( 5020, mediaStream->iRemoteRtcpPort )
+    EUNIT_ASSERT( mediaStream->iRemoteRtcpAddress.IsUnspecified() )  // Not changed
+    audioLine->AttributeFields().ResetAndDestroy();
+
+    // Rtcp attrubute is local loopback address, ok to use
+    rtcp = CSdpAttributeField::DecodeLC( _L8( "a=rtcp:5020 IN IP4 127.0.0.1\r\n" ) );
+    audioLine->AttributeFields().AppendL( rtcp );
+    CleanupStack::Pop( rtcp );
+    iSdpCodec->DecodeRemoteRtcpFieldL( *audioLine, *mediaStream );
+    EUNIT_ASSERT_EQUALS( 5020, mediaStream->iRemoteRtcpPort )
+    EUNIT_ASSERT_EQUALS( INET_ADDR( 127,0,0,1 ), mediaStream->iRemoteRtcpAddress.Address() )
+    audioLine->AttributeFields().ResetAndDestroy();
+    
+    // Incorrect white space usage
+    rtcp = CSdpAttributeField::DecodeLC( _L8( "a=rtcp: 5050  IN IP4 2.2.2.2 \r\n" ) );
+    audioLine->AttributeFields().AppendL( rtcp );
+    CleanupStack::Pop( rtcp );
+    iSdpCodec->DecodeRemoteRtcpFieldL( *audioLine, *mediaStream );
+    EUNIT_ASSERT_EQUALS( 5050, mediaStream->iRemoteRtcpPort )
+    EUNIT_ASSERT_EQUALS( INET_ADDR( 2,2,2,2 ), mediaStream->iRemoteRtcpAddress.Address() )
+    audioLine->AttributeFields().ResetAndDestroy();
+    
+    rtcp = CSdpAttributeField::DecodeLC( _L8( "a=rtcp:  50506\r\n" ) );
+    audioLine->AttributeFields().AppendL( rtcp );
+    CleanupStack::Pop( rtcp );
+    iSdpCodec->DecodeRemoteRtcpFieldL( *audioLine, *mediaStream );
+    EUNIT_ASSERT_EQUALS( 50506, mediaStream->iRemoteRtcpPort )
+    EUNIT_ASSERT_EQUALS( INET_ADDR( 2,2,2,2 ), mediaStream->iRemoteRtcpAddress.Address() )
+    audioLine->AttributeFields().ResetAndDestroy();
+       
     CleanupStack::PopAndDestroy( sdp );
     }
     
@@ -1349,7 +1385,6 @@
     CleanupStack::PopAndDestroy( sdp );
 
     }
-    
 
 
 void UT_CMceMediaSdpCodec::UT_CMceMediaSdpCodec_DecodeDirectionLL()
--- a/multimediacommsengine/mmcesrv/mmceserver/inc/mcestateoffering.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/inc/mcestateoffering.h	Thu Jul 22 16:37:27 2010 +0100
@@ -22,6 +22,7 @@
 #define CMCESTATEOFFERING_H
 
 #include "mcestate.h"
+#include "mcesrv.h"
 
 /**
 *  Represents MCE server state Offering
@@ -154,7 +155,12 @@
     void ExitSIPEventL( TMceStateTransitionEvent& aEvent );
     
     void EntryAnswerToOfferDecodedL( TMceStateTransitionEvent& aEvent );
+	
+private:
+	TInt iLastResponse;
+	TBool iReadyToSendACK;
 
+    MCESRV_UT_DEFINITIONS;
 	};
 
 #endif
--- a/multimediacommsengine/mmcesrv/mmceserver/src/mcesipmanager.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/src/mcesipmanager.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -1084,5 +1084,21 @@
 				}
 			}
 		}
+
+	// Update orphan subsessions
+    RPointerArray<CMceCsSubSession>& orphanSubSessions = iOrphanSubSessions->SubSessions();
+    TInt orphanSubSessionCount = orphanSubSessions.Count();
+	
+    for ( TInt j = 0; j < orphanSubSessionCount; ++j )
+        {
+        CSIPProfile& subSessionProfile = orphanSubSessions[ j ]->Profile();
+        if ( &subSessionProfile == &aOldProfile )
+            {
+            MCESRV_DEBUG_DVALUE("update orphan subsession profile, j", j )
+            MCESRV_DEBUG_DVALUES("oldProfile", (TInt)&aOldProfile,
+                                 "newProfile", (TInt)&aNewProfile )
+            orphanSubSessions[ j ]->SetProfile( aNewProfile );
+            }
+        }
 	MCESRV_DEBUG("CMceSipManager::UpdateProfileToSubSessions, Exit")
 	}
--- a/multimediacommsengine/mmcesrv/mmceserver/src/mcestateestablished.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/src/mcestateestablished.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -27,7 +27,7 @@
 #include "mcenatmacros.h"
 #include "mcesdpsession.h"
 #include "mcesrvlogs.h"
-
+#include "mcenatsipsession.h"
 
 // -----------------------------------------------------------------------------
 // CMceStateEstablished::CMceStateEstablished
@@ -180,7 +180,12 @@
 	        //and thus, refresh is launched (INVITE)
 	        case EMceSessionRefresh:
 	            {
-	            session.Actions().EncodeL();
+                session.Actions().EncodeL();
+                if ( session.IsNatSession() ) 
+                    {
+                    CMceNatSipSession* natSession = static_cast<CMceNatSipSession*>( &session );
+                    natSession->CreateOfferL();
+                    }
 	            session.FCActions().UpdateFCOfferL( *session.Offer() );
 	            session.Actions().SendSessionRefreshL();
 	            break;
--- a/multimediacommsengine/mmcesrv/mmceserver/src/mcestateoffering.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/src/mcestateoffering.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -43,7 +43,9 @@
 // -----------------------------------------------------------------------------
 //
 CMceStateOffering::CMceStateOffering ()
-    : CMceState( KMceStateOffering )
+    : CMceState( KMceStateOffering ),
+      iLastResponse ( 0 ),
+	  iReadyToSendACK ( ETrue )
 	{
 	}
 
@@ -264,6 +266,7 @@
     TInt status = KErrNone;
     CMceSipSession& session = aEvent.Session();
     CSIPClientTransaction& response = session.Response();
+    iLastResponse = MceSip::ResponseCode( response );
      
     session.Extensions().UpdateL( response );
     session.Actions().CheckContactIsSecureL( response );
@@ -439,14 +442,35 @@
     TInt status = KErrNone;
 	CMceSipSession& session = aEvent.Session();
     CMceSipSession::TSubState subState = session.SubState();
+    TInt currentResponse = MceSip::ResponseCode( session.Response() );
 	
+	// If media handling is ongoing while 200OK arrives with certain SDP content
+    // don't send ACK thus the UAS will retransmit 200OK untile pervious meida handling
+    // finish.
+ 
+    if ( KMceSipRinging == iLastResponse &&
+    	 KMceSipOK == currentResponse && 
+    	 MceSip::HasContent( session.Response() ) )
+    	{
+		if ( session.WaitingMediaCallback() )
+    		{
+			iReadyToSendACK = EFalse;
+			MCESRV_DEBUG("Waiting media callback, do not send ACK for this 200OK")
+    		return;
+    		}
+    	else
+    		{
+			iReadyToSendACK = ETrue;
+			MCESRV_DEBUG("Ready to send ACK")
+    		}
+    	}
     //send ACK
     session.Actions().SendACKL( session.Response() );
 	session.Actions().CheckContactIsSecureL( session.Response() );
     session.ActiveBody().AnswerType() = KMceNegotiationAnswerTypeFinal;
     
-	// Handle the answer only if the media processing is not
-	// already ongoing
+    iLastResponse = currentResponse;
+
 	if ( !session.WaitingMediaCallback() )
 	    {
 	    if ( MceSip::HasContent( session.Response() ) )
@@ -767,6 +791,11 @@
 //
 void CMceStateOffering::ExitL( TMceStateTransitionEvent& aEvent )
 	{
+	if ( !iReadyToSendACK )
+		{
+		MCESRV_DEBUG("Not ready, don't change any state");
+		return;
+		}
 	
 	if ( IsExtensionRequestEvent( aEvent ))
 		{
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/inc/UT_CMCESIPManager.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/inc/UT_CMCESIPManager.h	Thu Jul 22 16:37:27 2010 +0100
@@ -102,6 +102,8 @@
         void UT_CMceSipManager_SIPClientL();
 
         void UT_CMceSipManager_OrphanSubSessionCountL();
+        
+        void UT_CMceSipManager_UpdateProfileToSubSessionsL();
          
 
     private:    // Data
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/src/UT_CMCESIPManager.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/src/UT_CMCESIPManager.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -480,6 +480,43 @@
   	EUNIT_ASSERT( iManager->OrphanSubSessionCount() == 0 );
     }
 
+void UT_CMceSipManager::UT_CMceSipManager_UpdateProfileToSubSessionsL()
+    {
+    iIds.iProfileID = 1;
+    iIds.iManagerType = KMceCSSIPSession;
+    iIds.iDialogType = KMceDlgTypeInvite;
+    
+	CDesC8ArrayFlat* params = new (ELeave) CDesC8ArrayFlat( KMceArrayGranularity );
+	CleanupStack::PushL( params );
+	params->AppendL( _L8("User <user2@host>") );
+	params->AppendL( _L8("User <user@host>") );
+    
+    CMceCsSubSession* subsession = 
+        iManager->CreateSubSessionL( *iSession, iIds, *params );
+    CleanupStack::PushL( subsession );
+    
+    CSIPProfile& profileOld = subsession->Profile();
+  	EUNIT_ASSERT( &profileOld != NULL );
+    CSIPProfile& profileNew = iManager->ProfileL( 2 );
+  	EUNIT_ASSERT( &profileNew != NULL );
+
+  	CMceCsSessionImplementation& session = iManager->iClients[ 0 ]->Implementation();
+  	RPointerArray<CMceCsSubSession>& subSessions = session.SubSessions();
+  	subSessions.AppendL(subsession);
+  	
+  	iManager->UpdateProfileToSubSessions(profileNew, profileOld);
+  	EUNIT_ASSERT(&subsession->Profile() == &profileNew)
+  	subSessions.Remove(0);
+
+  	iManager->AddOrphanSubSessionL( subsession );
+  	iManager->UpdateProfileToSubSessions(profileOld, profileNew);
+  	RPointerArray<CMceCsSubSession>& orphanSubSessions = iManager->iOrphanSubSessions->SubSessions();
+  	EUNIT_ASSERT(&subsession->Profile() == &profileOld)
+
+  	CleanupStack::Pop( subsession );
+  	CleanupStack::PopAndDestroy( params );
+    }
+
 
 //  TEST TABLE
 
@@ -621,6 +658,12 @@
     "FUNCTIONALITY",
     SetupL, UT_CMceSipManager_OrphanSubSessionCountL, Teardown)
 
+EUNIT_TEST(
+    "UpdateProfileToSubSessions - test ",
+    "CMceSipManager",
+    "UpdateProfileToSubSessions",
+    "FUNCTIONALITY",
+    SetupL, UT_CMceSipManager_UpdateProfileToSubSessionsL, Teardown)
 
 EUNIT_END_TEST_TABLE
 
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/inc/sipprofile.h	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/inc/sipprofile.h	Thu Jul 22 16:37:27 2010 +0100
@@ -325,6 +325,11 @@
 		*/
 		void ClearRegistry();
 		
+		/**
+		* Set context id
+		*/
+		void SetContextId(TInt aContextId);
+		
 	public: // for unittesting
 	    
 	    void SetParam( TUint aParam, HBufC8* aValue );
@@ -377,6 +382,8 @@
         HBufC8* iRequestUriUser;
         HBufC8* iContactHeader;
         
+        TInt	iContextId;
+        
     	//definitions for unit testing
     	MCESRV_UT_DEFINITIONS
 
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/src/sipprofile.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/src/sipprofile.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -191,7 +191,7 @@
 	    }
 	if( aParam == KSIPProfileId )
 		{
-		aVal = 1;
+		aVal = ContextId();
 		}
 	return ret;
 	}	
@@ -279,7 +279,7 @@
 // -----------------------------------------------------------------------------
 //	
 CSIPProfile::CSIPProfile():
-	iEnabled(EFalse)
+	iEnabled(EFalse), iContextId(1)
 	{
 	}
 
@@ -307,6 +307,11 @@
 	{
 	return ETrue;
 	}
+
+void CSIPProfile::SetContextId(TInt aContextId)
+	{
+	iContextId = aContextId;
+	}
 	
 // -----------------------------------------------------------------------------
 // CSIPProfile::ContextId
@@ -314,7 +319,7 @@
 //	
 TUint32 CSIPProfile::ContextId() const
 	{
-	return 1;
+	return iContextId;
 	}
 
 // -----------------------------------------------------------------------------
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/src/sipprofileregistrybase.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/stubs/src/sipprofileregistrybase.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -52,9 +52,13 @@
 	// stubs
 	CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this;
 	CSIPProfile* profile = CSIPProfile::NewLC(reg);
+	CSIPProfile* profile2 = CSIPProfile::NewLC(reg);
+	profile2->SetContextId(2);
 	
 	aProfiles.AppendL ( profile  );
+	aProfiles.AppendL ( profile2  );
 	
+	CleanupStack::Pop( profile2 );
 	CleanupStack::Pop( profile );
 
 	
@@ -72,8 +76,12 @@
 	CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this;
 	
 	CSIPProfile* profile = CSIPProfile::NewLC( reg );
+	CSIPProfile* profile2 = CSIPProfile::NewLC(reg);
+	profile2->SetContextId(2);
 	aProfiles.AppendL ( profile  );
+	aProfiles.AppendL ( profile2  );
 
+	CleanupStack::Pop( profile2 );
 	CleanupStack::Pop( profile );
 	
 	}
--- a/natfw/natfwconnectionmultiplexer/src/cncmconnectionobserverhandler.cpp	Thu Jun 17 22:31:54 2010 +0100
+++ b/natfw/natfwconnectionmultiplexer/src/cncmconnectionobserverhandler.cpp	Thu Jul 22 16:37:27 2010 +0100
@@ -260,20 +260,25 @@
         const TInt KRtpRtcpDiffByteOffset( 1 );
         const TInt KLowestAssignedRtcpMsgType = 200;
         const TInt KHighestAssignedRtcpMsgType = 209;
+        TInt rtcpType = aMessage[KRtpRtcpDiffByteOffset];
         TBool isRtcp = 
-           ( KLowestAssignedRtcpMsgType <= aMessage[KRtpRtcpDiffByteOffset] &&
-            aMessage[KRtpRtcpDiffByteOffset] <= KHighestAssignedRtcpMsgType );
+           ( KLowestAssignedRtcpMsgType <= rtcpType &&
+        		   rtcpType <= KHighestAssignedRtcpMsgType );
         
-        // This offset refers either to SR RTP timestamp or RR highest 
-        // sequence number received. These are unique for a distinct 
-        // RTCP packet.
-        const TInt KRtcpDiffByteOffset( 19 );
+        // This offset refers to RR highest sequence number received.
+        const TInt KRRtcpDiffByteOffset( 19 );
+        
+        // This offset refers either to SR RTP packet count received.
+        const TInt KSRtcpDiffByteOffset( 23 );
         
         // This offset refers to lower byte of unique RTP sequence number.
         const TInt KRtpDiffByteOffset( 3 );
         TInt diffByteOffset 
-            = isRtcp ? KRtcpDiffByteOffset : KRtpDiffByteOffset;
+            = isRtcp ? KRRtcpDiffByteOffset : KRtpDiffByteOffset;
 
+        diffByteOffset = (rtcpType == KLowestAssignedRtcpMsgType)?
+        		KSRtcpDiffByteOffset : diffByteOffset;
+        
         if ( diffByteOffset < aMessage.Size() )
             {
             hash = aMessage[diffByteOffset];
@@ -294,14 +299,12 @@
             }
         else
             {
-            isDuplicate = EFalse;
-            }
-        
-        iLatestHashes.Append( hash );
-        const TInt KMaxHashCount( 5 );
-        if ( KMaxHashCount <= iLatestHashes.Count() )
-            {
-            iLatestHashes.Remove( 0 );
+            iLatestHashes.Append( hash );
+            const TInt KMaxHashCount( 5 );
+            if ( KMaxHashCount <= iLatestHashes.Count() )
+                {
+                iLatestHashes.Remove( 0 );
+                }
             }
         }
     else
--- a/package_definition.xml	Thu Jun 17 22:31:54 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
-  <package id="ipappsrv" name="IP App Services" levels="framework generic server conn plugin">
-    <collection id="multimediacommscontroller" name="Multimedia Comms Controller" level="conn">
-      <component id="mmccinterface" filter="s60" name="MMCC Interface">
-        <!-- <unit bldFile="multimediacommscontroller/mmccinterface/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccinterface/tsrc/ut_interface/group"/> -->
-      </component>
-      <component id="mmccjitterbuffer" filter="s60" name="Jitter Buffer">
-        <!-- <unit bldFile="multimediacommscontroller/mmccjitterbuffer/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccjitterbuffer/tsrc/ut_jitterbuffer/group"/> -->
-      </component>
-      <component id="mmccqoscontroller" filter="s60" name="QoS Controller">
-        <!-- <unit bldFile="multimediacommscontroller/mmccqoscontroller/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccqoscontroller/tsrc/ut_qoscontroller/group"/> -->
-      </component>
-      <component id="mmccmultiplexer" filter="s60" name="MMCC Multiplexer">
-        <!-- <unit bldFile="multimediacommscontroller/mmccmultiplexer/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccmultiplexer/tsrc/ut_multiplexer/group"/> -->
-      </component>
-      <component id="mmccsubcontroller" filter="s60" name="MMCC Subcontroller">
-        <!-- <unit bldFile="multimediacommscontroller/mmccsubcontroller/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccsubcontroller/tsrc/ut_rtpmediaclock/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccsubcontroller/tsrc/ut_subcontroller/group"/> -->
-      </component>
-      <component id="mmcccontroller" filter="s60" name="MMCC Controller" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmcccontroller/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmcccontroller/tsrc/ut_controller/group"/> -->
-      </component>
-      <component id="mmccredpayloadformat" filter="s60" name="Redundancy Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccredpayloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccredpayloadformat/tsrc/ut_redpayloadformat/group"/> -->
-      </component>
-      <component id="mmccamrpayloadformat" filter="s60" name="AMR Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccamrpayloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccamrpayloadformat/tsrc/ut_amrpayloadformat/group"/> -->
-      </component>
-      <component id="mmccg711payloadformat" filter="s60" name="G711 Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccg711payloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccg711payloadformat/tsrc/ut_g711payloadformat/group"/> -->
-      </component>
-      <component id="mmccg729payloadformat" filter="s60" name="G729 Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccg729payloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccg729payloadformat/tsrc/ut_g729payloadformat/group"/> -->
-      </component>
-      <component id="mmccilbcpayloadformat" filter="s60" name="ILBC Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccilbcpayloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccilbcpayloadformat/tsrc/ut_ilbcpayloadformat/group"/> -->
-      </component>
-      <component id="mmccdtmfpayloadformat" filter="s60" name="DTMF Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccdtmfpayloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccdtmfpayloadformat/tsrc/ut_dtmfpayloadformat/group"/> -->
-      </component>
-      <component id="mmccrtpsourcesink" filter="s60" name="RTP Source Sink" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccrtpsourcesink/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccrtpsourcesink/tsrc/ut_rtpsourcesink/group"/> -->
-      </component>
-      <component id="mmccvideosourcesink" filter="s60" name="Video Source Sink" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccvideosourcesink/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccvideosourcesink/tsrc/ut_videosourcesink/group"/> -->
-      </component>
-      <component id="mmcch263payloadformat" filter="s60" name="H263 Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmcch263payloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmcch263payloadformat/tsrc/ut_h263payloadformat/group"/> -->
-      </component>
-      <component id="mmccanypayloadformat" filter="s60" name="Any Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccanypayloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccanypayloadformat/tsrc/ut_anypayloadformat/group"/> -->
-      </component>
-      <component id="mmccfilesourcesink" filter="s60" name="MMCC File Source Sink" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccfilesourcesink/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccfilesourcesink/tsrc/ut_filesourcesink/group"/> -->
-      </component>
-      <component id="mmccanysourcesink" filter="s60" name="Any Source Sink" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccanysourcesink/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccanysourcesink/tsrc/ut_anysourcesink/group"/> -->
-      </component>
-      <component id="mmccavcpayloadformat" filter="s60" name="AVC Payload Format" class="plugin">
-        <!-- <unit bldFile="multimediacommscontroller/mmccavcpayloadformat/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/mmccavcpayloadformat/tsrc/ut_avcpayloadformat/group"/> -->
-      </component>
-      <component id="multimediacommscontroller_build" filter="s60" name="Multimedia Comms Controller Build">
-              <!-- contents of this component need to be distributed out to the other commented-out bld.infs or the other components need to be collapsed into one -->
-        <unit bldFile="multimediacommscontroller/group"/>
-      </component>
-      <component id="multimediacommscontroller_test" filter="s60" name="Multimedia Comms Controller Test" purpose="development">
-        <!-- <unit bldFile="multimediacommscontroller/tsrc/testconsoles/mcpsubthreads/dptests/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/tsrc/testconsoles/mcpsubthreads/clienttests/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/tsrc/componenttests/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/tsrc/subcontrollerstub/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/tsrc/testconsoles/jitterbuffertestconsole/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/tsrc/testconsoles/rtpsourcesink/group"/> -->
-        <!-- <unit bldFile="multimediacommscontroller/tsrc/testconsoles/mcpconsole/group"/> -->
-      </component>
-    </collection>
-    <collection id="multimediacommsengine" name="Multimedia Comms Engine" level="generic">
-      <component id="mmcesrv" filter="s60" name="Multimedia Comms Engine Server">
-        <!-- <unit bldFile="multimediacommsengine/mmcesrv/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/mmcesrv/mmceevent/tsrc/ut_event/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/mmcesrv/mmceevent/tsrc/ut_event/sip_stub/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/group"/> -->
-      </component>
-      <component id="mmcecli" filter="s60" name="Multimedia Comms Engine Client">
-        <!-- <unit bldFile="multimediacommsengine/mmcecli/group"/> -->
-      </component>
-      <component id="mmcefloorctrlengine" filter="s60" name="MCE Floor Control Engine">
-        <!-- <unit bldFile="multimediacommsengine/mmcefloorctrlengine/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/mmcefloorctrlengine/tsrc/ut_floorctrlengine/fctestpplugin/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/mmcefloorctrlengine/tsrc/ut_floorctrlengine/fctestpplugin2/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/mmcefloorctrlengine/tsrc/ut_floorctrlengine/group"/> -->
-      </component>
-      <component id="mmcefloorctrlplugin" filter="s60" name="MCE Floor Control Plugin" class="plugin">
-        <!-- <unit bldFile="multimediacommsengine/mmcefloorctrlplugin/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/mmcefloorctrlplugin/tsrc/ut_floorctrlplugin/group"/> -->
-      </component>
-      <component id="multimediacommsengine_build" filter="s60" name="Multimedia Comms Engine Build">
-              <!-- contents of this component need to be distributed out to the other commented-out bld.infs or the other components need to be collapsed into one -->
-        <unit bldFile="multimediacommsengine/group"/>
-      </component>
-      <component id="multimediacommsengine_test" filter="s60" name="Multimedia Comms Engine Test" purpose="development">
-        <!-- <unit bldFile="multimediacommsengine/tsrc/mcetestui/mcetestuiplugin/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/mcetestui/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/testdriver/siptester/ttcnresolverplugin/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/mmctestdriver/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/mmctestdriver/mcetester/iceplugin_stub/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/mmctestdriver/mcetester/ttcnresolverplugin/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/testdriver/siptester/ttcnresolverplugin2/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/mcetestui/mcetestuiengine/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/testdriver/group/s60_public_sdk"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/mmctestdriver/mcetester/iceplugin_stub/tsrc/test/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/testdriver/group"/> -->
-        <!-- <unit bldFile="multimediacommsengine/tsrc/mmctestdriver/mcetester/voipplugin/group"/> -->
-      </component>
-    </collection>
-    <collection id="natfw" name="NAT Framework" level="framework">
-      <component id="natfwsettings" filter="s60" name="NAT Framework Settings" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwsettings/group"/> -->
-        <!-- <unit bldFile="natfw/natfwsettings/tsrc/ut_cnatfwnatsettings/group"/> -->
-      </component>
-      <component id="natfwconnectionmultiplexer" filter="s60" name="NAT Framework Connection Multiplexer" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwconnectionmultiplexer/group"/> -->
-        <!-- <unit bldFile="natfw/natfwconnectionmultiplexer/tsrc/muxtestconsole/group"/> -->
-        <!-- <unit bldFile="natfw/natfwconnectionmultiplexer/tsrc/ut_connectionmultiplexer/group"/> -->
-      </component>
-      <component id="natfwclient" filter="s60" name="NAT Framework Client" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwclient/group"/> -->
-        <!-- <unit bldFile="natfw/natfwclient/tsrc/ut_natfwclient/group"/> -->
-      </component>
-      <component id="natfwsocketmediaconnwrapper" filter="s60" name="Socket Media Connection Wrapper" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwsocketmediaconnwrapper/group"/> -->
-        <!-- <unit bldFile="natfw/natfwsocketmediaconnwrapper/tsrc/ut_socketmediaconnwrapper/group"/> -->
-      </component>
-      <component id="natfwunsaf_protocols" filter="s60" name="UNSAF Protocols" introduced="^2">
-          <!-- consider expanding name to UNilateral Self- Address Fixing Protocols -->
-        <!-- <unit bldFile="natfw/natfwunsaf_protocols/group"/> -->
-        <!-- <unit bldFile="natfw/natfwunsaf_protocols/tsrc/ut_unsaf_codec/group"/> -->
-        <!-- <unit bldFile="natfw/natfwunsaf_protocols/tsrc/ut_unsaf_transport/group"/> -->
-      </component>
-      <component id="natfwstunturnclient" filter="s60" name="STUN TURN Client" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwstunturnclient/group"/> -->
-        <!-- <unit bldFile="natfw/natfwstunturnclient/tsrc/ut_stunturnclient/group"/> -->
-      </component>
-      <component id="natfwstunserver" filter="s60" name="STUN Server" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwstunserver/group"/> -->
-        <!-- <unit bldFile="natfw/natfwstunserver/tsrc/ut_cnatfwstunsrv/group"/> -->
-      </component>
-      <component id="natfwicecandidatehandler" filter="s60" name="ICE Candidate Handler" class="plugin" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwicecandidatehandler/group"/> -->
-        <!-- <unit bldFile="natfw/natfwicecandidatehandler/tsrc/ut_icecandidatehandler/group"/> -->
-      </component>
-      <component id="natfwstunplugin" filter="s60" name="STUN Plugin" class="plugin" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwstunplugin/group"/> -->
-        <!-- <unit bldFile="natfw/natfwstunplugin/tsrc/ut_cnatfwstunplugin/group"/> -->
-      </component>
-      <component id="natfwturnplugin" filter="s60" name="TURN Plugin" class="plugin" introduced="^2">
-        <!-- <unit bldFile="natfw/natfwturnplugin/group"/> -->
-        <!-- <unit bldFile="natfw/natfwturnplugin/tsrc/ut_cnatfwturnplugin/group"/> -->
-      </component>
-      <component id="natfw_build" filter="s60" name="NAT Framework Build" introduced="^2">
-              <!-- contents of this component need to be distributed out to the other commented-out bld.infs or the other components need to be collapsed into one -->
-        <unit bldFile="natfw/group"/>
-      </component>
-      <component id="natfw_test" filter="s60" name="NAT Framework Test" purpose="development" introduced="^2">
-        <!-- <unit bldFile="natfw/tsrc/natfwtestconsoles/natfwtestconsole/group"/> -->
-      </component>
-    </collection>
-    <collection id="natplugins" name="NAT Plugins" level="plugin">
-         <!-- are the extra test units in here needed at all? Either incorperate into main unit as test projects or remove-->
-      <component id="natpcliprovisioningnatfwadapter" filter="s60" name="Client Provisioning NAT Framework Traversal Adapter" class="plugin" introduced="^2">
-        <unit bldFile="natplugins/natpcliprovisioningnatfwadapter/group"/>
-        <!-- <unit bldFile="natplugins/natpcliprovisioningnatfwadapter/tsrc/t_natfwtraversaladapter/group"/> -->
-      </component>
-      <component id="natpdevmgmtnatfwadapter" filter="s60" name="Device Management NAT Framework Traversal Adapter" class="plugin">
-        <unit bldFile="natplugins/natpdevmgmtnatfwadapter/group"/>
-        <!-- <unit bldFile="natplugins/natpdevmgmtnatfwadapter/tsrc/ut_cnsmldmnatfwtraversaladapter/group"/> -->
-      </component>
-      <component id="natptraversalcontroller" filter="s60" name="NAT Traversal Controller" class="plugin">
-        <unit bldFile="natplugins/natptraversalcontroller/group"/>
-        <!-- <unit bldFile="natplugins/natptraversalcontroller/tsrc/ut_nattraversalcontroller/group"/> -->
-      </component>
-      <component id="natpnatfwsdpprovider" filter="s60" name="NAT Framework SDP Provider" class="plugin">
-        <unit bldFile="natplugins/natpnatfwsdpprovider/group"/>
-        <!-- <unit bldFile="natplugins/natpnatfwsdpprovider/tsrc/testconsole/group"/> -->
-        <!-- <unit bldFile="natplugins/natpnatfwsdpprovider/tsrc/ut_natfwsdpprovider/group"/> -->
-      </component>
-    </collection>
-    <collection id="ipappsrv_info" name="IP App Services Info" level="plugin">
-      <component id="ipappsrv_metadata" name="IP App Services Metadata" class="config" introduced="^2" purpose="development" target="desktop">
-        <unit mrp="ipappsrv_info/ipappsrv_metadata/ipappsrv_metadata.mrp"/>
-      </component>
-    </collection>
-  </package>
-</SystemDefinition>