Revision: 201011
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 16:34:49 +0300
changeset 13 efebd1779a59
parent 0 40261b775718
child 15 c1e808730d6c
Revision: 201011 Kit: 201015
audio/ARM_CMMF_codecs/FrameTable/Group/FrameTable.mmp
devsound/a3facf/group/multimedia_a3f_acf.mrp
devsound/a3fdevsound/group/multimedia_a3f_devsound.mrp
devsound/a3fdevsound/src/devsoundadaptor/cdevaudiocontrol.cpp
devsound/a3fdevsound/src/devsoundadaptor/cdevcommoncontrol.cpp
devsound/a3fdevsound/src/devsoundadaptor/cdevrecordcontrol.cpp
devsound/a3fdevsound/src/devsoundadaptor/mmfdevsoundadaptation.h
devsound/a3fdevsound/src/mmfdevsoundproxy/mmfdevsoundproxy.cpp
devsound/a3fdevsound/src/mmfdevsoundserver/mmfdevsoundsession.cpp
devsound/a3fdevsound/src/mmfdevsoundserver/mmfdevsoundsession.h
devsound/a3fsrvstart/group/multimedia_a3f_serverstart.mrp
devsound/a3ftrace/group/multimedia_a3f_traces.mrp
devsoundextensions/audiorouting/Output/AudioOutputProxy/src/AudioOutputProxy.cpp
devsoundextensions/audiorouting/Output/AudioOutputProxy/src/AudioOutputProxyAO.cpp
devsoundextensions/ciextnfactoryplugins/ciextnclientplugin/src/ciextnclientplugin.h
devsoundextensions/ciextnfactoryplugins/ciextnserverplugin/src/ciextnserverplugin.h
devsoundextensions/effectspresets/Group/bld.inf
imagingandcamerafws/camerafw/group/multimedia_ecam_framework.mrp
imagingandcamerafws/imagingfws/Documentation/ICL Current status.rtf
inc/AudioOutputProxyAO.h
layers.sysdef.xml
mdfdevvideoextensions/nga_mdf_postprocessor/group/bld.inf
mdfdevvideoextensions/nga_mdf_postprocessor/inc/NGAPostProcHwDevice.h
mdfdevvideoextensions/nga_mdf_postprocessor/src/200195AF.rss
mdfdevvideoextensions/nga_mdf_postprocessor/src/NGAPostProcHwDevice.cpp
mm_info/mm_metadata/mm_metadata.mrp
mm_info/mmdocs/Test_Specs/GT0396.111 MMF_CTLFRM_SecureDRM Unit Test Specification.xls
mm_info/mmdocs/Test_Specs/GT0396.112 MMF_UnitTestSpec_DrmPluginServer.xls
mm_info/mmdocs/Test_Specs/MDF_UnitTestSpec_OmxVorbisCodecs v1.0.xls
mm_info/mmdocs/Test_Specs/MMF_UnitTestSpec_ BASECL.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.103 Rev1.01 MMF ACOD Unit Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.110 Rev1.01 MMF BASECL Unit Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.111 Rev1.01 MMF CTLFRM Unit Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.113 Rev1.03 MMF AFMT Unit Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.115 Rev1.03 ICL Integration Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.116 Rev1.21 MMF Controller Integration Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.117 Rev1.11 Bitmap Transform Integration Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.119 Rev1.12 MMF Video Clients Integration Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.120 Rev1.08 MMF Audio Clients Integration Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.127 Rev1.01 MMFAudioControllerPlugin_Unit_Test_Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.128 Rev1.01 Multimedia Test Framework Unit Test Specification.xls
mm_info/mmdocs/Test_Specs/SGL.GT0137.136 Rev1.01 Bitmap Transform Unit Test Specification.xls
mm_info/mmdocs/multimedia_documentation.mrp
mm_plat/audio_routing_api/tsrc/AudioRoutingTestClass/group/AudioRoutingTestClass.mmp
mm_pub/audio_effects_api/tsrc/AudioEffectTestModule/group/AudioEffectTestModule.mmp
mm_pub/audio_effects_presets_api/tsrc/EffectPresetsTest/group/EffectPresetsTest.mmp
mm_pub/drm_audio_player_api/tsrc/DRMAudioPlay/inc/DRMAudioPlay.h
mm_pub/drm_audio_player_api/tsrc/DRMAudioPlay/src/DRMAudioPlay_core.cpp
mm_pub/drm_audio_player_api/tsrc/data/mmc/drm/test3gp.dcf
mm_pub/drm_audio_player_api/tsrc/data/mmc/drm/testmp3.dcf
mmdevicefw/mdf/src/audio/mdasoundadapter/mdasoundadapterbody.cpp
mmhais/a3facl/group/multimedia_a3f_acl.mrp
mmhais/a3fdevsoundcustomisation/group/multimedia_a3f_devsoundadaptationinfo.mrp
mmhais/refacladapt/group/multimedia_a3f_refacladaptation.mrp
mmlibs/mmfw/MMPFiles/client/MediaClientVideo.mmp
mmlibs/mmfw/MMPFiles/client/mediaclientvideodisplay.mmp
mmlibs/mmfw/inc/mmf/PLUGIN/mmfmediaclientextdisplayinterface.h
mmlibs/mmfw/inc/mmf/common/MmfPanicCodes.h
mmlibs/mmfw/inc/mmf/server/mmfdatasink.h
mmlibs/mmfw/src/Client/Utility/mmfclientutility.cpp
mmlibs/mmfw/src/Client/Video/mediaclientextdisplayhandler.cpp
mmlibs/mmfw/src/Client/Video/mediaclientextdisplayhandler.h
mmlibs/mmfw/src/Client/Video/mediaclientextdisplayinterface.cpp
mmlibs/mmfw/src/Client/Video/mediaclientvideodisplay.cpp
mmlibs/mmfw/src/Client/Video/mediaclientvideodisplaybody.cpp
mmlibs/mmfw/src/Client/Video/mediaclientvideodisplaybody.h
mmlibs/mmfw/src/Client/Video/mediaclientvideotrace.h
mmlibs/mmfw/src/Client/Video/mmfclientvideoplayerbody.cpp
mmlibs/mmfw/src/Plugin/StdSourceAndSink/Mmffile.cpp
mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/TestRecorder.cpp
mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/inc/TSU_MMF_DEVSOUND_STEP.h
mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/scripts/tsu_mmf_devsound_suite_truepause.script
mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/scripts/tsu_mmf_truepause_devsound.ini
mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/src/TSU_MMF_DEVSOUND_STEP.cpp
mmlibs/mmfw/tsrc/mmfunittest/MmpFiles/TSU_MMF_VCLNT_01.mmp
mmlibs/mmfw/tsrc/mmfunittest/VCLNT/TSU_MMF_VCLNT_01/TestStepUnitMMFVidClient.cpp
mmlibs/mmfw/tsrc/mmfunittest/aclnt/TSU_MMF_ACLNT_01/TestStepAudInStream.cpp
mmlibs/mmfw/tsrc/mmfunittest/aclnt/TSU_MMF_ACLNT_01/TestStepPlayerPlay.cpp
mmlibs/mmfw/tsrc/mmfunittest/ctlfrm/mp3/MmfMP3Format/101F7D99.rss
mmlibs/mmutilitylib/group/multimedia_common.mrp
mmplugins/lib3gp/group/multimedia_3gplibrary.mrp
mmplugins/lib3gp/impl/src/file.cpp
mmresourcemgmt/mmresctrl/group/multimedia_a3f_refmmrc.mrp
mmtestenv/mmtesttools/Build/buildutils/mmbuild2.py
mmtestenv/mmtesttools/Build/mmbuildrom.pl
video/ARM_MDF_Decoders/Utilities/BufferProcessor/src/BaseEngineImplementation.cpp
video/ARM_MDF_Decoders/Utilities/group/bld.inf
--- a/audio/ARM_CMMF_codecs/FrameTable/Group/FrameTable.mmp	Tue Feb 02 01:56:55 2010 +0200
+++ b/audio/ARM_CMMF_codecs/FrameTable/Group/FrameTable.mmp	Fri Apr 16 16:34:49 2010 +0300
@@ -62,7 +62,7 @@
 
 
 
-MW_LAYER_SYSTEMINCLUDE
+OS_LAYER_SYSTEMINCLUDE
 
 SYSTEMINCLUDE   /epoc32/include/mmf/common
 
--- a/devsound/a3facf/group/multimedia_a3f_acf.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3facf/group/multimedia_a3f_acf.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_a3f_acf.mrp
 #
-#Copyright (c) Symbian Software Ltd 2007.  All rights reserved.
+# Copyright (c) 2007 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	multimedia_a3f_acf
--- a/devsound/a3fdevsound/group/multimedia_a3f_devsound.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fdevsound/group/multimedia_a3f_devsound.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_a3f_devsound.mrp
 #
-#Copyright (c) Symbian Software Ltd 2007.  All rights reserved.
+# Copyright (c) 2007 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	multimedia_a3f_devsound
--- a/devsound/a3fdevsound/src/devsoundadaptor/cdevaudiocontrol.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fdevsound/src/devsoundadaptor/cdevaudiocontrol.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -937,7 +937,15 @@
 
 	if (aEvent == KUidA3FContextUpdateComplete)
 		{
-		iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
+	    if(iIgnoreAsyncOpComplete)
+			{
+            iAdaptationObserver->PreemptionFinishedCallbackReceived(ETrue);
+		    iIgnoreAsyncOpComplete = EFalse;
+   	    	}
+        else
+            {
+            iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
+           	}
 		}
 	else if(aEvent == KUidA3FContextPreEmption || aEvent == KUidA3FContextPreEmptedCommit)
 		{
--- a/devsound/a3fdevsound/src/devsoundadaptor/cdevcommoncontrol.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fdevsound/src/devsoundadaptor/cdevcommoncontrol.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -160,9 +160,9 @@
 
     if(iCallbackFromAdaptor == KCallbackNone)   
         {
+        iProcessingUnitError = aError;
         iCallbackFromAdaptor = KCallbackProcessingUnitError;
-        iAdaptationObserver->CallbackFromAdaptorReceived(KCallbackProcessingUnitError, KErrNone);
-        iProcessingUnitError = aError;
+        iAdaptationObserver->CallbackFromAdaptorReceived(KCallbackProcessingUnitError, aError);
         }
     else
         {
@@ -177,28 +177,42 @@
 void CDevCommonControl::ContextEvent(TUid aEvent, TInt aError) 
     {
     DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
-    DP_IN();
+    DP3_IN("ContextEvent aEvent=%x iActiveState=%d aError=%d",aEvent, iDevAudio->iActiveState, aError);
 
     // Can't "switch {...}" on UIDs unfortunately:
-
     if (aEvent == KUidA3FContextUpdateComplete)
         {
-        //use a sub state pattern to make premtion cycles like other cycles.
-        if(iBeingPreempted)
+        if(iBeingPreempted && iStateEventReceived)
             {
+            //use a sub state pattern to make premtion cycles like other cycles.
             DP1(DLERR,"Preemption error=%d", aError);
-            CDevAudioControl::ContextEvent(aEvent, aError);
             iDevAudio->iActiveState = EDevSoundAdaptorBeingPreempted;
             iBeingPreempted=EFalse;
             }
-        ContextEventUpdateComplete(aError);
+		ContextEventUpdateComplete(aError);
+        }
+
+    else if ((aEvent == KUidA3FContextCommitUpdate))
+        {
+        iBeingPreempted=EFalse; // clear being preempted
+        TBool adaptorControlsContext = iAdaptationObserver->AdaptorControlsContext();
+        iIgnoreAsyncOpComplete = !adaptorControlsContext;
+            // if we don't control context, always send a PreemptionFinishedCallbackReceived()
+		iStateEventReceived=EFalse;
         }
 
     else if ((aEvent == KUidA3FContextPreEmption) or (aEvent == KUidA3FContextPreEmptedCommit))
         {
-        //we are not being preemptied
+        // clear iBeingPreepted - will be set in ContextEventPreEmption if req
         iBeingPreempted=EFalse;
+        TBool adaptorControlsContext = iAdaptationObserver->AdaptorControlsContext();
+		iStateEventReceived=EFalse;
+        iIgnoreAsyncOpComplete=EFalse; // clear being iIgnoreAsyncOpComplete
         ContextEventPreEmption(aEvent, aError);
+        if (!adaptorControlsContext)
+            {
+            iIgnoreAsyncOpComplete = ETrue; // if we don't control context never do AsyncOpComplete
+            }
         }
 
     else if (aEvent == KUidA3FContextAbort)
@@ -212,7 +226,7 @@
 
 void CDevCommonControl::ContextEventAsynchronousPlayCompletion(TInt aError) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventAsynchronousPlayCompletion, CtxDevSound, DPLOCAL);
     DP_IN();
     
 	iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
@@ -228,7 +242,7 @@
 
 void CDevCommonControl::ContextEventAsynchronousInitializeComplete(TInt aError) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventAsynchronousInitializeComplete, CtxDevSound, DPLOCAL);
     DP_IN();
     
     iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
@@ -240,7 +254,7 @@
 
 void CDevCommonControl::ContextEventUpdateComplete(TInt aError) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventUpdateComplete, CtxDevSound, DPLOCAL);
     DP_IN();
     
     if (iStateEventReceived)
@@ -277,7 +291,7 @@
 
 void CDevCommonControl::ContextEventPreEmption(TUid aEvent, TInt aError) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventPreEmption, CtxDevSound, DPLOCAL);
     DP_IN();
     
     DP1(DLERR,"Preemption error=%d", aError);
@@ -290,7 +304,7 @@
 
 void CDevCommonControl::ContextEventAbort(TInt aError) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventAbort, CtxDevSound, DPLOCAL);
     DP_IN();
     
     DP1(DLERR,"Abort error=%d", aError);
@@ -302,7 +316,7 @@
 
 void CDevCommonControl::ContextEventStopDevSoundNotifications() // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventStopDevSoundNotifications, CtxDevSound, DPLOCAL);
     DP_IN();
     
     iDevAudio->iAudioStream->UnregisterAudioStreamObserver(*this);
@@ -316,7 +330,7 @@
 
 void CDevCommonControl::ContextEventPauseResumeSequenceDueToEmptyBuffers(TBool aFlush) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventPauseResumeSequenceDueToEmptyBuffers, CtxDevSound, DPLOCAL);
     DP_IN();
     
     TInt err(KErrNone);
@@ -345,7 +359,7 @@
 
 void CDevCommonControl::ContextEventStateDevSoundAdaptorUnloading() // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorUnloading, CtxDevSound, DPLOCAL);
     DP_IN();
     
     // Due destruction sequence or reinitialization
@@ -400,7 +414,7 @@
 
 void CDevCommonControl::ContextEventStateDevSoundAdaptorLoading() // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorLoading, CtxDevSound, DPLOCAL);
     DP_IN();
     
     iDevAudio->RequestGainAndBalance(this); // TODO handle error
@@ -429,7 +443,7 @@
 
 void CDevCommonControl::ContextEventStateDevSoundAdaptorStopping() // from CDevCommonControl
     {   
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorStopping, CtxDevSound, DPLOCAL);
     DP_IN();
     
     TInt err = Unload();
@@ -447,7 +461,7 @@
 
 void CDevCommonControl::ContextEventStateDevSoundAdaptorBeingPreempted() // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorBeingPreempted, CtxDevSound, DPLOCAL);
     DP_IN();
     
     __ASSERT_DEBUG(iDevAudio->iActiveStreamState == EInitialized, Panic(EStreamBeingDemotedToEIdle));
@@ -468,7 +482,7 @@
 
 void CDevCommonControl::ContextEventStateDevSoundAdaptorUninitializing() // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorUninitializing, CtxDevSound, DPLOCAL);
     DP_IN();
     TInt err = RemoveProcessingUnits();
 
@@ -487,7 +501,7 @@
 
 void CDevCommonControl::ContextEventErrorStateDevSoundAdaptorActivating(TInt aError) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventErrorStateDevSoundAdaptorActivating, CtxDevSound, DPLOCAL);
     DP_IN();
 
     // If the resume operation fails as result of EmptyBuffers
@@ -515,7 +529,7 @@
 
 void CDevCommonControl::ContextEventErrorStateDevSoundAdaptorBeingPreempted() // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventErrorStateDevSoundAdaptorBeingPreempted, CtxDevSound, DPLOCAL);
     DP_IN();
     
 __ASSERT_DEBUG(iDevAudio->iActiveStreamState == EInitialized, Panic(EStreamBeingDemotedToEIdle));
@@ -532,12 +546,20 @@
 
 void CDevCommonControl::ContextEventUpdateWithoutStateEventNoError() // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
-    DP_IN();
+    DP_CONTEXT(CDevCommonControl::ContextEventUpdateWithoutStateEventNoError, CtxDevSound, DPLOCAL);
+    DP2_IN("iActiveState=%d iIgnoreAsyncOpComplete=%d",iDevAudio->iActiveState, iIgnoreAsyncOpComplete);
     
     if (iDevAudio->iActiveState != EDevSoundAdaptorRemovingProcessingUnits)
         {
-        iAdaptationObserver->AsynchronousOperationComplete(KErrNone, ETrue);
+	    if (iIgnoreAsyncOpComplete)
+	      {
+	      iAdaptationObserver->PreemptionFinishedCallbackReceived(ETrue);
+	      iIgnoreAsyncOpComplete = EFalse;
+	      }
+	    else
+	      {
+	      iAdaptationObserver->AsynchronousOperationComplete(KErrNone, ETrue);
+	      }
         DP_OUT();
         return;
         }
@@ -568,11 +590,9 @@
 
 void CDevCommonControl::ContextEventUpdateWithoutStateEventButWithError(TInt aError) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventUpdateWithoutStateEventButWithError, CtxDevSound, DPLOCAL);
     DP_IN();
     
-	// NOTE: If no state change then do NOT complete the event.
-	
     // NOTE: We shouldn't actually be in any of the states below when calling this function.
     //       But just in case we are we will rewind the state before dealing with the error. 
     switch (iDevAudio->iActiveState)
@@ -602,7 +622,7 @@
 
 void CDevCommonControl::ContextEventUpdateWithStateEventNoError() // from CDevCommonControl 
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventUpdateWithStateEventNoError, CtxDevSound, DPLOCAL);
     DP_IN();
 
     switch (iDevAudio->iActiveState)
@@ -657,10 +677,10 @@
 
 void CDevCommonControl::ContextEventUpdateWithStateEventAndError(TInt aError) // from CDevCommonControl
     {
-    DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
+    DP_CONTEXT(CDevCommonControl::ContextEventUpdateWithStateEventAndError, CtxDevSound, DPLOCAL);
     DP_IN();
 
-    DP1(DLERR,"ContextEvent error=%d", aError);
+    DP1(DLERR,"ContextEventUpdateWithStateEventAndError error=%d", aError);
     
     switch(iDevAudio->iActiveState)
         {
--- a/devsound/a3fdevsound/src/devsoundadaptor/cdevrecordcontrol.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fdevsound/src/devsoundadaptor/cdevrecordcontrol.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -335,9 +335,6 @@
 // ---------------------------------------------------------------------------
 TBool CDevRecordControl::ProcessingError(TBool& aAyncOperation)
     {
-
-    iAdaptationObserver->RecordError(iProcessingUnitError);
-
     TInt err = iDevAudio->iAudioStream->Stop();
     if ( err == KErrNone)
         {
--- a/devsound/a3fdevsound/src/devsoundadaptor/mmfdevsoundadaptation.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fdevsound/src/devsoundadaptor/mmfdevsoundadaptation.h	Fri Apr 16 16:34:49 2010 +0300
@@ -223,7 +223,11 @@
 	*/
 	virtual void PreemptionFinishedCallbackReceived(TBool aCanStartNewOperation) = 0;
 
-	
+	/*
+	 * The adaptor has control of the context.
+	 * @return returns True if the adaptor is the entity responsible for calling Commit()
+	 */
+	virtual TBool AdaptorControlsContext() const = 0;
 
 	};
 
--- a/devsound/a3fdevsound/src/mmfdevsoundproxy/mmfdevsoundproxy.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fdevsound/src/mmfdevsoundproxy/mmfdevsoundproxy.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -17,6 +17,17 @@
 
 // INCLUDE FILES
 #include "mmfdevsoundproxy.h"
+#ifdef _DEBUG
+#include <e32debug.h>
+
+#define SYMBIAN_DEBPRN0(str)                RDebug::Print(str, this)
+#define SYMBIAN_DEBPRN1(str, val1)          RDebug::Print(str, this, val1)
+#define SYMBIAN_DEBPRN2(str, val1, val2)    RDebug::Print(str, this, val1, val2)
+#else
+#define SYMBIAN_DEBPRN0(str)
+#define SYMBIAN_DEBPRN1(str, val1)
+#define SYMBIAN_DEBPRN2(str, val1, val2)
+#endif //_DEBUG
 
 // SYMBIAN_CHECK used to add extra asserts when MACRO is added - helps debugging overall A3F
 
@@ -80,6 +91,7 @@
 //
 EXPORT_C void RMMFDevSoundProxy::Close()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Close - Enter"));
 	if (iAudioServerProxy)
 		{
 		if (iAudioServerProxy->Handle() != NULL)
@@ -103,6 +115,7 @@
 		iMsgQueueHandler = NULL;
 		}
 	iMsgQueue.Close();
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Close - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -113,6 +126,7 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::Open()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Open - Enter"));
 	TInt err = iMsgQueue.CreateGlobal(KNullDesC, KMaxMessageQueueItems);
 	// global, accessible to all that have its handle
 	
@@ -139,6 +153,7 @@
 		{	
 		Close();
 		}
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::Open - Exit [%d]"), err);
 	return err;
 	}
 
@@ -149,7 +164,10 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::PostOpen()
 	{
-	return SendReceive(EMMFDevSoundProxyPostOpen, iDestinationPckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PostOpen - Enter"));
+	TInt err = SendReceive(EMMFDevSoundProxyPostOpen, iDestinationPckg);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::PostOpen - Exit [%d]"), err);
+	return err;
 	}
 
 
@@ -161,7 +179,10 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::SetDevSoundInfo()
 	{
-	return SendReceive(EMMFAudioLaunchRequests);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetDevSoundInfo - Enter"));
+	TInt err = SendReceive(EMMFAudioLaunchRequests);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::SetDevSoundInfo - Exit [%d]"), err);
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -175,6 +196,7 @@
 							TMMFState aMode,
 							MMMFDevSoundCustomInterfaceObserver& aDevSoundCIObserver)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::InitializeL - Enter"));
 	TInt err = KErrNone;
 	iDevSoundObserver = &aDevSoundObserver;
 	
@@ -195,7 +217,7 @@
 			iState = EInitializing;
 			}	
 		}
-	
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::InitializeL - Exit [%d]"), err);
 	User::LeaveIfError(err);
 	}
 
@@ -227,6 +249,7 @@
 								TMMFState aMode,
 								MMMFDevSoundCustomInterfaceObserver& aDevSoundCIObserver)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::InitializeL - Enter"));
 	TInt err = KErrNone;
 	if(aMode == EMMFStateTonePlaying)
 		{
@@ -251,7 +274,7 @@
 			iState = EInitializing;
 			}	
 		}
-
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::InitializeL - Exit [%d]"), err);
 	User::LeaveIfError(err);
 	}
 
@@ -263,13 +286,15 @@
 //
 EXPORT_C TMMFCapabilities RMMFDevSoundProxy::Capabilities()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Capabilities - Enter"));
 	// TODO should we use the following ? SYMBIAN_CHECK(iState>=EInitialized, Panic(EMMFDevSoundProxyCapabilitiesInWrongState));
 	if (iState < EInitialized)
 		{
 		// call has been made before we are initialized. Not much we can do, so return
 		// dummy values but hit debugger on the emulator
 		__DEBUGGER()
-		RDebug::Print(_L("BRDBG:CapabilitiesCalledWhenNotInitialised")); // TODO Remove or redo as trace				
+		RDebug::Print(_L("BRDBG:CapabilitiesCalledWhenNotInitialised")); // TODO Remove or redo as trace
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Capabilities - Exit"));
 		return KZeroCapabilities;
 		}
 	TMMFDevSoundProxySettings set;
@@ -280,10 +305,12 @@
 					pckg);
 	if (err == KErrNone)
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Capabilities - Exit"));
 		return pckg().iCaps;
 		}
 	else
 		{
+		SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::Capabilities - Exit [%d]"), err);
 		return KZeroCapabilities;
 		}
 	}
@@ -296,13 +323,15 @@
 //
 EXPORT_C TMMFCapabilities RMMFDevSoundProxy::Config()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Config - Enter"));
 	// TODO should we use the following ? SYMBIAN_CHECK(iState>=EInitialized, Panic(EMMFDevSoundProxyConfigInWrongState));
 	if (iState < EInitialized)
 		{
 		// call has been made before we are initialized. Not much we can do, so return
 		// dummy values but hit debugger on the emulator
 		__DEBUGGER()
-		RDebug::Print(_L("BRDBG:ConfigCalledWhenNotInitialised")); // TODO Remove or redo as trace				
+		RDebug::Print(_L("BRDBG:ConfigCalledWhenNotInitialised")); // TODO Remove or redo as trace
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Config - Exit"));
 		return KZeroCapabilities;
 		}
 	TMMFDevSoundProxySettings set;
@@ -311,6 +340,7 @@
 					iDestinationPckg,
 					KNullDesC8,
 					pckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Config - Exit"));
 	return pckg().iConfig;
 	}
 
@@ -323,6 +353,7 @@
 EXPORT_C void RMMFDevSoundProxy::SetConfigL(
 	const TMMFCapabilities& aConfig )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetConfigL - Enter"));
 	TInt err = KErrNone;
 	
 	if (iState==EInitialized)
@@ -330,17 +361,16 @@
 		TMMFDevSoundProxySettings set;
 		set.iConfig = aConfig;
 		TMMFDevSoundProxySettingsPckg pckg(set);
-		TInt err = SendReceive(EMMFDevSoundProxySetConfig,
+		err = SendReceive(EMMFDevSoundProxySetConfig,
 							iDestinationPckg,
 							pckg);
-		User::LeaveIfError(err);
 		}
 	else
 		{
 		RDebug::Print(_L("BRDBG:SetConfigCalledWhenNotInitialised")); // TODO Remove or redo as trace				
 		err = KErrNotReady;
 		}
-
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::SetConfigL - Exit [%d]"), err);
 	User::LeaveIfError(err);
 	}
 
@@ -352,12 +382,14 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::MaxVolume()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::MaxVolume - Enter"));
 	TMMFDevSoundProxySettings set;
 	TMMFDevSoundProxySettingsPckg pckg(set);
 	SendReceiveResult(EMMFDevSoundProxyMaxVolume,
 					iDestinationPckg,
 					KNullDesC8,
 					pckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::MaxVolume - Exit"));
 	return pckg().iMaxVolume;
 	}
 
@@ -369,12 +401,14 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::Volume()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Volume - Enter"));
 	TMMFDevSoundProxySettings set;
 	TMMFDevSoundProxySettingsPckg pckg(set);
 	SendReceiveResult(EMMFDevSoundProxyVolume,
 					iDestinationPckg,
 					KNullDesC8,
 					pckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Volume - Exit"));
 	return pckg().iVolume;
 	}
 
@@ -386,12 +420,15 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::SetVolume(TInt aVolume )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetVolume - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iVolume = aVolume;
 	TMMFDevSoundProxySettingsPckg pckg(set);
-	return SendReceive(EMMFDevSoundProxySetVolume,
+	TInt err = SendReceive(EMMFDevSoundProxySetVolume,
 					iDestinationPckg,
 					pckg);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::SetVolume - Exit [%d]"), err);
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -402,12 +439,14 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::MaxGain()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::MaxGain - Enter"));
 	TMMFDevSoundProxySettings set;
 	TMMFDevSoundProxySettingsPckg pckg(set);
 	SendReceiveResult(EMMFDevSoundProxyMaxGain,
 					iDestinationPckg,
 					KNullDesC8,
 					pckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::MaxGain - Exit"));
 	return pckg().iMaxGain;
 	}
 
@@ -419,12 +458,14 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::Gain()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Gain - Enter"));
 	TMMFDevSoundProxySettings set;
 	TMMFDevSoundProxySettingsPckg pckg(set);
 	SendReceiveResult(EMMFDevSoundProxyGain,
 				iDestinationPckg,
 				KNullDesC8,
 				pckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Gain - Exit"));
 	return pckg().iGain;
 	}
 
@@ -437,12 +478,16 @@
 EXPORT_C TInt RMMFDevSoundProxy::SetGain(
 	TInt aGain )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetGain - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iGain = aGain;
 	TMMFDevSoundProxySettingsPckg pckg(set);
-	return SendReceive(EMMFDevSoundProxySetGain,
+
+	TInt err = SendReceive(EMMFDevSoundProxySetGain,
 					iDestinationPckg,
 					pckg);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::SetGain - Exit [%d]"), err);
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -455,6 +500,7 @@
 		TInt& aLeftPercentage,
 		TInt& aRightPercentage )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetPlayBalanceL - Enter"));
 	TMMFDevSoundProxySettings set;
 	TMMFDevSoundProxySettingsPckg pckg(set);
 	User::LeaveIfError(SendReceiveResult(EMMFDevSoundProxyPlayBalance,
@@ -463,6 +509,7 @@
 									pckg));
 	aLeftPercentage = pckg().iLeftPercentage;
 	aRightPercentage = pckg().iRightPercentage;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetPlayBalanceL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -475,6 +522,7 @@
 					TInt aLeftPercentage,
 					TInt aRightPercentage )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetPlayBalanceL - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iLeftPercentage = aLeftPercentage;
 	set.iRightPercentage = aRightPercentage;
@@ -482,6 +530,7 @@
 	User::LeaveIfError(SendReceive(EMMFDevSoundProxySetPlayBalance,
 								iDestinationPckg,
 								pckg));
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetPlayBalanceL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -494,6 +543,7 @@
 					TInt& aLeftPercentage,
 					TInt& aRightPercentage )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetRecordBalanceL - Enter"));
 	TMMFDevSoundProxySettings set;
 	TMMFDevSoundProxySettingsPckg pckg(set);
 	User::LeaveIfError(SendReceiveResult(EMMFDevSoundProxyRecordBalance,
@@ -502,6 +552,7 @@
 										pckg));
 	aLeftPercentage = pckg().iLeftPercentage;
 	aRightPercentage = pckg().iRightPercentage;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetRecordBalanceL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -514,6 +565,7 @@
 				TInt aLeftPercentage,
 				TInt aRightPercentage )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetRecordBalanceL - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iLeftPercentage = aLeftPercentage;
 	set.iRightPercentage = aRightPercentage;
@@ -521,6 +573,7 @@
 	User::LeaveIfError(SendReceive(EMMFDevSoundProxySetRecordBalance,
 									iDestinationPckg,
 									pckg));
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetRecordBalanceL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -531,12 +584,14 @@
 //
 EXPORT_C void RMMFDevSoundProxy::PlayInitL()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayInitL - Enter"));
 	if (!iDevSoundObserver || iState!=EInitialized)
 		{
 		if (iState == EPlaying || iState == EPlayingBufferWait)
 		    {
 		    // treat PlayInitL() during play as Resume()
 		    User::LeaveIfError(Resume());
+		    SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayInitL - Exit"));
 		    return;
 		    }
 		User::Leave(KErrNotReady);
@@ -545,6 +600,7 @@
 	User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayInit,
 							iDestinationPckg));
 	iState = EPlaying;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayInitL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -555,6 +611,7 @@
 //
 EXPORT_C void RMMFDevSoundProxy::RecordInitL()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordInitL - Enter"));
 	if (!iDevSoundObserver || iState!=EInitialized)
 		{
 		if(iState == ERecording || iState == ERecordingBufferWait || iState == ERecordingInLastBufferCycle 
@@ -562,6 +619,7 @@
 		    { 
 		    // treat RecordInitL() during record as Resume()
             User::LeaveIfError(Resume());
+            SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordInitL - Exit"));
             return;
 		    }
         User::Leave(KErrNotReady);
@@ -570,6 +628,7 @@
 	User::LeaveIfError(SendReceive(EMMFDevSoundProxyRecordInit,
 								iDestinationPckg));
 	iState = ERecording;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordInitL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -580,6 +639,7 @@
 //
 EXPORT_C void RMMFDevSoundProxy::PlayData()
 	{
+	//SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayData - Enter")); //Uncommenting this will produce a lot of logging!
 	__ASSERT_ALWAYS(iState == EPlaying || iState == EPlayingBufferWait,
 				Panic(EMMFDevSoundProxyPlayDataWithoutInitialize));
 	ASSERT(iDevSoundObserver);
@@ -592,6 +652,7 @@
 
 	SendReceive(EMMFDevSoundProxyPlayData, iDestinationPckg, pckg);
 	iState = EPlaying;
+	//SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayData - Exit")); //Uncommenting this will produce a lot of logging!
 	}
 
 // -----------------------------------------------------------------------------
@@ -602,6 +663,7 @@
 //
 EXPORT_C void RMMFDevSoundProxy::RecordData()
 	{
+	//SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordData - Enter")); //Uncommenting this will produce a lot of logging!
 	__ASSERT_ALWAYS(iState == ERecording || iState == ERecordingBufferWait ||
                     iState == ERecordingInLastBufferCycle || iState == ERecordingResumingInLastBufferCycle,
 					Panic(EMMFDevSoundProxyRecordDataWithoutInitialize));
@@ -626,6 +688,7 @@
 	        iState = ERecording;
 	        break;
 	    }
+	//SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordData - Exit")); //Uncommenting this will produce a lot of logging!
 	}
 
 // -----------------------------------------------------------------------------
@@ -635,13 +698,15 @@
 // -----------------------------------------------------------------------------
 //
 EXPORT_C void RMMFDevSoundProxy::Stop()
-	{	
+	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Stop - Enter"));
 	if (iState > EInitialized)
 		{
 		SendReceive(EMMFDevSoundProxyStop, iDestinationPckg);
 		iState = EInitialized;	
 		iMsgQueueHandler->Finish(); // will delete the buffer
 		}
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Stop - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -652,10 +717,12 @@
 //
 EXPORT_C void RMMFDevSoundProxy::Pause()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Pause - Enter"));
 	if(iState > EInitialized)
 	    {
 	    SendReceive(EMMFDevSoundProxyPause, iDestinationPckg);
 	    }
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Pause - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -668,8 +735,10 @@
 								TInt aFrequency,
 								const TTimeIntervalMicroSeconds& aDuration)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayToneL - Enter"));
 	if(iState==ETonePlaying)
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayToneL - Exit"));
 		return;
 		}
 	
@@ -687,6 +756,7 @@
 								pckg));
 	iState = ETonePlaying;
 	iToneMode = ESimple;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayToneL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -700,8 +770,10 @@
 									TInt aFrequencyTwo,
 									const TTimeIntervalMicroSeconds& aDuration)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDualToneL - Enter"));
 	if(iState==ETonePlaying)
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDualToneL - Exit"));
 		return;
 		}
 			
@@ -718,6 +790,7 @@
 	User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayDualTone, iDestinationPckg, pckg));
 	iState = ETonePlaying;
 	iToneMode = EDual;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDualToneL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -728,8 +801,10 @@
 //
 EXPORT_C void RMMFDevSoundProxy::PlayDTMFStringL(const TDesC& aDTMFString)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDTMFStringL - Enter"));
 	if(iState==ETonePlaying)
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDTMFStringL - Exit"));
 		return;
 		}
 			
@@ -749,6 +824,7 @@
 						tempPtr));
 	iState = ETonePlaying;
 	iToneMode = EDTMFString;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDTMFStringL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -759,8 +835,10 @@
 //
 EXPORT_C void RMMFDevSoundProxy::PlayToneSequenceL(const TDesC8& aData )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayToneSequenceL - Enter"));
 	if(iState==ETonePlaying)
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayToneSequenceL - Exit"));
 		return;
 		}
 			
@@ -774,6 +852,7 @@
 								aData));
 	iState = ETonePlaying;
 	iToneMode = ESequence;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayToneSequenceL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -784,8 +863,10 @@
 //
 EXPORT_C void RMMFDevSoundProxy::PlayFixedSequenceL(TInt aSequenceNumber)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayFixedSequenceL - Enter"));
 	if(iState==ETonePlaying)
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayFixedSequenceL - Exit"));
 		return;
 		}
 			
@@ -798,6 +879,7 @@
 	User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayFixedSequence, iDestinationPckg, seqNum));
 	iState = ETonePlaying;
 	iToneMode = EFixedSequence;
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayFixedSequenceL - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -811,12 +893,14 @@
 									TTimeIntervalMicroSeconds32& aToneOffLength,
 									TTimeIntervalMicroSeconds32& aPauseLength )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetDTMFLengths - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iToneOnLength = aToneOnLength;
 	set.iToneOffLength = aToneOffLength;
 	set.iPauseLength = aPauseLength;
 	TMMFDevSoundProxySettingsPckg pckg(set);
 	SendReceive(EMMFDevSoundProxySetDTMFLengths, iDestinationPckg, pckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetDTMFLengths - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -828,10 +912,12 @@
 EXPORT_C void RMMFDevSoundProxy::SetVolumeRamp(
 								const TTimeIntervalMicroSeconds& aRampDuration)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetVolumeRamp - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iDuration = aRampDuration;
 	TMMFDevSoundProxySettingsPckg pckg(set);
 	SendReceive(EMMFDevSoundProxySetVolumeRamp, iDestinationPckg, pckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetVolumeRamp - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -844,6 +930,7 @@
 								RArray<TFourCC>& aSupportedDataTypes,
 								const TMMFPrioritySettings& aPrioritySettings)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetSupportedInputDataTypesL - Enter"));
 	aSupportedDataTypes.Reset();
 
 	TMMFPrioritySettings prioritySet = aPrioritySettings;
@@ -856,6 +943,7 @@
 							pckg,
 							numberOfElementsPckg));
 							
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetSupportedInputDataTypesL - Exit 1"));
 
 	HBufC8* buf = HBufC8::NewLC(numberOfElementsPckg()*sizeof(TFourCC));
 	TPtr8 ptr = buf->Des();
@@ -883,6 +971,7 @@
 		}
 	CleanupStack::PopAndDestroy(&stream);
 	CleanupStack::PopAndDestroy(buf);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetSupportedInputDataTypesL - Exit 2"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -895,6 +984,7 @@
 								RArray<TFourCC>& aSupportedDataTypes,
 								const TMMFPrioritySettings& aPrioritySettings)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetSupportedOutputDataTypesL - Enter"));
 	aSupportedDataTypes.Reset();
 
 	TMMFPrioritySettings prioritySet = aPrioritySettings;
@@ -907,6 +997,7 @@
 								pckg,
 								numberOfElementsPckg));
 								
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetSupportedOutputDataTypesL - Exit 1"));
 
 	HBufC8* buf = HBufC8::NewLC(numberOfElementsPckg()*sizeof(TFourCC));
 	TPtr8 ptr = buf->Des();
@@ -933,6 +1024,7 @@
 		}
 	CleanupStack::PopAndDestroy(&stream);
 	CleanupStack::PopAndDestroy(buf);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetSupportedOutputDataTypesL - Exit 2"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -943,12 +1035,13 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::SamplesRecorded()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SamplesRecorded - Enter"));
 	TPckgBuf<TInt> numSamples;
 	SendReceiveResult(EMMFDevSoundProxySamplesRecorded,
 					iDestinationPckg,
 					KNullDesC8,
 					numSamples);
-					
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SamplesRecorded - Exit"));
 	return numSamples();
 	}
 
@@ -960,11 +1053,13 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::SamplesPlayed()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SamplesPlayed - Enter"));
 	TPckgBuf<TInt> numSamples;
 	SendReceiveResult(EMMFDevSoundProxySamplesPlayed,
 					iDestinationPckg,
 					KNullDesC8,
 					numSamples);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SamplesPlayed - Exit"));
 	return numSamples();
 	}
 
@@ -979,12 +1074,14 @@
 								const TTimeIntervalMicroSeconds&
 									aRepeatTrailingSilence)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetToneRepeats - Enter"));
 	TPckgBuf<TInt> countRepeat(aRepeatCount);
 	TPckgBuf<TTimeIntervalMicroSeconds> repeatTS(aRepeatTrailingSilence);
 	SendReceive(EMMFDevSoundProxySetToneRepeats,
 				iDestinationPckg,
 				countRepeat,
 				repeatTS);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetToneRepeats - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -996,10 +1093,12 @@
 EXPORT_C void RMMFDevSoundProxy::SetPrioritySettings(
 								const TMMFPrioritySettings& aPrioritySettings)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetPrioritySettings - Enter"));
 	TPckgBuf<TMMFPrioritySettings> prioritySet(aPrioritySettings);
 	SendReceive(EMMFDevSoundProxySetPrioritySettings,
 				iDestinationPckg,
 				prioritySet);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetPrioritySettings - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -1010,7 +1109,9 @@
 //
 EXPORT_C const TDesC& RMMFDevSoundProxy::FixedSequenceName(TInt /*aSequenceNumber*/)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::FixedSequenceName - Enter"));
 	_LIT(KNullDesC, "");
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::FixedSequenceName - Exit"));
 	return KNullDesC;
 	}
 
@@ -1022,13 +1123,15 @@
 //
 EXPORT_C TAny* RMMFDevSoundProxy::CustomInterface(TUid aInterfaceId)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomInterface - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iInterface = aInterfaceId;
 	// Added for ask for custom interface
 	TAny* customInterface = NULL;
 	if (aInterfaceId == KMmfUidDevSoundCancelInitializeCustomInterface)
 		{
-		MMMFDevSoundCancelInitialize* result = this; 
+		MMMFDevSoundCancelInitialize* result = this;
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomInterface - Exit"));
 		return result;
 		}
 	TPckgBuf<TAny*> pckg2(customInterface);
@@ -1037,6 +1140,7 @@
 	SendReceiveResult(EMMFDevSoundProxyCustomInterface, 
 							iDestinationPckg, 
 							pckg, pckg2);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomInterface - Exit"));
 	return reinterpret_cast<TAny*> (customInterface);
 	}
 	
@@ -1048,13 +1152,14 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::FixedSequenceCount()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::FixedSequenceCount - Enter"));
 	TPckgBuf<TInt> fixSeqCountPckg;
 	SendReceiveResult(EMMFDevSoundProxyFixedSequenceCount,
 					iDestinationPckg,
 					KNullDesC8,
 					fixSeqCountPckg);
-					
-					
+
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::FixedSequenceCount - Exit"));
 	return fixSeqCountPckg();
 	}
 
@@ -1066,13 +1171,16 @@
 EXPORT_C TInt RMMFDevSoundProxy::BufferToBeFilledData(
 		TBool aRequestChunk, TMMFDevSoundProxyHwBufPckg& aSetPckg)
 	{
+	//SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::BufferToBeFilledData - Enter")); //Uncommenting this will produce a lot of logging!
 	// Note that there will only ever be one of these requests outstanding
 	// per session
 	TPckgBuf<TInt> requestChunkBuf (aRequestChunk);
-	return SendReceiveResult(EMMFDevSoundProxyBTBFData,
+	TInt err = SendReceiveResult(EMMFDevSoundProxyBTBFData,
 							iDestinationPckg,
 							requestChunkBuf,
 							aSetPckg);
+	//SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::BufferToBeFilledData - Exit [%d]"), err); //Uncommenting this will produce a lot of logging!
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -1083,12 +1191,15 @@
 EXPORT_C TInt RMMFDevSoundProxy::BufferToBeEmptiedData(
 							TMMFDevSoundProxyHwBufPckg& aSetPckg)
 	{
+	//SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::BufferToBeEmptiedData - Enter")); //Uncommenting this will produce a lot of logging!
 	// Note that there will only ever be one of these requests outstanding
 	// per session
-	return SendReceiveResult(EMMFDevSoundProxyBTBEData,
+	TInt err = SendReceiveResult(EMMFDevSoundProxyBTBEData,
 								iDestinationPckg,
 								KNullDesC8,
 								aSetPckg);
+	//SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::BufferToBeEmptiedData - Exit [%d]"), err); //Uncommenting this will produce a lot of logging!
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -1098,10 +1209,13 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RegisterAsClient - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iNotificationEventUid = aEventType;
 	TMMFDevSoundProxySettingsPckg pckg(set);
-	return SendReceive(EMMFDevSoundProxyRequestResourceNotification, iDestinationPckg, pckg, aNotificationRegistrationData);
+	TInt err = SendReceive(EMMFDevSoundProxyRequestResourceNotification, iDestinationPckg, pckg, aNotificationRegistrationData);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::RegisterAsClient - Exit [%d]"), err);
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -1111,10 +1225,13 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::CancelRegisterAsClient(TUid aEventType)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CancelRegisterAsClient - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iNotificationEventUid = aEventType;
 	TMMFDevSoundProxySettingsPckg pckg(set);
-	return SendReceiveResult(EMMFDevSoundProxyCancelRequestResourceNotification, iDestinationPckg, KNullDesC8, pckg);
+	TInt err = SendReceiveResult(EMMFDevSoundProxyCancelRequestResourceNotification, iDestinationPckg, KNullDesC8, pckg);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::CancelRegisterAsClient - Exit [%d]"), err);
+	return err;
 	}
 	
 // -----------------------------------------------------------------------------
@@ -1124,10 +1241,13 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::GetResourceNotificationData(TUid aEventType, TDes8& aNotificationData)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetResourceNotificationData - Enter"));
 	TMMFDevSoundProxySettings set;
 	set.iNotificationEventUid = aEventType;
 	TMMFDevSoundProxySettingsPckg pckg(set);
-	return SendReceiveResult(EMMFDevSoundProxyGetResourceNotificationData, iDestinationPckg, pckg, aNotificationData);
+	TInt err = SendReceiveResult(EMMFDevSoundProxyGetResourceNotificationData, iDestinationPckg, pckg, aNotificationData);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::GetResourceNotificationData - Exit [%d]"), err);
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -1139,7 +1259,10 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::WillResumePlay()
 	{
-	return SendReceive(EMMFDevSoundProxyWillResumePlay, iDestinationPckg);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::WillResumePlay - Enter"));
+	TInt err = SendReceive(EMMFDevSoundProxyWillResumePlay, iDestinationPckg);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::WillResumePlay - Exit [%d]"), err);
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -1151,6 +1274,7 @@
 
 EXPORT_C TInt RMMFDevSoundProxy::EmptyBuffers()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::EmptyBuffers - Enter"));
 	TInt error = SendReceive(EMMFDevSoundProxyEmptyBuffers, iDestinationPckg); 
 	
 	if(error==KErrNone)
@@ -1161,6 +1285,7 @@
 	        iState = EPlaying;
 	        }
 	    }
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::EmptyBuffers - Exit [%d]"), error);
 	return error;
 	}
 
@@ -1171,6 +1296,7 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::CancelInitialize()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CancelInitialize - Enter"));
 	TInt err=KErrNone;
 	
 	if (iState==EInitializing)
@@ -1182,7 +1308,7 @@
 		{
 		err = KErrNotReady;
 		}
-	
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::CancelInitialize - Exit [%d]"), err);
 	return err;
 	}
 
@@ -1194,8 +1320,11 @@
 //
 EXPORT_C TInt RMMFDevSoundProxy::SetClientThreadInfo(TThreadId& aTid)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetClientThreadInfo - Enter"));
 	TPckgBuf<TThreadId> threadId(aTid);
-	return SendReceive(EMMFDevSoundProxySetClientThreadInfo, iDestinationPckg, threadId);
+	TInt err = SendReceive(EMMFDevSoundProxySetClientThreadInfo, iDestinationPckg, threadId);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::SetClientThreadInfo - Exit [%d]"), err);
+	return err;
 	}
 
 
@@ -1211,11 +1340,14 @@
 							const TDesC8& aDataTo2,
 							TDes8& aDataFrom)
 	{
-	return SendReceiveResult(aFunction,
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomCommandSync - Enter"));
+	TInt err = SendReceiveResult(aFunction,
 							aDestination,
 							aDataTo1,
 							aDataTo2,
 							aDataFrom);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::CustomCommandSync - Exit [%d]"), err);
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -1229,7 +1361,10 @@
 							const TDesC8& aDataTo1,
 							const TDesC8& aDataTo2)
 	{
-	return SendReceive(aFunction, aDestination, aDataTo1, aDataTo2);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomCommandSync - Enter"));
+	TInt err =  SendReceive(aFunction, aDestination, aDataTo1, aDataTo2);
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::CustomCommandSync - Exit [%d]"), err);
+	return err;
 	}
 
 // -----------------------------------------------------------------------------
@@ -1245,12 +1380,14 @@
 								TDes8& aDataFrom,
 								TRequestStatus& aStatus )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomCommandAsync - Enter"));
 	SendReceiveResult(aFunction,
 					aDestination,
 					aDataTo1,
 					aDataTo2,
 					aDataFrom,
 					aStatus);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomCommandAsync - Exit"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -1265,40 +1402,52 @@
 								const TDesC8& aDataTo2,
 								TRequestStatus& aStatus )
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomCommandAsync - Enter"));
 	SendReceive(aFunction, aDestination, aDataTo1, aDataTo2, aStatus);
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomCommandAsync - Exit"));
 	}
 
 // implementation of a simple CustomCommand() scheme
 EXPORT_C TInt RMMFDevSoundProxy::SyncCustomCommand(TUid aUid, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SyncCustomCommand - Enter"));
 	TMMFMessageDestinationPckg dest(TMMFMessageDestination(aUid, KMMFObjectHandleDevSound));
 
+	TInt err = KErrNone;
 	if (aOutParam==NULL)
 		{
-		return SendReceive(EMMFDevSoundProxySyncCustomCommand, dest, aParam1, aParam2);
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SyncCustomCommand - Exit"));
+		err = SendReceive(EMMFDevSoundProxySyncCustomCommand, dest, aParam1, aParam2);
+		return err;
 		}
 	else
 		{
-		return SendReceiveResult(EMMFDevSoundProxySyncCustomCommandResult, dest, aParam1, aParam2, *aOutParam);		
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SyncCustomCommand - Exit"));
+		err = SendReceiveResult(EMMFDevSoundProxySyncCustomCommandResult, dest, aParam1, aParam2, *aOutParam);
+		return err;
 		}
 	}
 
 EXPORT_C void RMMFDevSoundProxy::AsyncCustomCommand(TUid aUid, TRequestStatus& aStatus, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::AsyncCustomCommand - Enter"));
 	TMMFMessageDestination dest(aUid, KMMFObjectHandleDevSound);
 	iCustIntPckg = dest;
 	if (aOutParam==NULL)
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::AsyncCustomCommand - Exit"));
 		SendReceive(EMMFDevSoundProxyAsyncCustomCommand, iCustIntPckg, aParam1, aParam2, aStatus);
 		}
 	else
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::AsyncCustomCommand - Exit"));
 		SendReceiveResult(EMMFDevSoundProxyAsyncCustomCommandResult, iCustIntPckg, aParam1, aParam2, *aOutParam, aStatus);		
 		}
 	}
 
 EXPORT_C TInt RMMFDevSoundProxy::GetTimePlayed(TTimeIntervalMicroSeconds& aTime)
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetTimePlayed - Enter"));
 	TTimeIntervalMicroSeconds time(0);
 	TPckgBuf<TTimeIntervalMicroSeconds> timePckg(time);
 	TInt err = SendReceiveResult(EMMFDevSoundProxyGetTimePlayed, iDestinationPckg, KNullDesC8, timePckg);
@@ -1306,11 +1455,13 @@
 		{
 		aTime = timePckg();
 		}
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::GetTimePlayed - Exit [%d]"), err);
 	return err;
 	}
 
 EXPORT_C TBool RMMFDevSoundProxy::IsResumeSupported()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::IsResumeSupported - Enter"));
 	TPckgBuf<TBool> isResumeSupported;
 	TInt err = SendReceiveResult(EMMFDevSoundProxyIsResumeSupported, 
 								iDestinationPckg, 
@@ -1318,16 +1469,19 @@
 								isResumeSupported);
 	if(err == KErrNone)
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::IsResumeSupported - Exit"));
 		return isResumeSupported();
 		}
 	else
 		{
+		SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::IsResumeSupported - Exit"));
 		return EFalse;
 		}
 	}
 
 EXPORT_C TInt RMMFDevSoundProxy::Resume()
 	{
+	SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Resume - Enter"));
 	TInt err = KErrNone;
 	if (!iDevSoundObserver ||  iState <= EInitialized  )
 		{
@@ -1335,6 +1489,7 @@
 		}
 	else if(iState == ETonePlaying && iToneMode != ESequence)
 		{
+		SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::Resume - Exit [%d]"), err);
 		return KErrNotSupported;
 		}
 	else
@@ -1347,12 +1502,17 @@
             // don't actually resume until then!
             iState = ERecordingResumingInLastBufferCycle;
             }
+	    else if (iState == ERecordingResumingInLastBufferCycle)
+	        {
+            //Do Nothing as you can't resume twice on last buffer 
+	        }
 	    else
 	        {
 	        err = SendReceive(EMMFDevSoundProxyResume,  
 	                    iDestinationPckg);	        
 	        }
 		}
+	SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::Resume - Exit [%d]"), err);
 	return err;
 	}
 
--- a/devsound/a3fdevsound/src/mmfdevsoundserver/mmfdevsoundsession.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fdevsound/src/mmfdevsoundserver/mmfdevsoundsession.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -227,7 +227,8 @@
 //
 void CMMFDevSoundSession::ServiceL(const RMmfIpcMessage& aMessage)
 	{
-	SYMBIAN_DEBPRN2(_L("\nCMMFDevSoundSession[0x%x] NEW REQUEST %02x while pending=%d"), aMessage.Function(), iOperationCompletePending);
+	SYMBIAN_DEBPRN2(_L("\nCMMFDevSoundSession[0x%x] NEW REQUEST %02x while pending=%d"),
+	        aMessage.Function(), iOperationCompletePending || iAsyncQueueStart->IsActive());
 	if( iOperationCompletePending || iAsyncQueueStart->IsActive())
 		{
 		// if not possible to service now, then queue request
@@ -236,7 +237,16 @@
 	else
 		{
 		// If there is no oustanding operation service inmediately
-		DoServiceRequestL(aMessage);
+		TRAPD(err, DoServiceRequestL(aMessage));
+		if (err)
+		    {
+            aMessage.Complete(err); // repeat normal ServiceL() behaviour since we may keep going
+		    }
+	    if (!iOperationCompletePending && iQueuedRequests.Count() != 0)
+	        {
+	        //dequeue next
+	        DequeueRequest();
+	        }
 		}
 	}
 	
@@ -444,12 +454,14 @@
 		if (iCIExtension)
 			{
 			iOperationCompletePending = ETrue;
+			iHandlingExtdCI = ETrue;
 			TRAPD(err2, err = iCIExtension->HandleMessageL(aMessage));
 			if (err2)
 				{
 				err = err2;
 				}
 			iOperationCompletePending = EFalse;
+			iHandlingExtdCI = EFalse;
 			}
 
 		if (err != KErrNone)
@@ -1699,6 +1711,11 @@
 //
 void CMMFDevSoundSession::PreemptionFinishedCallbackReceived(TBool aCanStartNewOperation)
 	{
+    if (iHandlingExtdCI)
+        {
+        // we are in the middle of handling a CI, so ignore - will handle later when unwinding
+        return;
+        }
 	iOperationCompletePending = EFalse;
 	if ( aCanStartNewOperation && iQueuedRequests.Count() != 0 )
 		{
@@ -1706,6 +1723,14 @@
 		}
 	}
 
+//
+// CMMFDevSoundSession::AdaptorControlsContext()
+//
+
+TBool CMMFDevSoundSession::AdaptorControlsContext() const
+    {
+    return !iHandlingExtdCI;
+    }
 
 MMMFDevSoundCustomInterfaceDeMuxPlugin* CMMFDevSoundSession::InterfaceFromUid(TUid aUid)
 	{
@@ -1740,6 +1765,9 @@
 
 void CMMFDevSoundSession::AsynchronousOperationComplete(TInt aError, TBool aCanStartNewOperation)
 	{
+    __ASSERT_DEBUG(!iHandlingExtdCI, Panic(EUnexpectedAsyncOpCompleteHandlingCI));
+        // when handling CIs we should not reach here
+
 	switch (iRequestBeingServiced.Type())
 		{
 		case TMMFDevSoundRequest::ESessionEvents:
@@ -1820,6 +1848,8 @@
 
 void CMMFDevSoundSession::DequeueRequest()
 	{
+    iAsyncQueueStart->Cancel(); // if we're in here cancel any background request
+
 	TMMFDevSoundRequest msg = iQueuedRequests[0];
 
 	if (msg.IsCallBack() > 0)
@@ -1839,7 +1869,8 @@
 		    }
 
 		}
-	else
+
+	if (iQueuedRequests.Count()>0)
 		{
 		// Some rules about what request can be followed
 		SYMBIAN_DEBPRN0(_L("\n CMMFDevSoundSession[0x%x]======== Flag can service new request\n"));
--- a/devsound/a3fdevsound/src/mmfdevsoundserver/mmfdevsoundsession.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fdevsound/src/mmfdevsoundserver/mmfdevsoundsession.h	Fri Apr 16 16:34:49 2010 +0300
@@ -47,7 +47,8 @@
 enum TMMFDevSoundSessionPanicCodes
 	{
 	EMsgQueueFailedToSendMsg =1,
-	EQueueRequestsFailedToAppend
+	EQueueRequestsFailedToAppend,
+	EUnexpectedAsyncOpCompleteHandlingCI
 	};
 
 // CLASS DECLARATION
@@ -1310,6 +1311,9 @@
 	 */
 	void PreemptionFinishedCallbackReceived(TBool aCanStartNewOperation);
 
+	// from MDevSoundAdaptationObserver
+	TBool AdaptorControlsContext() const;
+
 	/**
 		MDevSoundAdaptationObserver callback.
 		Indicates that a low layer operation completion
@@ -1486,6 +1490,7 @@
 	RArray<TMMFDevSoundRequest> iQueuedRequests;
 	TMMFDevSoundRequest			iRequestBeingServiced;
 	TBool						iOperationCompletePending;
+	TBool                       iHandlingExtdCI;
 	TBool						iPlayErrorOccured;
 	
 	//Check if the call of SetClientConfigL was alredy made
--- a/devsound/a3fsrvstart/group/multimedia_a3f_serverstart.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3fsrvstart/group/multimedia_a3f_serverstart.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_a3f_serverstart.mrp
 #
-#Copyright (c) Symbian Software Ltd 2008.  All rights reserved.
+# Copyright (c) 2008 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	multimedia_a3f_serverstart
--- a/devsound/a3ftrace/group/multimedia_a3f_traces.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsound/a3ftrace/group/multimedia_a3f_traces.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_a3f_traces.mrp
 #
-#Copyright (c) Symbian Software Ltd 2007.  All rights reserved.
+# Copyright (c) 2007 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	multimedia_a3f_traces
--- a/devsoundextensions/audiorouting/Output/AudioOutputProxy/src/AudioOutputProxy.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsoundextensions/audiorouting/Output/AudioOutputProxy/src/AudioOutputProxy.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -43,6 +43,7 @@
     iOutput        = ENoPreference;
     iDefaultOutput = ENoPreference;
     iSecureOutput  = EFalse;
+    iRegistered = EFalse;
     }
 
 // Two-phased constructor.
@@ -140,14 +141,22 @@
 //
 void CAudioOutputProxy::RegisterObserverL(MAudioOutputObserver& aObserver)
 	{
-	iRegistered = ETrue;
-	iObserver = &aObserver;
-	delete iAsyncSender;
-	iAsyncSender = NULL;
+	if(iRegistered)
+		{
+	       iObserver = &aObserver;
+	       iAsyncSender->SetObserver(aObserver);
+	       }
+	else
+		{
+		iRegistered = ETrue;
+		iObserver = &aObserver;
+		delete iAsyncSender;
+		iAsyncSender = NULL;
 
-	iAsyncSender = CAudioOutputProxyAO::NewL(this,aObserver,iCustomCommand);
-	iAsyncSender->SetRegisterFlag(ETrue);
-	iAsyncSender->SendAsyncMessage(iMessageHandler,EAofRegisterObserver);
+		iAsyncSender = CAudioOutputProxyAO::NewL(this,aObserver,iCustomCommand);
+		iAsyncSender->SetRegisterFlag(ETrue);
+		iAsyncSender->SendAsyncMessage(iMessageHandler,EAofRegisterObserver);
+		}
 	}
 
 // ---------------------------------------------------------
--- a/devsoundextensions/audiorouting/Output/AudioOutputProxy/src/AudioOutputProxyAO.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsoundextensions/audiorouting/Output/AudioOutputProxy/src/AudioOutputProxyAO.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -17,6 +17,7 @@
 
 
 #include "AudioOutput.h"
+#include "AudioOutputMessageTypes.h"
 #include <e32svr.h>
 #include "AudioOutputProxyAO.h"
 #include <CustomCommandUtility.h>
@@ -46,7 +47,7 @@
 	CActive(CActive::EPriorityStandard),
 		iAudioOutputProxy(aOutputProxy),
 		iCustomCommandUtility(aUtility),
-		iObserver(aObserver)
+		iObserver(&aObserver)
 	{
 	}
 
@@ -70,7 +71,7 @@
 		{
 		iCustomCommandUtility->CustomCommandAsync( *iDestination,iFunction,KNullDesC8,KNullDesC8,iCallbackData,iStatus );
 		SetActive();
-		iObserver.DefaultAudioOutputChanged(*iAudioOutputProxy,iCallbackData());
+		iObserver->DefaultAudioOutputChanged(*iAudioOutputProxy,iCallbackData());
 		}
 	}
 
@@ -82,6 +83,10 @@
 //
 void CAudioOutputProxyAO::DoCancel()
 	{
+       if ( iRegistered != EFalse )
+       	{
+       	iCustomCommandUtility->CustomCommandSync( *iDestination, EAofUnregisterObserver, KNullDesC8, KNullDesC8);
+       	}
 	}
 
 // ---------------------------------------------------------
@@ -110,3 +115,13 @@
 	{
 	iRegistered = aFlag;
 	}
+// ---------------------------------------------------------
+// CAudioOutputProxyAO::SetObserver
+// ?implementation_description
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CAudioOutputProxyAO::SetObserver(MAudioOutputObserver& aObserver)
+    {
+    iObserver = &aObserver;
+    }
--- a/devsoundextensions/ciextnfactoryplugins/ciextnclientplugin/src/ciextnclientplugin.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsoundextensions/ciextnfactoryplugins/ciextnclientplugin/src/ciextnclientplugin.h	Fri Apr 16 16:34:49 2010 +0300
@@ -23,7 +23,7 @@
 
 // Include files
 #include <e32base.h>
-#include <a3f/MmfDevSoundCustomInterfaceExtensions.h>
+#include <a3f/mmfdevsoundcustominterfaceextensions.h>
 
 // Forward declarations
 class MCIFactoryIntfc;
--- a/devsoundextensions/ciextnfactoryplugins/ciextnserverplugin/src/ciextnserverplugin.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsoundextensions/ciextnfactoryplugins/ciextnserverplugin/src/ciextnserverplugin.h	Fri Apr 16 16:34:49 2010 +0300
@@ -23,7 +23,7 @@
 
 // Include files
 #include <e32base.h>
-#include <a3f/MmfDevSoundCustomInterfaceExtensions.h>
+#include <a3f/mmfdevsoundcustominterfaceextensions.h>
 #include "ciextnserverpluginwrapper.h"
 
 // Forward declarations
--- a/devsoundextensions/effectspresets/Group/bld.inf	Tue Feb 02 01:56:55 2010 +0200
+++ b/devsoundextensions/effectspresets/Group/bld.inf	Fri Apr 16 16:34:49 2010 +0300
@@ -30,5 +30,5 @@
 PRJ_MMPFILES
 ../AudioEqualizerUtility/group/AudioEqualizerUtility.mmp
 ../EnvironmentalReverbUtility/group/EnvironmentalReverbUtility.mmp
-../StereoWideningUtility/group/StereoWideningUtility.mmp
+#include "../StereoWideningUtility/group/bld.inf"
 
--- a/imagingandcamerafws/camerafw/group/multimedia_ecam_framework.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/imagingandcamerafws/camerafw/group/multimedia_ecam_framework.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_ecam_framework.mrp
 #
-#Copyright (c) Symbian Software Ltd 2007.  All rights reserved.
+# Copyright (c) 2007 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	multimedia_ecam_framework
--- a/imagingandcamerafws/imagingfws/Documentation/ICL Current status.rtf	Tue Feb 02 01:56:55 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f16\froman\fcharset238\fprq2 Times New Roman CE;}{\f17\froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f19\froman\fcharset161\fprq2 Times New Roman Greek;}{\f20\froman\fcharset162\fprq2 Times New Roman Tur;}{\f21\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f22\fswiss\fcharset238\fprq2 Arial CE;}{\f23\fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f25\fswiss\fcharset161\fprq2 Arial Greek;}{\f26\fswiss\fcharset162\fprq2 Arial Tur;}{\f27\fswiss\fcharset186\fprq2 Arial Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;
-\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
-{\stylesheet{\widctlpar\adjustright \fs20\cgrid \snext0 Normal;}{\s1\sb240\sa60\keepn\widctlpar\ls5\outlinelevel0\adjustright \b\f1\fs28\kerning28\cgrid \sbasedon0 \snext0 heading 1;}{\s2\sb240\sa60\keepn\widctlpar\ls5\ilvl1\outlinelevel1\adjustright 
-\b\i\f1\cgrid \sbasedon0 \snext0 heading 2;}{\s3\sb240\sa60\keepn\widctlpar\ls5\ilvl2\outlinelevel2\adjustright \f1\cgrid \sbasedon0 \snext0 heading 3;}{\s4\keepn\widctlpar\ls5\ilvl3\outlinelevel3\adjustright \b\f1\fs20\cgrid \sbasedon0 \snext0 
-heading 4;}{\s5\sb240\sa60\widctlpar\ls5\ilvl4\outlinelevel4\adjustright \fs22\cgrid \sbasedon0 \snext0 heading 5;}{\s6\sb240\sa60\widctlpar\ls5\ilvl5\outlinelevel5\adjustright \i\fs22\cgrid \sbasedon0 \snext0 heading 6;}{
-\s7\sb240\sa60\widctlpar\ls5\ilvl6\outlinelevel6\adjustright \f1\fs20\cgrid \sbasedon0 \snext0 heading 7;}{\s8\sb240\sa60\widctlpar\ls5\ilvl7\outlinelevel7\adjustright \i\f1\fs20\cgrid \sbasedon0 \snext0 heading 8;}{
-\s9\sb240\sa60\widctlpar\ls5\ilvl8\outlinelevel8\adjustright \b\i\f1\fs18\cgrid \sbasedon0 \snext0 heading 9;}{\*\cs10 \additive Default Paragraph Font;}{\s15\fi-360\li360\widctlpar\adjustright \fs20\cgrid \sbasedon0 \snext15 List;}{
-\s16\sa120\widctlpar\adjustright \fs20\cgrid \sbasedon0 \snext16 Body Text;}{\s17\li1080\widctlpar\adjustright \f1\fs20\cgrid \sbasedon0 \snext17 Body Text 2;}}{\*\listtable{\list\listtemplateid134807583{\listlevel\levelnfc0\leveljc0\levelfollow0
-\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'04\'00.\'01.;}{\levelnumbers\'01\'03;}
-\fi-432\li792\jclisttab\tx792 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'06\'00.\'01.\'02.;}{\levelnumbers\'01\'03\'05;}\fi-504\li1224\jclisttab\tx1224 }{\listlevel\levelnfc0\leveljc0\levelfollow0
-\levelstartat1\levelspace0\levelindent0{\leveltext\'08\'00.\'01.\'02.\'03.;}{\levelnumbers\'01\'03\'05\'07;}\fi-648\li1728\jclisttab\tx1800 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
-\'0a\'00.\'01.\'02.\'03.\'04.;}{\levelnumbers\'01\'03\'05\'07\'09;}\fi-792\li2232\jclisttab\tx2520 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0c\'00.\'01.\'02.\'03.\'04.\'05.;}{\levelnumbers
-\'01\'03\'05\'07\'09\'0b;}\fi-936\li2736\jclisttab\tx2880 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0e\'00.\'01.\'02.\'03.\'04.\'05.\'06.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d;}\fi-1080\li3240
-\jclisttab\tx3600 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'10\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\fi-1224\li3744\jclisttab\tx3960 }{\listlevel
-\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'12\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\fi-1440\li4320\jclisttab\tx4680 }{\listname ;}\listid139159324}
-{\list\listtemplateid-1236132874\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat8\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid377122024}
-{\list\listtemplateid134807593{\listlevel\levelnfc0\leveljc0\levelfollow1\levelstartat1\levelspace0\levelindent0{\leveltext\'09Chapter \'00;}{\levelnumbers\'09;}\s1}{\listlevel\levelnfc255\leveljc0\levelfollow2\levelstartat1\levelspace0\levelindent0
-{\leveltext\'00;}{\levelnumbers;}\s2}{\listlevel\levelnfc255\leveljc0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext\'00;}{\levelnumbers;}\s3}{\listlevel\levelnfc255\leveljc0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext
-\'00;}{\levelnumbers;}\s4}{\listlevel\levelnfc255\leveljc0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext\'00;}{\levelnumbers;}\s5}{\listlevel\levelnfc255\leveljc0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext
-\'00;}{\levelnumbers;}\s6}{\listlevel\levelnfc255\leveljc0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext\'00;}{\levelnumbers;}\s7}{\listlevel\levelnfc255\leveljc0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext
-\'00;}{\levelnumbers;}\s8}{\listlevel\levelnfc255\leveljc0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext\'00;}{\levelnumbers;}\s9}{\listname ;}\listid541869296}{\list\listtemplateid134807567\listsimple{\listlevel\levelnfc0\leveljc0
-\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid562713402}{\list\listtemplateid134807583{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0
-\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'04\'00.\'01.;}{\levelnumbers\'01\'03;}\fi-432\li792\jclisttab\tx792 }
-{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'06\'00.\'01.\'02.;}{\levelnumbers\'01\'03\'05;}\fi-504\li1224\jclisttab\tx1224 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0
-\levelindent0{\leveltext\'08\'00.\'01.\'02.\'03.;}{\levelnumbers\'01\'03\'05\'07;}\fi-648\li1728\jclisttab\tx1800 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0a\'00.\'01.\'02.\'03.\'04.;}{\levelnumbers
-\'01\'03\'05\'07\'09;}\fi-792\li2232\jclisttab\tx2520 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0c\'00.\'01.\'02.\'03.\'04.\'05.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\fi-936\li2736
-\jclisttab\tx2880 }{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0e\'00.\'01.\'02.\'03.\'04.\'05.\'06.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d;}\fi-1080\li3240\jclisttab\tx3600 }{\listlevel\levelnfc0
-\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'10\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\fi-1224\li3744\jclisttab\tx3960 }{\listlevel\levelnfc0\leveljc0\levelfollow0
-\levelstartat1\levelspace0\levelindent0{\leveltext\'12\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\fi-1440\li4320\jclisttab\tx4680 }{\listname ;}\listid699821763}{\list\listtemplateid134807557
-\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f14\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1040865405}{\list\listtemplateid134807553\listsimple
-{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1413117019}}{\*\listoverridetable{\listoverride\listid562713402
-\listoverridecount0\ls1}{\listoverride\listid699821763\listoverridecount0\ls2}{\listoverride\listid139159324\listoverridecount0\ls3}{\listoverride\listid1413117019\listoverridecount0\ls4}{\listoverride\listid541869296\listoverridecount0\ls5}
-{\listoverride\listid377122024\listoverridecount0\ls6}{\listoverride\listid1040865405\listoverridecount0\ls7}}{\info{\title Current status - as of 30th November 2001}{\author Symbian}{\operator Francisco Lopez}{\creatim\yr2001\mo12\dy21\hr11\min9}
-{\revtim\yr2002\mo1\dy18\hr9\min36}{\printim\yr2001\mo11\dy29\hr16\min12}{\version4}{\edmins27}{\nofpages4}{\nofwords887}{\nofchars5059}{\*\company Symbian}{\nofcharsws0}{\vern113}}\paperw11906\paperh16838\margl720\margr720\margt1152\margb1152 
-\widowctrl\ftnbj\aenddoc\hyphcaps0\formshade\viewkind1\viewscale132\viewzk2\pgbrdrhead\pgbrdrfoot \fet0\sectd \psz9\linex0\endnhere\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang
-{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang
-{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain 
-\s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\kerning28\cgrid {Current status of Image Conversion Library - as of 18}{\super th}{ January 2002
-\par }\pard\plain \widctlpar\adjustright \fs20\cgrid {
-\par Perforce Changelist No: 145068
-\par {\listtext\pard\plain\s1 \b\f1\fs28\lang1033\kerning28\cgrid \hich\af1\dbch\af0\loch\f1 Chapter 1\tab}}\pard\plain \s1\sb240\sa60\keepn\widctlpar\ls5\outlinelevel0\adjustright \b\f1\fs28\kerning28\cgrid {Components:
-\par {\listtext\pard\plain\s2 \b\i\f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 1.\tab}}\pard\plain \s2\fi-360\li360\sb240\sa60\keepn\widctlpar\jclisttab\tx360\ls3\outlinelevel1\adjustright \b\i\f1\cgrid {Image Conversion Library framework
-\par }\pard\plain \s15\li360\sa120\widctlpar\adjustright \fs20\cgrid {\f1 Functionally complete. Compiled but not tested on all ARM flavours and compiled and tested on WINS.
-\par Decodes single or multiple frame images. Decodes images with mask bitmaps. Decodes from file or from buffer. Can handle large images. Requires client\rquote s file session. Provides format specific properties of decoded image.
-\par Streaming decoding is handled through the same interface as normal decoding. 
-\par Encodes single images. Encodes to file or to buffer. Can handle large images. Can use client\rquote s file session or create/delete its own. Allows format specific configuration of encoding parameters. 
-\par Rotates internal format (CFbsBitmap) bitmaps. Scales internal format (CFbsBitmap) bitmaps.
-\par Uses ECom. Uses its own custom ECom resolver.
-\par API modified to better support streaming.
-\par }\pard \s15\fi-360\li720\sa120\widctlpar\adjustright {\f1 Has been successfully tested for memory leaks and OOM.
-\par }\pard \s15\li360\sa120\widctlpar\adjustright {\b\f1 Streaming decoding still under development!
-\par Getting an encoding/decoding by MIME type is complete but not yet tested
-\par {\listtext\pard\plain\s2 \b\i\f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 2.\tab}}\pard\plain \s2\fi-360\li360\sb240\sa60\keepn\widctlpar\jclisttab\tx360\ls3\outlinelevel1\adjustright \b\i\f1\cgrid {Custom Resolver
-\par }\pard\plain \s15\li360\sa120\widctlpar\adjustright \fs20\cgrid {\f1 Functionally complete. Compiled but not tested on all ARM flavours and compiled and tested on WINS.
-\par Enables selection of plugin by image type and sub-type or by matching the image header and can also be used to provide a displayable list of available encoders or decoders.
-\par }\pard \s15\fi-360\li720\sa120\widctlpar\adjustright {\b\f1 Not OOM tested yet
-\par {\listtext\pard\plain\s2 \b\i\f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.\tab}}\pard\plain \s2\fi-360\li360\sb240\sa60\keepn\widctlpar\jclisttab\tx360\ls3\outlinelevel1\adjustright \b\i\f1\cgrid {Decoders
-\par }\pard\plain \sa120\widctlpar\adjustright \fs20\cgrid {\f1 All decoders have been compiled and tested on WINS. Limited testing on Assabet.
-\par Unless otherwise stated, all decoders are for single frame formats.
-\par Unless otherwise stated. Streaming remains under development.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.1.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {BMP
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The decoder is functionally complete. Works with streaming
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.2.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {GIF
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 GIF is a single or multi frame format. The decoder is functionally complete for both.
-\par The GIF decoder fully supports conversion using a masked bitmap.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.3.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {JPEG
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The decoder is functionally complete.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.4.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {MBM
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 MBM is a single or multi frame format. The decoder is functionally complete for both.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.5.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {PNG
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The decoder is functionally complete.
-\par The PNG decoder fully supports conversion using a masked bitmap.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.6.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {SMS OTA
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The decoder is functionally complete.
-\par }\pard\plain \s15\fi-360\li1440\sa120\widctlpar\adjustright \fs20\cgrid {\b\f1 OTA will only support single image decoding
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.7.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {TIFF
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 TIFF is a single or multi frame format for group 3 images only. The decoder is functionally complete.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.8.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {WBMP
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The decoder is functionally complete.
-\par }\pard\plain \s15\fi-360\li1440\sa120\widctlpar\adjustright \fs20\cgrid {\b\f1 OTA will only support single image decoding
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.9.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {ICO
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 ICO is a single or multi frame format. The decoder has been implemented (but it is currently broken).
-\par }\pard\plain \s15\fi-360\li1440\sa120\widctlpar\adjustright \fs20\cgrid {\b\f1 Implemented for single frames but currently broken \endash  fix when implement multi-frames.
-\par May still have some memory leaks. Not OOM tested yet.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.10.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {WMF
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The decoder is functionally complete.
-\par {\listtext\pard\plain\s2 \b\i\f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 4.\tab}}\pard\plain \s2\fi-360\li360\sb240\sa60\keepn\widctlpar\jclisttab\tx360\ls3\outlinelevel1\adjustright \b\i\f1\cgrid {Encoders
-\par }\pard\plain \sa120\widctlpar\adjustright \fs20\cgrid {\f1 All encoders have been compiled but not tested on all ARM flavours and compiled and tested on WINS.
-\par All encoders are for the encoding of single frames.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 4.1.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {BMP
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The encoder is functionally complete.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 4.2.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {GIF
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The encoder is functionally complete.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 4.3.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {JPEG
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The encoder is functionally complete.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 4.4.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {MBM
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 The encoder is functionally complete.
-\par {\listtext\pard\plain\s2 \b\i\f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 5.\tab}}\pard\plain \s2\fi-360\li360\sb240\sa60\keepn\widctlpar\jclisttab\tx360\ls3\outlinelevel1\adjustright \b\i\f1\cgrid {Media Server compatibility wrapper
-\par }\pard\plain \li360\sa120\widctlpar\adjustright \fs20\cgrid {\f1 This is a wrapper intended to go around the Image Conversion Library and make it look li
-ke the old Media Server, enabling old software to run largely unchanged apart from recompilation (although some of the more obscure features have been dropped). It directly replaces the MediaClientImage.dll of the original mediasvr code.
-\par It has been compiled and tested on WINS and works \endash  except for areas that depend on unfinished functionality in the Image Conversion Library.
-\par The TVideo.app test harness works using this wrapper, except where there are problems with the Image Conversion Library. Tvideo.app 
-does not supportoperations that use use low level mediaserver code, eg. Frameinfo and Straemplay A cut down version of the TMDAVid.exe,TMDAFailVid.exe and TMDAStressVid.exe test harnesses hava also been used to perform tests of this submodule.
-\par }{\b\f1 Streaming not yet working due to constraints in the Image Conversion Library.
-\par {\listtext\pard\plain\s2 \b\i\f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 6.\tab}}\pard\plain \s2\fi-360\li360\sb240\sa60\keepn\widctlpar\jclisttab\tx360\ls3\outlinelevel1\adjustright \b\i\f1\cgrid {Testing
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 6.1.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {T_ImageConvert
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 This is mostly a piece of \ldblquote smoke test\rdblquote  software. We wrote as we went along \endash 
- as each new feature was implemented, a new test was added to exercise it. Decoding tests display images on screen while encoding tests produce files that can be looked at in other packages.
-\par It does little more than check that a particular feature works. It does not do rigorous heap or OOM checking.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 6.2.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {TImage
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 This is some of the old test code for t
-he Media Server. It has been adapted to use the new Image Conversion Library and runs a large number of rigorous tests that exercise the entire library. The tests check their results by comparing the result to a known reference image.
-\par Most of the tests pass. This depends on the state of image conversion streaming support.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 6.3.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {TImageViewer application
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 This is more of the old Tvideo test code for the Media Server. It has been ported across to use the new Image Conversion Library code. Should provide more rigorous tests.
-\par }\pard\plain \s15\fi-360\li1440\sa120\widctlpar\adjustright \fs20\cgrid {\b\f1 Most tests run \endash  test completeness is limited by the state of streaming support.
-\par {\listtext\pard\plain\s2 \b\i\f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 7.\tab}}\pard\plain \s2\fi-360\li360\sb240\sa60\keepn\widctlpar\jclisttab\tx360\ls3\outlinelevel1\adjustright \b\i\f1\cgrid {Documentation
-\par }\pard\plain \widctlpar\adjustright \fs20\cgrid {
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 7.1.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {Current Status
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 This document
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 7.2.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {Printed Documentation
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 This is being worked on. It needs updating to reflect the changes in the client interface that have b
-een made during implementation as improvements were recognized. Several sections are complete but it needs more work.
-\par }\pard\plain \s15\fi-360\li1440\sa120\widctlpar\adjustright \fs20\cgrid {\b\f1 Not completed yet.
-\par {\listtext\pard\plain\s3 \f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 7.3.\tab}}\pard\plain \s3\fi-702\li1080\sb240\sa60\keepn\widctlpar\jclisttab\tx1080\ls3\ilvl1\outlinelevel2\adjustright \f1\cgrid {In-source Documentation
-\par }\pard\plain \li1080\sa120\widctlpar\adjustright \fs20\cgrid {\f1 We have a mechanism by which, if we put specially formatted comments into the source code, they
- can be extracted and formatted to provide SDK documentation. Most framework functions that should have these have now had them added and many other framework functions have normal comment headers \endash  though it still requires some work to complete.
-
-\par Some of the functions in the plugins are commented although considerable work remains to be done here.
-\par }{\b\f1 In-source docs incomplete.
-\par {\pntext\pard\plain\s2 \b\i\f1\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 8.\tab}}\pard\plain \s2\fi-360\li360\sb240\sa60\keepn\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls6\pnrnot0\pndec\pnstart8\pnindent360\pnhang{\pntxta .}}
-\ls6\outlinelevel1\adjustright \b\i\f1\cgrid {Changes since last
-\par }\pard\plain \widctlpar\adjustright \fs20\cgrid {
-\par {\pntext\pard\plain\s15 \f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \s15\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls4\adjustright \fs20\cgrid {
-\f1 More memory leaks removed.
-\par {\pntext\pard\plain\s15 \f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s15\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f1 
-Major work done on streaming, both in terms of the API and the internal architechture.
-\par {\pntext\pard\plain\s15 \f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s15\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f1 API changes
-
-\par {\pntext\pard\plain\s15 \f14\fs20\lang1033\cgrid \loch\af14\dbch\af0\hich\f14 \'a7\tab}}\pard \s15\fi-360\li1440\widctlpar\jclisttab\tx1440{\*\pn \pnlvlblt\ilvl0\ls7\pnrnot0\pnf14\pnstart1\pnindent360\pnhang{\pntxtb \'a7}}\ls7\adjustright {\f1 
-Introduction of ContinueConvert, to explicitly convert in streaming situations.
-\par {\pntext\pard\plain\s15 \f14\fs20\lang1033\cgrid \loch\af14\dbch\af0\hich\f14 \'a7\tab}}\pard \s15\fi-360\li1440\widctlpar\jclisttab\tx1440{\*\pn \pnlvlblt\ilvl0\ls7\pnrnot0\pnf14\pnstart1\pnindent360\pnhang{\pntxtb \'a7}}\ls7\adjustright {\f1 
-Can open decoder even if insufficient data for recognition of first frame.
-\par {\pntext\pard\plain\s15 \f14\fs20\lang1033\cgrid \loch\af14\dbch\af0\hich\f14 \'a7\tab}}\pard \s15\fi-360\li1440\widctlpar\jclisttab\tx1440{\*\pn \pnlvlblt\ilvl0\ls7\pnrnot0\pnf14\pnstart1\pnindent360\pnhang{\pntxtb \'a7}}\ls7\adjustright {\f1 
-ContinueProcessingHeaderL call to be called when more data arrives, when looking at headers and HeaderProcessingComplete. This is done to indicate that we know what frames we have.
-\par {\pntext\pard\plain\s15 \f14\fs20\lang1033\cgrid \loch\af14\dbch\af0\hich\f14 \'a7\tab}}\pard \s15\fi-360\li1440\widctlpar\jclisttab\tx1440{\*\pn \pnlvlblt\ilvl0\ls7\pnrnot0\pnf14\pnstart1\pnindent360\pnhang{\pntxtb \'a7}}\ls7\adjustright {\f1 
-Major internal changes to allow handling when not all frames are initially present and to properly handle when headers are only partially present.
-\par {\pntext\pard\plain\s15 \f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s15\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f1 Addition of TI
-mageViewer.
-\par {\pntext\pard\plain\s15 \f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s15\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f1 
-Extra tests in Timage.
-\par {\pntext\pard\plain\s15 \f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s15\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f1 
-Builds and partially runs on target. TimageViewer runs well. Requires all images to be tested. Timage still requires a small amount of attention.
-\par {\pntext\pard\plain\s15 \f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s15\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f1 
-Fix for Gif files with large comment blocks.
-\par }}
\ No newline at end of file
--- a/inc/AudioOutputProxyAO.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/inc/AudioOutputProxyAO.h	Fri Apr 16 16:34:49 2010 +0300
@@ -60,6 +60,15 @@
         * @return void
         */
 		void SetRegisterFlag(TBool aFlag);
+		
+		/**
+        * ?member_description.
+        * @since Series 60 3.0
+        * @param aObserver Observer Instance
+        * @return void
+        */
+		void SetObserver(MAudioOutputObserver& aObserver);
+
 
     private:
 
@@ -89,7 +98,7 @@
 		CAudioOutput*									iAudioOutputProxy;
 		MCustomCommand*							iCustomCommandUtility;
 		TPckgBuf<CAudioOutput::TAudioOutputPreference>	iCallbackData;
-		MAudioOutputObserver&							iObserver;
+		MAudioOutputObserver*							iObserver;
 		const TMMFMessageDestinationPckg*				iDestination;
 		TInt											iFunction;
 		TBool											iRegistered;
--- a/layers.sysdef.xml	Tue Feb 02 01:56:55 2010 +0200
+++ b/layers.sysdef.xml	Fri Apr 16 16:34:49 2010 +0300
@@ -13,7 +13,6 @@
 			<module name="">
 				<unit unitID="AudioEqualizerUtility" mrp="" bldFile="&layer_real_source_path;/devsoundextensions/effectspresets/AudioEqualizerUtility/group" filter="!dfs_build" name="AudioEqualizerUtility" />
 				<unit unitID="EnvironmentalReverbUtility" mrp="" bldFile="&layer_real_source_path;/devsoundextensions/effectspresets/EnvironmentalReverbUtility/group" filter="!dfs_build" name="EnvironmentalReverbUtility" />
-				<unit unitID="StereoWideningUtility" mrp="" bldFile="&layer_real_source_path;/devsoundextensions/effectspresets/StereoWideningUtility/group" filter="!dfs_build" name="StereoWideningUtility" />
 			</module>
 			<module name="">
 				<unit unitID="AacEncoderPlugin" mrp="" bldFile="&layer_real_source_path;/audio/ARM_CMMF_codecs/AacEncoderPlugin/group" filter="!sf_build" name="AacEncoderPlugin" />
@@ -39,6 +38,9 @@
 			<module name="">
 				<unit unitID="ARM_MDF_Decoders" mrp="" bldFile="&layer_real_source_path;/video/ARM_MDF_Decoders/group" filter="!sf_build" name="ARM_MDF_Decoders" />
 			</module>
+			<module name="">
+				<unit unitID="Utilities" mrp="" bldFile="&layer_real_source_path;/video/ARM_MDF_Decoders/Utilities/group" filter="sf_build" name="Utilities" />
+			</module>
     </layer>    
 
         <layer name="arm9e_layer"> 
@@ -85,7 +87,6 @@
 			<module name="">
 				<unit unitID="AudioEqualizerUtility_group" mrp="" bldFile="&layer_real_source_path;/devsoundextensions/effectspresets/AudioEqualizerUtility/group" filter="!dfs_build" name="AudioEqualizerUtility_group" />
 				<unit unitID="EnvironmentalReverbUtility_group" mrp="" bldFile="&layer_real_source_path;/devsoundextensions/effectspresets/EnvironmentalReverbUtility/group" filter="!dfs_build" name="EnvironmentalReverbUtility_group" />
-				<unit unitID="StereoWideningUtility_group" mrp="" bldFile="&layer_real_source_path;/devsoundextensions/effectspresets/StereoWideningUtility/group" filter="!dfs_build" name="StereoWideningUtility_group" />
 			</module>
 			<module name="">
 				<unit unitID="AacEncoderPlugin_group" mrp="" bldFile="&layer_real_source_path;/audio/ARM_CMMF_codecs/AacEncoderPlugin/group" filter="!sf_build" name="AacEncoderPlugin_group" />
@@ -111,6 +112,9 @@
 			<module name="">
 				<unit unitID="ARM_MDF_Decoders_group" mrp="" bldFile="&layer_real_source_path;/video/ARM_MDF_Decoders/group" filter="!sf_build" name="ARM_MDF_Decoders_group" />
 			</module>
+			<module name="">
+				<unit unitID="Utilities_group" mrp="" bldFile="&layer_real_source_path;/video/ARM_MDF_Decoders/Utilities/group" filter="sf_build" name="Utilities_group" />
+			</module>
     </layer>    
   </systemModel>
 </SystemDefinition>
\ No newline at end of file
--- a/mdfdevvideoextensions/nga_mdf_postprocessor/group/bld.inf	Tue Feb 02 01:56:55 2010 +0200
+++ b/mdfdevvideoextensions/nga_mdf_postprocessor/group/bld.inf	Fri Apr 16 16:34:49 2010 +0300
@@ -26,6 +26,6 @@
 
 PRJ_EXPORTS
 
-../Rom/NGA_MDF_Postprocessor.iby     CORE_OS_LAYER_IBY_EXPORT_PATH(NGA_MDF_Postprocessor.iby)
+../rom/NGA_MDF_Postprocessor.iby     CORE_OS_LAYER_IBY_EXPORT_PATH(NGA_MDF_Postprocessor.iby)
 ../data/nga_mdf_postprocessor_stub.sis   /epoc32/data/z/system/install/nga_mdf_postprocessor_stub.sis
 
--- a/mdfdevvideoextensions/nga_mdf_postprocessor/inc/NGAPostProcHwDevice.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/mdfdevvideoextensions/nga_mdf_postprocessor/inc/NGAPostProcHwDevice.h	Fri Apr 16 16:34:49 2010 +0300
@@ -24,7 +24,7 @@
 #include <e32base.h>
 #include <e32def.h>
 #include <e32cmn.h>
-#include <STDIO.H>
+#include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
 
@@ -1051,7 +1051,6 @@
 	RChunk										iChunk;
 	RSurfaceManager::TInfoBuf 					iInfo;
 	TSurfaceId									iSurfaceId;
-	TSurfaceId									iRedrawSurfaceId;
 	TBool           							iIsInputEnded;
 	CNGAPostProcTimer*							iPostingTimer;
 	CMMFDevVideoPlay::TPictureCounters  		iPictureCounters;
--- a/mdfdevvideoextensions/nga_mdf_postprocessor/src/200195AF.rss	Tue Feb 02 01:56:55 2010 +0200
+++ b/mdfdevvideoextensions/nga_mdf_postprocessor/src/200195AF.rss	Fri Apr 16 16:34:49 2010 +0300
@@ -21,7 +21,7 @@
 
 
 #include <ecom/registryinfo.rh>
-#include <mmf/devvideo/devvideopluginInterfaceuids.hrh>
+#include <mmf/devvideo/devvideoplugininterfaceuids.hrh>
 #include "NGAPostProcHwDevice_UID.hrh"
 
 RESOURCE REGISTRY_INFO theInfo
--- a/mdfdevvideoextensions/nga_mdf_postprocessor/src/NGAPostProcHwDevice.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mdfdevvideoextensions/nga_mdf_postprocessor/src/NGAPostProcHwDevice.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -55,27 +55,27 @@
 
 CMMFVideoPostProcHwDevice* CNGAPostProcHwDevice::NewL() 
 { 
-   PP_DEBUG(_L("CNGAPostProcHwDevice:NewL() ++"));
+   PP_DEBUG(_L("CNGAPostProcHwDevice::NewL() ++"));
 
     CNGAPostProcHwDevice* self = new (ELeave) CNGAPostProcHwDevice; 
     CleanupStack::PushL(self);
     self->ConstructL(); 
     CleanupStack::Pop();
 
-   PP_DEBUG(_L("CNGAPostProcHwDevice:NewL() --"));
+   PP_DEBUG(_L("CNGAPostProcHwDevice::NewL() --"));
     return (CMMFVideoPostProcHwDevice*)self; 
 }
 
 void CNGAPostProcHwDevice::ConstructL() 
 { 
-   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:ConstructL() ++"), this);
+   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::ConstructL() ++"), this);
     
     // support for VBM buffer interface
     iVBMBufferOptions.iNumInputBuffers  = KMaxVBMBuffers; 
     iVBMBufferOptions.iBufferSize = TSize(KMaxVBMInputWidth, KMaxVBMInputHeight);
     iPostingTimer = CNGAPostProcTimer::NewL(*this);
     iWsSession.Connect();
-   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:ConstructL() --"), this);
+   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::ConstructL() --"), this);
 }
 
 CNGAPostProcHwDevice::CNGAPostProcHwDevice() 
@@ -106,14 +106,13 @@
             iKeyFrameMode(EFalse),
             iFPObserver(NULL)
 {
-	iRedrawSurfaceId = TSurfaceId::CreateNullId();
 	iSurfaceId 		 = TSurfaceId::CreateNullId();
 	iAttributes().iPixelFormat    = EUidPixelFormatYUV_422Interleaved;
 }
 
 CNGAPostProcHwDevice::~CNGAPostProcHwDevice()
 {
-   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:~() ++"), this);
+   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::~CNGAPostProcHwDevice() ++"), this);
    	if (iSessionManager)
     {
         iSessionManager->CancelUpdate();
@@ -363,62 +362,75 @@
 		User::Leave(KErrArgument);
 	}
 	pic = aPicture;	
-	PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:WritePicture bufId = %d"), this,GetID(pic));
-	iPictureCounters.iTotalPictures++;
-	TInt64 delta = 0;
-	TTimeToPost iTimeToPost = (TTimeToPost)IsTimeToPost(pic, delta);
-	if(!IsGceReady())
-    {  
-		PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:WritePictureL GCE not ready"), this );
-		if(iTimeToPost == EPostIt)
+    if (iInputQ.Count() > 0)
+    {
+        AddToQ(pic);
+        AttemptToPost();
+    }
+    else
+    {
+		PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:WritePicture bufId = %d"), this,GetID(pic));
+		iPictureCounters.iTotalPictures++;
+		TInt64 delta = 0;
+		TTimeToPost iTimeToPost = (TTimeToPost)IsTimeToPost(pic, delta);
+		if(!IsGceReady())
+	    {  
+			PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:WritePictureL GCE not ready"), this );
+			if(iTimeToPost == EPostIt)
+			{
+					iTimeToPost = EDelayIt;
+			}
+	    }
+	    if (delta > 0x7FFFFFFF)
+	    {
+	         PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:WritePictureL Too large delta .. skipping"), this ); 
+	         iTimeToPost = ESkipIt;
+	    }
+	
+		switch(iTimeToPost)
 		{
-				iTimeToPost = EDelayIt;
+			case EDelayIt:
+			{
+				if(AddToQ(pic) != 0)
+				{
+					break;
+				}
+				iPostingTimer->Cancel();
+				SetTimer(delta);
+			}
+			break;
+			case EPostIt:
+			{
+		
+				if(iIsColorConversionNeeded)
+				{
+					TVideoPicture* ccPic;				
+	    			ccPic = DoColorConvert(pic); // output will be in ccPic
+	    			pic = ccPic;			   
+				}
+				iProcessQ.Append(pic);
+						
+				#ifdef _DUMP_YUV_FRAMES
+				captureYuv(pic);
+				#endif
+				iSessionManager->PostPicture(iSurfaceId, GetID(pic), iInfo().iBuffers, ETrue);	
+				iCurrentPlaybackPosition = pic->iTimestamp;			
+			
+				if(!iFirstPictureUpdated)
+				{
+					iFirstPictureUpdated = ETrue;
+					PublishSurfaceCreated();
+				}
+			}
+			break;
+			case ESkipIt:
+			{
+				ReleasePicture(pic); 
+				PicturesSkipped();
+			}
+			break;
 		}
     }
-	switch(iTimeToPost)
-	{
-		case EDelayIt:
-		{
-			if(AddToQ(pic) != 0)
-			{
-				break;
-			}
-			iPostingTimer->Cancel();
-			SetTimer(delta);
-		}
-		break;
-		case EPostIt:
-		{
-		
-			if(iIsColorConversionNeeded)
-			{
-				TVideoPicture* ccPic;				
-    			ccPic = DoColorConvert(pic); // output will be in ccPic
-    			pic = ccPic;			   
-			}
-			iProcessQ.Append(pic);
-						
-			#ifdef _DUMP_YUV_FRAMES
-			captureYuv(pic);
-			#endif
-			iSessionManager->PostPicture(iSurfaceId, GetID(pic), iInfo().iBuffers, ETrue);	
-			iCurrentPlaybackPosition = pic->iTimestamp;			
-			
-			if(!iFirstPictureUpdated)
-			{
-				iFirstPictureUpdated = ETrue;
-				PublishSurfaceCreated();
-			}
-		}
-		break;
-		case ESkipIt:
-		{
-			ReleasePicture(pic); 
-			PicturesSkipped();
-		}
-		break;
-	}
-
 	PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:WritePicture --"), this);
 }
 
@@ -655,7 +667,7 @@
 
 void CNGAPostProcHwDevice::MmavsoSetAllowedOutputL(TUint aAllowedOutputMask)
 {
-   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmavsoSetAllowedOutputL aAllowedOutputMask=%d ++"), this,aAllowedOutputMask);  
+   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmavsoSetAllowedOutputL aAllowedOutputMask=0x%08x ++"), this,aAllowedOutputMask);  
    TInt err = KErrNone;
    iSurfaceMask = surfaceHints::EAllowInternalOnly;
     if (aAllowedOutputMask == EVideoAllowAll)
@@ -816,6 +828,14 @@
 	TInt err = KErrNone;
 	if(iResourceLost)
 	{
+        err = AddHints();
+        if (err != KErrNone)
+        {
+            PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost -- failed to AddHints %d"), 
+                         this, err);
+            iProxy->MdvppFatalError(this, err);	
+            return;   
+        }
 		err = RegisterSurface(iSurfaceId);
 		if (err != KErrNone)
 		{
@@ -826,19 +846,12 @@
 			iProxy->MdvppFatalError(this, err);	
 			return;   				
 		}
-        err = AddHints();
-        if (err != KErrNone)
-		{
-		   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost -- failed to AddHints %d"), 
-		   				this, err);
-			iProxy->MdvppFatalError(this, err);	
-			return;   				
-		}
-		iSessionManager->PostPicture(iSurfaceId, 0, 1, EFalse);
-	   	PublishSurfaceCreated();
-	   	iResourceLost = EFalse;
-	}
-	PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Redraw --"), this);
+
+        iSessionManager->PostPicture(iSurfaceId, 0, 1, EFalse);
+        PublishSurfaceCreated();
+        iResourceLost = EFalse;
+    }
+    PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Redraw --"), this);
 }
 
 void CNGAPostProcHwDevice::Start() 
@@ -1197,7 +1210,7 @@
 				if(err)
 				{
 						PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvbmGetBufferL() Surface Setup Failed %d"), this, err);
-        		return NULL;
+						User::Leave(err);
 				}
 		}
 		
@@ -1274,16 +1287,11 @@
 void CNGAPostProcHwDevice::MmvssSurfaceRemovedL(const TSurfaceId& aSurfaceId)
 {
 	PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvssSurfaceRemovedL()++"), this);
-	if(iSurfaceId == aSurfaceId && !aSurfaceId.IsNull())
+	if(!aSurfaceId.IsNull())
 	{
-		if(iInfo().iBuffers > 1) // No need to return temprory redraw surface buffer to decoder
-		{
-			ReleaseProcessQ();
-		}
 		PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvssSurfaceRemovedL(): UnregisterSurface ID = 0x%x"), this, aSurfaceId );
-		iWsSession.UnregisterSurface(0, iSurfaceId);
-		iSurfaceHandler->DestroySurface(iSurfaceId);
-		iSurfaceId = TSurfaceId::CreateNullId();
+		iWsSession.UnregisterSurface(0, aSurfaceId);
+		iSurfaceHandler->DestroySurface(aSurfaceId);
 	}
 		
 	PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvssSurfaceRemovedL() --"), this);
@@ -1318,21 +1326,12 @@
 void CNGAPostProcHwDevice::MmvroResourcesLost(TUid )
 {
     PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost ++"), this);
-    if(!iRedrawSurfaceId.IsNull())
-	{
-		iResourceLost = ETrue;
-		Pause();
-		ReleaseInputQ();
-		iSessionManager->CancelUpdate();
-		ReleaseProcessQ();
-		iWsSession.UnregisterSurface(0, iRedrawSurfaceId);
-		iSurfaceHandler->DestroySurface(iRedrawSurfaceId);
-		iRedrawSurfaceId = TSurfaceId::CreateNullId();
-	}
-	else
-	{
-		PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmvroResourcesLost ERROR iRedrawSurfaceId NULL"), this);
-	}
+	iResourceLost = ETrue;
+	Pause();
+	ReleaseInputQ();
+	iSessionManager->CancelUpdate();
+	ReleaseProcessQ();
+	iVideoSurfaceObserver->MmvsoRemoveSurface();
     PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost --"), this);
 }
 
@@ -1382,8 +1381,6 @@
    	TInt err = KErrNone;
 	SetSurfaceAttributes(surfaceSize, 1); 
 	
-	iRedrawSurfaceId = iSurfaceId;
-	
   	err = iSurfaceHandler->CreateSurface(iAttributes, iSurfaceId);
   	if (err != KErrNone)
 	{
@@ -1438,8 +1435,7 @@
     if(!iSurfaceId.IsNull())
     {
     	PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:SetupExternalSurface Cleaning ReDraw Surface"), this);
-	    iWsSession.UnregisterSurface(0, iSurfaceId);
-		iSurfaceHandler->DestroySurface(iSurfaceId);
+		iVideoSurfaceObserver->MmvsoRemoveSurface();
 	}
     
     iSurfaceId            = aSurfaceID;
@@ -1464,6 +1460,13 @@
 	   				this, err);
 	    return err;
 	}
+    err = AddHints();
+    if (err != KErrNone)
+    {
+        PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:SetupExternalSurface -- failed to AddHints %d"), 
+                    this, err);
+        return err;
+    }
 	err = RegisterSurface(iSurfaceId);
 	if (err != KErrNone)
 	{
@@ -1473,21 +1476,15 @@
 	   	iSurfaceId = TSurfaceId::CreateNullId();
 	    return err;
 	}
-	err = AddHints();
-	if (err != KErrNone)
-	{
-	   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:SetupExternalSurface -- failed to AddHints %d"), 
-	   				this, err);
-	    return err;
-	}
-	err = iSurfaceHandler->SurfaceInfo(iSurfaceId, iInfo);
-	if (err != KErrNone)
-	{
-	   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:SetupExternalSurface -- failed to get Surface info %d"), 
-	   				this, err);
-	    return err;
-	}		
-	  
+
+    err = iSurfaceHandler->SurfaceInfo(iSurfaceId, iInfo);
+    if (err != KErrNone)
+    {
+        PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:SetupExternalSurface -- failed to get Surface info %d"), 
+                     this, err);
+        return err;
+    }
+ 
   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:SetupExternalSurface err=%d"), this, err);
    return err;
 }
@@ -1590,6 +1587,11 @@
 TInt CNGAPostProcHwDevice::AttemptToPost()
 {
    PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:AttemptToPost ++ Q:%d"), this, iInputQ.Count());
+   if (iPPState == EPaused)
+   {
+        return KErrNone;
+   }
+
     TInt err = KErrNotReady;
     TInt count = iInputQ.Count();
     TBool bDone = EFalse;
@@ -1662,11 +1664,22 @@
 	}
 
     TInt resp = EPostIt;
-    
-    if (iClockSource)
+    // Frame presentation time
+    TInt64 uPresTime = frame->iTimestamp.Int64();
+      
+    // Check if this is an out of order frame in case of forward playback
+    if((iCurrentPlaybackPosition.Int64() >= uPresTime) && (iPlayRate > 0))    
+    {      
+         PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:IsTimeToPost : Out of order frame (forward playback) Tfm=%d"), this,(TInt)uPresTime);
+         resp = ESkipIt;  //drop      
+    }      // Check if this is an out of order frame in case of backward playback
+    else if((iCurrentPlaybackPosition.Int64() <= uPresTime) && (iPlayRate < 0))    
+    {      
+        PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:IsTimeToPost : Out of order frame (backward playback) Tfm=%d"), this,(TInt)uPresTime);
+        resp = ESkipIt;  //drop      
+    }
+    else if (iClockSource)
     {
-        // Frame presentation time
-        TInt64 uPresTime = frame->iTimestamp.Int64();
         // The time to sync with.
         TInt64 uSyncTime = iClockSource->Time().Int64();
         
@@ -1790,20 +1803,21 @@
 	   		iSurfaceId = TSurfaceId::CreateNullId();
     	    return err;
     	}
-    	err = RegisterSurface(iSurfaceId);
-    	if (err != KErrNone)
-    	{
-    	   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Initialize -- failed to RegisterSurface %d"), this, err);
-    	   	iSurfaceHandler->DestroySurface(iSurfaceId);
-	   		iSurfaceId = TSurfaceId::CreateNullId();
-    	    return err;
-    	}
-   	    err = AddHints();
-   	    if (err != KErrNone)
-    	{
-    	   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Initialize -- failed to AddHints %d"), this, err);
-    	    return err;
-    	}
+        err = AddHints();
+        if (err != KErrNone)
+        {
+            PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Initialize -- failed to AddHints %d"), this, err);
+            return err;
+        }
+        err = RegisterSurface(iSurfaceId);
+        if (err != KErrNone)
+        {
+            PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Initialize -- failed to RegisterSurface %d"), this, err);
+            iSurfaceHandler->DestroySurface(iSurfaceId);
+            iSurfaceId = TSurfaceId::CreateNullId();
+            return err;
+        }
+
     }
     return err;
 } 
@@ -2087,7 +2101,7 @@
 
 TInt CNGAPostProcHwDevice::AddHints()
 {
-   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:AddHints ++"), this);
+   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:AddHints iSurfaceMask 0x%08x ++"), this, iSurfaceMask);
    TInt err = KErrNone;
    iHint.Set(iSurfaceKey,iSurfaceMask,ETrue);
    err = iSurfaceHandler->AddSurfaceHint(iSurfaceId,iHint);
--- a/mm_info/mm_metadata/mm_metadata.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mm_info/mm_metadata/mm_metadata.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,3 +1,19 @@
+#
+# 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           mm_metadata
 source   \sf\os\mm\mm_info\mm_metadata 
 source   \sf\os\mm\package_definition.xml
Binary file mm_info/mmdocs/Test_Specs/GT0396.111  MMF_CTLFRM_SecureDRM Unit Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/GT0396.112 MMF_UnitTestSpec_DrmPluginServer.xls has changed
Binary file mm_info/mmdocs/Test_Specs/MDF_UnitTestSpec_OmxVorbisCodecs v1.0.xls has changed
Binary file mm_info/mmdocs/Test_Specs/MMF_UnitTestSpec_ BASECL.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.103 Rev1.01 MMF ACOD Unit Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.110 Rev1.01 MMF BASECL Unit Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.111 Rev1.01 MMF CTLFRM Unit Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.113 Rev1.03 MMF AFMT Unit Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.115 Rev1.03 ICL Integration Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.116 Rev1.21 MMF Controller Integration Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.117 Rev1.11 Bitmap Transform Integration Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.119 Rev1.12 MMF Video Clients Integration Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.120 Rev1.08 MMF Audio Clients Integration Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.127 Rev1.01 MMFAudioControllerPlugin_Unit_Test_Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.128 Rev1.01 Multimedia Test Framework Unit Test Specification.xls has changed
Binary file mm_info/mmdocs/Test_Specs/SGL.GT0137.136 Rev1.01 Bitmap Transform Unit Test Specification.xls has changed
--- a/mm_info/mmdocs/multimedia_documentation.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mm_info/mmdocs/multimedia_documentation.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,3 +1,19 @@
+#
+# 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	multimedia_documentation
 
 source	\sf\os\mm\mm_info\mmdocs
--- a/mm_plat/audio_routing_api/tsrc/AudioRoutingTestClass/group/AudioRoutingTestClass.mmp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mm_plat/audio_routing_api/tsrc/AudioRoutingTestClass/group/AudioRoutingTestClass.mmp	Fri Apr 16 16:34:49 2010 +0300
@@ -48,6 +48,7 @@
 
 
 OS_LAYER_SYSTEMINCLUDE
+MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE	/epoc32/include/mmf/common
 SYSTEMINCLUDE	/epoc32/include/mmf/server
 
--- a/mm_pub/audio_effects_api/tsrc/AudioEffectTestModule/group/AudioEffectTestModule.mmp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mm_pub/audio_effects_api/tsrc/AudioEffectTestModule/group/AudioEffectTestModule.mmp	Fri Apr 16 16:34:49 2010 +0300
@@ -45,6 +45,7 @@
  
 
 OS_LAYER_SYSTEMINCLUDE
+MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE	  /epoc32/include/mmf/common
 SYSTEMINCLUDE	  /epoc32/include/mmf/server
 
--- a/mm_pub/audio_effects_presets_api/tsrc/EffectPresetsTest/group/EffectPresetsTest.mmp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mm_pub/audio_effects_presets_api/tsrc/EffectPresetsTest/group/EffectPresetsTest.mmp	Fri Apr 16 16:34:49 2010 +0300
@@ -45,6 +45,7 @@
 
 
 OS_LAYER_SYSTEMINCLUDE
+MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE	  /epoc32/include/mmf/common
 SYSTEMINCLUDE	  /epoc32/include/mmf/server
 
--- a/mm_pub/drm_audio_player_api/tsrc/DRMAudioPlay/inc/DRMAudioPlay.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/mm_pub/drm_audio_player_api/tsrc/DRMAudioPlay/inc/DRMAudioPlay.h	Fri Apr 16 16:34:49 2010 +0300
@@ -38,7 +38,7 @@
 #include "UrlParameters.h"
 #include <f32file.h>
 #include <s32file.h>
-#include <mmcaf.h>
+#include <mmf/common/mmcaf.h>
 
 
 	const TInt KErrConfigInvalid = KErrNone;	//-1100;
--- a/mm_pub/drm_audio_player_api/tsrc/DRMAudioPlay/src/DRMAudioPlay_core.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mm_pub/drm_audio_player_api/tsrc/DRMAudioPlay/src/DRMAudioPlay_core.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -19,8 +19,8 @@
 #include <StifTestInterface.h>
 #include "DRMAudioPlay.h"
 #include <caf.h>
-#include <supplier.h>
-#include <importfile.h>
+#include <caf/supplier.h>
+#include <caf/importfile.h>
 #include <oma2agent.h>
 #include <BAUTILS.H>
 
--- a/mmdevicefw/mdf/src/audio/mdasoundadapter/mdasoundadapterbody.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmdevicefw/mdf/src/audio/mdasoundadapter/mdasoundadapterbody.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -220,8 +220,10 @@
 			{
 			timePlayed = endTime-iStartTime;
 			}	
-		TUint32 bytesPlayed = (timePlayed*iPlayData.iSampleRate*KBytesPerSample)/iFCFrequency;
-		currentBytesPlayed = iBytesPlayed+bytesPlayed;
+        TUint64 bytesPlayed = iPlayData.iSampleRate*KBytesPerSample;    //A TUint64 is used because during the multiplying segment of the calculation we regularly overflow what a TUint32 can handle
+        bytesPlayed = (bytesPlayed * timePlayed)/iFCFrequency;  //The division brings it back into TUint32 territory, however.  We cannot do this before the multiplication without risking significant loss of accuracy
+
+		currentBytesPlayed = iBytesPlayed+I64LOW(bytesPlayed);
         #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
             RDebug::Printf("EstimatedBytesPlayed[%d]  Driver's bytesPlayed[%d]", currentBytesPlayed, iBytesPlayed);
         #endif
--- a/mmhais/a3facl/group/multimedia_a3f_acl.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmhais/a3facl/group/multimedia_a3f_acl.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_a3f_acl.mrp
 #
-#Copyright (c) Symbian Software Ltd 2007.  All rights reserved.
+# Copyright (c) 2007 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	multimedia_a3f_acl
--- a/mmhais/a3fdevsoundcustomisation/group/multimedia_a3f_devsoundadaptationinfo.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmhais/a3fdevsoundcustomisation/group/multimedia_a3f_devsoundadaptationinfo.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_a3f_devsound.mrp
 #
-#Copyright (c) Symbian Software Ltd 2007.  All rights reserved.
+# Copyright (c) 2007 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	multimedia_a3f_devsoundadaptationinfo
--- a/mmhais/refacladapt/group/multimedia_a3f_refacladaptation.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmhais/refacladapt/group/multimedia_a3f_refacladaptation.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_a3f_refacladaptation.mrp
 #
-#Copyright (c) Symbian Software Ltd 2007.  All rights reserved.
+# Copyright (c) 2007 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	multimedia_a3f_refacladaptation
--- a/mmlibs/mmfw/MMPFiles/client/MediaClientVideo.mmp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/MMPFiles/client/MediaClientVideo.mmp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 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"
@@ -41,6 +41,7 @@
 source			mmfclientvideoplayer2.cpp
 source			mediaclientvideodisplaybody.cpp
 source			mediaclientextdisplayinterface.cpp
+source			mediaclientextdisplayhandler.cpp
 #endif 
 
 source			mmfclientvideoplayerbody.cpp
@@ -89,7 +90,7 @@
 	baseaddress	0x4F2A0000
 end
 
-// MACRO __ENABLE_MEDIA_CLIENT_VIDEO_TRACE__
+MACRO __ENABLE_MEDIA_CLIENT_VIDEO_TRACE__
 
 
                     
--- a/mmlibs/mmfw/MMPFiles/client/mediaclientvideodisplay.mmp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/MMPFiles/client/mediaclientvideodisplay.mmp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 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"
@@ -36,6 +36,7 @@
 source			mediaclientvideodisplay.cpp 
 source			mediaclientvideodisplaybody.cpp
 source			mediaclientextdisplayinterface.cpp 
+source			mediaclientextdisplayhandler.cpp
 
 library			ws32.lib
 library			euser.lib
@@ -45,7 +46,7 @@
 
 nostrictdef
 
-// MACRO __ENABLE_MEDIA_CLIENT_VIDEO_TRACE__
+MACRO __ENABLE_MEDIA_CLIENT_VIDEO_TRACE__
 
 SMPSAFE
 
--- a/mmlibs/mmfw/inc/mmf/PLUGIN/mmfmediaclientextdisplayinterface.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/inc/mmf/PLUGIN/mmfmediaclientextdisplayinterface.h	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 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"
@@ -22,23 +22,23 @@
 #define MMFMEDIACLIENTEXTDISPLAYINTERFACE_H_
 
 #include <e32base.h>
-#include <graphics/surface.h>
+
+#define MMF_MEDIA_CLIENT_EXT_DISPLAY_INTERFACE_V2
 
 /**
 
-Mixin class capable of handling events and requests from provider
+Mixin class capable of handling events from provider
 
 */
 class MExtDisplayConnectionProviderCallback
     {
 public:
-    virtual void MedcpcExtDisplayCalculateExtentAndViewportL(TRect& aExtent, TRect& aViewport, TRect& aExternalDisplayRect) = 0;
     virtual void MedcpcExtDisplayNotifyConnected(TBool aExtDisplayConnected) = 0;
     };
 
 /**
 
-Base class for external display connection provider plugins.
+Mixin class for external display connection provider plugins.
 
 */
 class CExtDisplayConnectionProviderInterface : public CBase
@@ -46,70 +46,56 @@
 public:
 
     /**
-    Determines if external displays are supported by checking if any implementations for
-    supporting external displays are available.
+    Allocates and constructs a new provider plugin.
 
-    @return ETrue if supported otherwise EFalse
+    Uses ECOM to instantiate a new provider plugin. Can leave with any of the system-wide error codes.
+
+    @leave  KErrNotSupported There is no support for external displays.
+    @return A pointer to the new provider plugin.
 
     */
-    static TBool ExternalDisplaySupportedL();
-    
-	/**
-	Allocates and constructs a new provider plugin.
-
-	Uses ECOM to instantiate a new provider plugin. Can leave with any of the system-wide error codes.
+    static CExtDisplayConnectionProviderInterface* NewL();
 
-	@param  aCallback
-	        A reference to an object that can be used by the provider to send
-            events back to the client and make request on the client.
-	@param  aSurfaceId
-	        The surfaceId. 
-    @leave  KErrNotSupported There is no support for external displays.
-	@return A pointer to the new provider plugin.
-
-	*/
-	static CExtDisplayConnectionProviderInterface* NewL(MExtDisplayConnectionProviderCallback& aCallback, TSurfaceId& aSurfaceId);
-
+    /**
+    Function to be implemented by connection provider that allows the callback to be set.
+    
+    @param  aCallback
+        A reference to an object that can be used by the provider to send events back to the client.
+    */
+    virtual void SetExtDisplayConnectionProviderCallback(MExtDisplayConnectionProviderCallback& aCallback) = 0;
+	    
     /**
     Function to be implemented by connection provider that indicates whether an external display is
     connected.
     
-    @return ETrue if external display is connectde otherwise EFalse.
+    @return ETrue if external display is connected otherwise EFalse.
     */
-	virtual TBool ExtDisplayConnectedL() = 0;
-	    
-	/**
-	Default destructor.
-	*/
-	IMPORT_C virtual ~CExtDisplayConnectionProviderInterface();
-	
-protected:
-	/**
-	Constructor.
-	*/
-    IMPORT_C CExtDisplayConnectionProviderInterface();
-	
+	virtual TBool ExtDisplayConnected() = 0;
+
+    /**
+    Function to be implemented by connection provider that indicates the display id that should
+    be used for the external display port.
+    
+    @return TInt the display id for the external display port
+    */
+    virtual TInt ExtDisplayId() = 0;
+
     /**
-     The callback handler for the provider plugin.
-     */
-     MExtDisplayConnectionProviderCallback* iCallback; // not owned
+    Default destructor.
+    */
+    IMPORT_C virtual ~CExtDisplayConnectionProviderInterface();
 
-     /**
-     The surface Id.
-     */
-     TSurfaceId iSurfaceId; // not owned
-     
+protected:
+    /**
+    Constructor.
+    */
+    IMPORT_C CExtDisplayConnectionProviderInterface();
+    
 private:
-	/**
-	This is internal and not intended for use.
-	*/
-	void ConstructL(MExtDisplayConnectionProviderCallback& aCallback, TSurfaceId& aSurfaceId);
-	
-private:
-	/**
-	Required by ECOM.
-	*/
-	TUid iInstanceKey;
+    /**
+    Required by ECOM.
+    */
+    TUid iInstanceKey;
 	};
 
 #endif /* MMFMEDIACLIENTEXTDISPLAYINTERFACE_H_ */
--- a/mmlibs/mmfw/inc/mmf/common/MmfPanicCodes.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/inc/mmf/common/MmfPanicCodes.h	Fri Apr 16 16:34:49 2010 +0300
@@ -117,7 +117,10 @@
 	EMMFFilePanicBufferFilledLNotSupported,
 	/** Panic code raised if the file is already open.
 	*/
-	EMMFFileAlreadyOpen
+	EMMFFileAlreadyOpen,
+    /** Panic code raised if the file Handle is NULL.
+    */  
+  EMMFFileHandleNULL
 	};
 
 /** 
--- a/mmlibs/mmfw/inc/mmf/server/mmfdatasink.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/inc/mmf/server/mmfdatasink.h	Fri Apr 16 16:34:49 2010 +0300
@@ -222,7 +222,7 @@
 	@param  aType
 	        The source type UID.
 	*/
-	MDataSink(TUid aType): iDataSinkType(aType) {}
+	MDataSink(TUid aType): iDataSinkType(aType),iDtor_ID_Key(TUid::Null()) {}
 	
 private:
 	TUid iDataSinkType;
--- a/mmlibs/mmfw/src/Client/Utility/mmfclientutility.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/src/Client/Utility/mmfclientutility.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -2282,8 +2282,73 @@
         {//leaving as GetAttribute of CAF caused an error.
         User::Leave(error);
         }
+
+    if(!isDataProtected)
+        {
+        CleanupStack::PopAndDestroy(content);
+        return;//returning cause if data is not protected, we need not evaluate the type of rights.
+        }
+    
+    RArray<TAgent> agents;
+    TAgent drmAgent;
+
+    CManager* manager = CManager::NewLC();
+    CleanupClosePushL( agents );
+    manager->ListAgentsL( agents );
+    
+    for ( TInt i = 0; i < agents.Count(); i++ )
+        {
+        if ( agents[i].Name().Compare( content->Agent().Name() ) == 0 )  
+            {
+            drmAgent = agents[i];
+            break;
+            }
+        }
+    
+    CleanupStack::PopAndDestroy( &agents );        
+    RStreamablePtrArray<CRightsInfo> infoArray;
+    CRightsManager*  rightsManager = manager->CreateRightsManagerL(drmAgent);
+    CleanupStack::PushL(rightsManager);
+    
+    if(iFileName.Length())
+        {
+        if(iUniqueId)
+            {
+            TVirtualPathPtr pathPtr(iFileName, *iUniqueId);
+            TRAP(error,rightsManager->ListRightsL(infoArray, pathPtr) );
+            }
+        else
+            {
+            TRAP(error,rightsManager->ListRightsL(infoArray, iFileName ) ); 
+            }
+        }
+    else if (iUseFileHandle && iOwnFileHandle) 
+        {
+        if(iUniqueId)
+            {
+            TRAP(error,rightsManager->ListRightsL(infoArray, iFileHandle, *iUniqueId) );
+            }
+        else
+            {
+            TRAP(error,rightsManager->ListRightsL(infoArray, iFileHandle, KNullDesC) );
+          }
+        }
+    
+    if(error)
+        {
+        infoArray.Close();
+        User::Leave(error);
+        }
+    TInt consumableRights = 0;
+    if(infoArray.Count() > 0)
+        consumableRights = (ContentAccess::ERightsTypeConsumable) &  infoArray[0]->RightsType();
+    
+    
+    CleanupStack::PopAndDestroy( rightsManager );
+    infoArray.Close();
+    CleanupStack::PopAndDestroy( manager );
     CleanupStack::PopAndDestroy(content);
-    if(isDataProtected && !iHasDrmCapability && mode == EPlayback )
+    if(isDataProtected && !iHasDrmCapability && mode == EPlayback && !consumableRights)
         {//only when the Data is protected and client does not have the DRM capability, we need secure DRM process
         aIsSecureDrmProcess = ETrue;
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmlibs/mmfw/src/Client/Video/mediaclientextdisplayhandler.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -0,0 +1,96 @@
+// Copyright (c) 2010 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:
+//
+
+#include "mediaclientextdisplayhandler.h"
+#include "mediaclientvideotrace.h"
+
+CMediaClientExtDisplayHandler* CMediaClientExtDisplayHandler::NewL(TInt aDisplayId)
+    {
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::NewL +++");
+    CMediaClientExtDisplayHandler* self = new (ELeave) CMediaClientExtDisplayHandler(aDisplayId);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::NewL ---");
+    return self;
+    }
+
+CMediaClientExtDisplayHandler::CMediaClientExtDisplayHandler(TInt aDisplayId)
+: iDisplayId(aDisplayId)
+    {   
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::CMediaClientExtDisplayHandler +++"); 
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::CMediaClientExtDisplayHandler ---");
+    }
+
+void CMediaClientExtDisplayHandler::ConstructL()
+    {
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::ConstructL +++");
+    
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::ConstructL RWsSession Connect");
+    TInt err = iWs.Connect();
+    if (err != KErrNone)
+        {
+        DEBUG_PRINTF("CMediaClientExtDisplayHandler::ConstructL Windows Server unavailable");
+        User::Leave(err);
+        }
+
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::ConstructL CWsScreenDevice Create");
+    iScreen = new (ELeave) CWsScreenDevice(iWs);
+    User::LeaveIfError(iScreen->Construct(iDisplayId));
+
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::ConstructL RWindowGroup Create");
+    iRootWindow = RWindowGroup(iWs);
+    User::LeaveIfError(iRootWindow.Construct((TUint32)this, ETrue));
+
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::ConstructL RWindow Create");
+    iExternalDisplayWindow = RWindow(iWs);
+    User::LeaveIfError(iExternalDisplayWindow.Construct(iRootWindow,((TUint32)(this)) + 1));
+    DEBUG_PRINTF2("CMediaClientExtDisplayHandler::ConstructL - iExternalDisplayWindow WsHandle 0x%X", iExternalDisplayWindow.WsHandle());
+
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::ConstructL Setup external window");
+    iExternalDisplayWindow.SetExtent(TPoint(0,0), iScreen->SizeInPixels());
+    iExternalDisplayWindow.SetVisible(ETrue);
+    iExternalDisplayWindow.Activate();
+    iWs.Flush();
+    
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::ConstructL ---");
+    }
+
+CMediaClientExtDisplayHandler::~CMediaClientExtDisplayHandler()
+    {
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::~CMediaClientExtDisplayHandler +++");
+    
+    iExternalDisplayWindow.Close();
+    iRootWindow.Close();
+    delete iScreen;
+    iScreen = NULL;
+    iWs.Close();
+    
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::~CMediaClientExtDisplayHandler ---");
+    }
+
+RWindowBase* CMediaClientExtDisplayHandler::Window()
+    {
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::Window +++");
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::Window ---");
+    return &iExternalDisplayWindow;
+    }
+
+TSize CMediaClientExtDisplayHandler::DisplaySizeInPixels()
+    {
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::DisplaySizeInPixels +++");
+    DEBUG_PRINTF("CMediaClientExtDisplayHandler::DisplaySizeInPixels ---");
+    return iScreen->SizeInPixels();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmlibs/mmfw/src/Client/Video/mediaclientextdisplayhandler.h	Fri Apr 16 16:34:49 2010 +0300
@@ -0,0 +1,52 @@
+// Copyright (c) 2010 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 MEDIACLIENTVIDEODISPLAYHANDLER_H
+#define MEDIACLIENTVIDEODISPLAYHANDLER_H
+
+#include <w32std.h>
+
+/**
+@internalTechnology
+@released
+
+*/
+NONSHARABLE_CLASS(CMediaClientExtDisplayHandler) : public CBase
+    {
+public:
+
+    static CMediaClientExtDisplayHandler* NewL(TInt aDisplayId);
+    
+    RWindowBase* Window();
+    TSize DisplaySizeInPixels();
+    
+    ~CMediaClientExtDisplayHandler();
+
+private:
+    
+    CMediaClientExtDisplayHandler(TInt aDisplayId);
+    void ConstructL();
+    
+private:
+    
+    TInt iDisplayId;
+    CWsScreenDevice* iScreen;
+    RWindow iExternalDisplayWindow;
+    RWsSession iWs;
+    RWindowGroup iRootWindow;
+    };
+
+#endif // MEDIACLIENTVIDEODISPLAYHANDLER_H
+
--- a/mmlibs/mmfw/src/Client/Video/mediaclientextdisplayinterface.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/src/Client/Video/mediaclientextdisplayinterface.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2010 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"
@@ -18,50 +18,30 @@
 #include <e32cmn.h> 
 #include <ecom/ecom.h>
 
-TBool CExtDisplayConnectionProviderInterface::ExternalDisplaySupportedL()
+void CleanupEComArray(TAny* aArray);
+
+CExtDisplayConnectionProviderInterface* CExtDisplayConnectionProviderInterface::NewL()
     {
     RImplInfoPtrArray implInfoArray;
-    REComSession::ListImplementationsL(TUid::Uid(KMediaDisplayExtProviderInterfaceUid), implInfoArray);
+    TCleanupItem cleanup(CleanupEComArray, &implInfoArray);
+    CleanupStack::PushL(cleanup);
 
-    TBool ret = EFalse;
-    if(implInfoArray.Count() > 0)
-        {
-        ret = ETrue;
-        }
-    
-    implInfoArray.Close();
-    return ret;
-    }
-
-CExtDisplayConnectionProviderInterface* CExtDisplayConnectionProviderInterface::NewL(MExtDisplayConnectionProviderCallback& aCallback, TSurfaceId& aSurfaceId)
-    {
-    RImplInfoPtrArray implInfoArray;
-    CleanupClosePushL(implInfoArray);
     REComSession::ListImplementationsL(TUid::Uid(KMediaDisplayExtProviderInterfaceUid), implInfoArray);
     
     if(implInfoArray.Count() == 0)
         {
-        User::Leave(KErrNotSupported);
+        CleanupStack::PopAndDestroy(); // implInfoArray
+        return NULL;
         }
     
     CExtDisplayConnectionProviderInterface* self = 
         REINTERPRET_CAST(CExtDisplayConnectionProviderInterface*, REComSession::CreateImplementationL(
                 implInfoArray[0]->ImplementationUid(), _FOFF(CExtDisplayConnectionProviderInterface, iInstanceKey)));
-    CleanupStack::PushL(self);
-    
-    self->ConstructL(aCallback, aSurfaceId);
-    CleanupStack::Pop(self);
     
     CleanupStack::PopAndDestroy(); // implInfoArray
     return self;
     }
 
-void CExtDisplayConnectionProviderInterface::ConstructL(MExtDisplayConnectionProviderCallback& aCallback, TSurfaceId& aSurfaceId)
-    {
-    iCallback = &aCallback;
-    iSurfaceId = aSurfaceId;
-    }
-
 EXPORT_C CExtDisplayConnectionProviderInterface::~CExtDisplayConnectionProviderInterface()
     {
     REComSession::DestroyedImplementation(iInstanceKey);
@@ -70,3 +50,10 @@
 EXPORT_C CExtDisplayConnectionProviderInterface::CExtDisplayConnectionProviderInterface()
     {
     }
+
+// CleanupEComArray function is used for cleanup support of locally declared arrays
+void CleanupEComArray(TAny* aArray)
+    {
+    (static_cast<RImplInfoPtrArray*> (aArray))->ResetAndDestroy();
+    (static_cast<RImplInfoPtrArray*> (aArray))->Close();
+    }
--- a/mmlibs/mmfw/src/Client/Video/mediaclientvideodisplay.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/src/Client/Video/mediaclientvideodisplay.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 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"
@@ -75,12 +75,12 @@
 
 void CMediaClientVideoDisplay::ConstructL(TInt aDisplayId)
 	{
-	iBody = CMediaClientVideoDisplayBody::NewL(aDisplayId);
+	iBody = CMediaClientVideoDisplayBody::NewL(aDisplayId, ETrue);
 	}
 
 void CMediaClientVideoDisplay::ConstructL(TInt aDisplayId, const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio)
 	{
-	iBody = CMediaClientVideoDisplayBody::NewL(aDisplayId, aSurfaceId, aCropRect, aAspectRatio);
+	iBody = CMediaClientVideoDisplayBody::NewL(aDisplayId, aSurfaceId, aCropRect, aAspectRatio, ETrue);
 	}
 
 /**
--- a/mmlibs/mmfw/src/Client/Video/mediaclientvideodisplaybody.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/src/Client/Video/mediaclientvideodisplaybody.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 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"
@@ -16,48 +16,62 @@
 #include "mediaclientvideodisplaybody.h"
 #include "mediaclientvideotrace.h"
 #include <surfaceeventhandler.h>
+#include <mmf/plugin/mmfmediaclientextdisplayinterface.hrh>
+#include <e32cmn.h>
+#include <ecom/ecom.h>
 
-CMediaClientVideoDisplayBody* CMediaClientVideoDisplayBody::NewL(TInt aDisplayId)
+CMediaClientVideoDisplayBody* CMediaClientVideoDisplayBody::NewL(TInt aDisplayId, TBool aExtDisplaySwitchingControl)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::NewL +++"));
-	CMediaClientVideoDisplayBody* self = new (ELeave) CMediaClientVideoDisplayBody(aDisplayId);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::NewL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aDisplayId %d", aDisplayId);
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aExtDisplaySwitchingControl %d", aExtDisplaySwitchingControl);
+    
+    CMediaClientVideoDisplayBody* self = new (ELeave) CMediaClientVideoDisplayBody(aDisplayId);
 	CleanupStack::PushL(self);
-	self->ConstructL();
+	self->ConstructL(aExtDisplaySwitchingControl);
 	CleanupStack::Pop(self);
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::NewL ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::NewL ---");
 	return self;
 	}
 
 CMediaClientVideoDisplayBody* CMediaClientVideoDisplayBody::NewL(TInt aDisplayId, const TSurfaceId& aSurfaceId,
-		const TRect& aCropRect, TVideoAspectRatio aAspectRatio)
+		const TRect& aCropRect, TVideoAspectRatio aAspectRatio, TBool aExtDisplaySwitchingControl)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::NewL +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::NewL +++");
+	DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aDisplayId %d", aDisplayId);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::NewL - aSurfaceId 0x%X,0x%X,0x%X,0x%X", aSurfaceId.iInternal[0], aSurfaceId.iInternal[1], aSurfaceId.iInternal[2], aSurfaceId.iInternal[3]);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::NewL - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::NewL - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aExtDisplaySwitchingControl %d", aExtDisplaySwitchingControl);
+
 	if(aSurfaceId.IsNull())
 		{
 		User::Leave(KErrArgument);
 		}
 	CMediaClientVideoDisplayBody* self = new(ELeave) CMediaClientVideoDisplayBody(aDisplayId, aSurfaceId, aCropRect, aAspectRatio);
 	CleanupStack::PushL(self);
-	self->ConstructL();
+	self->ConstructL(aExtDisplaySwitchingControl);
 	CleanupStack::Pop();
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::NewL ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::NewL ---");
 	return self;
 	}
 
-void CMediaClientVideoDisplayBody::ConstructL()
+void CMediaClientVideoDisplayBody::ConstructL(TBool aExtDisplaySwitchingControl)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::ConstructL +++"));
-	
-	iExtDisplaySwitchingSupported = CExtDisplayConnectionProviderInterface::ExternalDisplaySupportedL();
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::ConstructL +++");
+
+	SetWindowArrayPtr2Client();
+
+	CreateExtDisplayPluginL();
 	
 	// Try and enable display switching by default. If this leaves then do so quietly.
 	// Either the client has no scheduler installed or the device does not support external
 	// switching (i.e. no plugin was found) 
-	TRAPD(err, SetExternalDisplaySwitchingL(ETrue));
+	TRAPD(err, SetExternalDisplaySwitchingL(aExtDisplaySwitchingControl));
 	err = err; // remove compile warning
-	DEBUG_PRINT2(_L("CMediaClientVideoDisplayBody::ConstructL SetExternalDisplaySwitchingL returned with %d"), err);
+	DEBUG_PRINTF2("CMediaClientVideoDisplayBody::ConstructL SetExternalDisplaySwitchingL returned with %d", err);
 	
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::ConstructL ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::ConstructL ---");
 	}
 
 CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody(TInt aDisplayId, const TSurfaceId& aSurfaceId,
@@ -67,33 +81,38 @@
 	iCropRect(aCropRect),
 	iAspectRatio(aAspectRatio)
 	{	
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody +++");
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody ---");
 	}
 
 CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody(TInt aDisplayId) :
 	iDisplayId(aDisplayId)
 	{	
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody +++");
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::CMediaClientVideoDisplayBody ---");
 	}
 
 CMediaClientVideoDisplayBody::~CMediaClientVideoDisplayBody()
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::~CMediaClientVideoDisplayBody +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::~CMediaClientVideoDisplayBody +++");
 
+	// remove for whichever array is current
 	RemoveBackgroundSurface(ETrue);
-		
-	iWindows.Close();	
-	delete iExtDisplayConnectionProvider;
+
+	iClientWindows.Close();	
+    iExtDisplayWindows.Close(); 
+
+	delete iExtDisplayHandler;
+	RemoveExtDisplayPlugin();
 	REComSession::FinalClose();
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::~CMediaClientVideoDisplayBody ---"));
+	
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::~CMediaClientVideoDisplayBody ---");
 	}
 
 void CMediaClientVideoDisplayBody::AddDisplayL(MMMFSurfaceEventHandler& aEventHandler)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::AddDisplayL +++"));
-	if (iEventHandler != NULL)
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::AddDisplayL +++");
+	if (iEventHandler)
 		{
 		User::Leave(KErrInUse);
 		}
@@ -104,15 +123,24 @@
 		{
 		iEventHandler->MmsehSurfaceCreated(iDisplayId, iSurfaceId, iCropRect, iAspectRatio);
 		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::AddDisplayL ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::AddDisplayL ---");
 	}
 	
 void CMediaClientVideoDisplayBody::AddDisplayWindowL(const RWindowBase* aWindow, const TRect& aClipRect, const TRect& aCropRegion, const TRect& aVideoExtent, 
 															TReal32 aScaleWidth, TReal32 aScaleHeight, TVideoRotation aRotation, 
 															TAutoScaleType aAutoScaleType, TInt aHorizPos, TInt aVertPos, RWindow* aWindow2)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::AddDisplayWindowL +++"));
-	TInt pos = iWindows.Find(aWindow->WsHandle(), TWindowData::CompareByWsHandle);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::AddDisplayWindowL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::AddDisplayWindowL - aWindow WsHandle 0x%X", aWindow->WsHandle());
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::AddDisplayWindowL - aClipRect %d,%d - %d,%d", aClipRect.iTl.iX, aClipRect.iTl.iY, aClipRect.iBr.iX, aClipRect.iBr.iY);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::AddDisplayWindowL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::AddDisplayWindowL - aVideoExtent %d,%d - %d,%d", aVideoExtent.iTl.iX, aVideoExtent.iTl.iY, aVideoExtent.iBr.iX, aVideoExtent.iBr.iY);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::AddDisplayWindowL - aScaleWidth %f, aScaleHeight %f", aScaleWidth, aScaleHeight);
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::AddDisplayWindowL - aRotation %d", aRotation);
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::AddDisplayWindowL - aAutoScaleType %d", aAutoScaleType);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::AddDisplayWindowL - aHorizPos %d, aVertPos %d", aHorizPos, aVertPos);
+
+	TInt pos = iClientWindows.Find(aWindow->WsHandle(), TWindowData::CompareByWsHandle);
 	
 	if (pos != KErrNotFound)
 		{
@@ -120,67 +148,83 @@
 		}
 	
 	TWindowData winData(aWindow, aClipRect, aVideoExtent, aScaleWidth, aScaleHeight, aRotation, aAutoScaleType, aHorizPos, aVertPos, aWindow2);
-	iWindows.AppendL(winData);
+	iClientWindows.AppendL(winData);
 	
 	iCropRegion = aCropRegion;
 	
 	if (IsSurfaceCreated())
 		{
-        if(iExtDisplaySwitchingSupported && iClientRequestedExtDisplaySwitching)
+		// first client window just added
+        if((iClientWindows.Count() == 1) && iClientRequestedExtDisplaySwitching)
             {
-            CreateExtDisplayConnProvAndRemoveSurfaceL(EFalse);
+            if(iExtDisplayConnected)
+                {
+                TRAPD(err, CreateExtDisplayHandlerL());
+                DEBUG_PRINTF2("CMediaClientVideoDisplayBody::AddDisplayWindowL CreateExtDisplayHandlerL error %d", err);
+                if(err == KErrNone)
+                    {
+                    SetWindowArrayPtr2Ext();
+                    User::LeaveIfError(RedrawWindows(aCropRegion));
+                    }
+                }
             }
         
-        if(!iExtDisplayConnected)
+        if(!iExtDisplayConnected || !iExtDisplayHandler)
             {
             User::LeaveIfError(SetBackgroundSurface(winData, aCropRegion));
             }
 		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::AddDisplayWindowL ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::AddDisplayWindowL ---");
 	}
 
 void CMediaClientVideoDisplayBody::RemoveDisplay()
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveDisplay +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveDisplay +++");
 	iEventHandler = NULL;
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveDisplay ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveDisplay ---");
 	}	
 
 TInt CMediaClientVideoDisplayBody::RemoveDisplayWindow(const RWindowBase& aWindow)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveDisplayWindow +++"));
-	TInt pos = iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveDisplayWindow +++");
+	TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
 	
 	if (pos >= 0)
 		{
-		if (IsSurfaceCreated())
+		if (IsSurfaceCreated() && (!iExtDisplayConnected || !iExtDisplayHandler))
 			{
-			iWindows[pos].iWindow->RemoveBackgroundSurface(ETrue);
-
-			// Make sure all window rendering has completed before proceeding
-			RWsSession* ws = iWindows[pos].iWindow->Session();
-			if (ws)
-				{
-				ws->Finish();
-				}
+			iClientWindows[pos].iWindow->RemoveBackgroundSurface(ETrue);
+            // Make sure all window rendering has completed before proceeding
+            RWsSession* ws = iClientWindows[pos].iWindow->Session();
+            if (ws)
+              {
+              ws->Finish();
+              }
 			}
-		iWindows.Remove(pos);
+		iClientWindows.Remove(pos);
 		
-		if(iWindows.Count() == 0)
+		if(iClientWindows.Count() == 0 && iExtDisplayConnected && iExtDisplayHandler)
 		    {
-		    RemoveExtDisplayConnProv();
+		    RemoveBackgroundSurface(ETrue);
+		    SetWindowArrayPtr2Client();
+		    RemoveExtDisplayHandler();
 		    }
 		}
 	
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveDisplayWindow ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveDisplayWindow ---");
 	return pos;
 	}
 
 
 TInt CMediaClientVideoDisplayBody::SurfaceCreated(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SurfaceCreated +++"));
-	TBool emitEvent = EFalse;
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SurfaceCreated +++");
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aSurfaceId 0x%X,0x%X,0x%X,0x%X", aSurfaceId.iInternal[0], aSurfaceId.iInternal[1], aSurfaceId.iInternal[2], aSurfaceId.iInternal[3]);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SurfaceCreated - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
+
+    TBool emitEvent = EFalse;
 	if((iSurfaceId != aSurfaceId) && (!aSurfaceId.IsNull()))
 		{
 		emitEvent = ETrue;
@@ -197,52 +241,54 @@
 		}
 
 	TInt err = KErrNone;
-    if(iExtDisplaySwitchingSupported && iClientRequestedExtDisplaySwitching)
+    if((iClientWindows.Count() > 0) && iClientRequestedExtDisplaySwitching)
         {
-        TRAP(err, CreateExtDisplayConnProvAndRemoveSurfaceL(EFalse));
+        if(iExtDisplayConnected && !iExtDisplayHandler)
+            {
+            TRAP(err, CreateExtDisplayHandlerL());
+            DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SurfaceCreated CreateExtDisplayHandlerL error %d", err);
+            if(err == KErrNone)
+                {
+                SetWindowArrayPtr2Ext();
+                }
+            }
         }
     
-    if(!iExtDisplayConnected)
-        {
-        err = RedrawWindows(aCropRegion);
-        }
+    err = RedrawWindows(aCropRegion);
     
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SurfaceCreated ---"));
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::SurfaceCreated ---");
 	return err;
 	}
 
 void CMediaClientVideoDisplayBody::RemoveBackgroundSurface(TBool aTriggerRedraw)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveBackgroundSurface +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveBackgroundSurface +++");
 	if (IsSurfaceCreated())
 		{
-		TInt count = iWindows.Count();
+		RWsSession* ws = NULL;
+		TInt count = iWindowsArrayPtr->Count();
 	
-		RWsSession* ws = NULL;
 		for (TInt i = 0; i < count; ++i)
 			{
-			iWindows[i].iWindow->RemoveBackgroundSurface(aTriggerRedraw);
-			// Make sure all window rendering has completed before proceeding
-			ws = iWindows[i].iWindow->Session();
-			if (ws)
-				{
-				ws->Finish();
-				}
+			(*iWindowsArrayPtr)[i].iWindow->RemoveBackgroundSurface(aTriggerRedraw);
+            // Make sure all window rendering has completed before proceeding
+            ws = (*iWindowsArrayPtr)[i].iWindow->Session();
+            if (ws)
+                {
+                ws->Finish();
+                }
 			}
 		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveBackgroundSurface ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveBackgroundSurface ---");
 	}
 
 void CMediaClientVideoDisplayBody::RemoveSurface(TBool aControllerEvent)
     {
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveSurface +++"));
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveSurface +++");
     if (IsSurfaceCreated())
         {
-        if(!iExtDisplayConnected)
-            {
-            RemoveBackgroundSurface(ETrue);
-            }
-        
+        RemoveBackgroundSurface(ETrue);
+
         if (iEventHandler  && aControllerEvent)
             {
             iEventHandler->MmsehRemoveSurface(iSurfaceId);
@@ -250,16 +296,24 @@
 
         iSurfaceId = TSurfaceId::CreateNullId();
 
-        RemoveExtDisplayConnProv();
+        if(iExtDisplayConnected && iExtDisplayHandler)
+            {
+            SetWindowArrayPtr2Client();
+            RemoveExtDisplayHandler();
+            }
         }
     
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveSurface ---"));
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveSurface ---");
     }
 
 TInt CMediaClientVideoDisplayBody::SurfaceParametersChanged(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SurfaceParametersChanged +++"));
-	if (!IsSurfaceCreated())
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SurfaceParametersChanged +++");
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aSurfaceId 0x%X,0x%X,0x%X,0x%X", aSurfaceId.iInternal[0], aSurfaceId.iInternal[1], aSurfaceId.iInternal[2], aSurfaceId.iInternal[3]);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SurfaceCreated - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
+
+    if (!IsSurfaceCreated())
 		{
 		return KErrNotSupported;
 		}
@@ -277,24 +331,26 @@
 		iEventHandler->MmsehSurfaceParametersChanged(iSurfaceId, iCropRect, iAspectRatio);
 		}
 
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SurfaceParametersChanged ---"));
+	RedrawWindows(iCropRegion);
+	
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SurfaceParametersChanged ---");
 	return KErrNone;
 	}
 	
 TInt CMediaClientVideoDisplayBody::RedrawWindows(const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RedrawWindows +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RedrawWindows +++");
 	TInt err = KErrNone;	
 
 	iCropRegion = aCropRegion;
 	
 	if(IsSurfaceCreated())
 		{
-		TInt count = iWindows.Count();
+		TInt count = iWindowsArrayPtr->Count();
 	
 		for (TInt i = 0; i < count; ++i)
 			{
-			err = SetBackgroundSurface(iWindows[i], aCropRegion);
+			err = SetBackgroundSurface((*iWindowsArrayPtr)[i], aCropRegion);
 		
 			if (err != KErrNone)
 				{
@@ -303,60 +359,90 @@
 			}
 		}
 		
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RedrawWindows ---"));
+	DEBUG_PRINTF2("CMediaClientVideoDisplayBody::RedrawWindows --- return with %d", err);
 	return err;
 	}
 
+void CMediaClientVideoDisplayBody::UpdateCropRegionL(const TRect& aCropRegion, TInt aPos)
+    {
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::UpdateCropRegionL +++");
+
+    TRect prevCropRegion(iCropRegion);
+    iCropRegion = aCropRegion;
+    
+    if (IsSurfaceCreated())
+        {
+        if(prevCropRegion == aCropRegion)
+            {
+            if(!iExtDisplayConnected || !iExtDisplayHandler)
+                {
+                User::LeaveIfError(SetBackgroundSurface(iClientWindows[aPos], aCropRegion));
+                }
+            }
+        else
+            {
+            User::LeaveIfError(RedrawWindows(aCropRegion));
+            }
+        }
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::UpdateCropRegionL ---");    
+    }
+
 void CMediaClientVideoDisplayBody::SetAutoScaleL(const RWindowBase& aWindow, TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetAutoScaleL +++"));
-	TInt pos = iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetAutoScaleL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetAutoScaleL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetAutoScaleL - aScaleType %d", aScaleType);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetAutoScaleL - aHorizPos %d, aVertPos %d", aHorizPos, aVertPos);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetAutoScaleL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
+
+    TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
 	User::LeaveIfError(pos);
 	
-	iWindows[pos].iAutoScaleType = aScaleType;
-	iWindows[pos].iHorizPos = aHorizPos;
-	iWindows[pos].iVertPos = aVertPos;
-	iCropRegion = aCropRegion;
+	iClientWindows[pos].iAutoScaleType = aScaleType;
+	iClientWindows[pos].iHorizPos = aHorizPos;
+	iClientWindows[pos].iVertPos = aVertPos;
+
+	UpdateCropRegionL(aCropRegion, pos);
 	
-	if (IsSurfaceCreated() && !iExtDisplayConnected)
-		{
-		User::LeaveIfError(SetBackgroundSurface(iWindows[pos], aCropRegion));
-		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetAutoScaleL ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetAutoScaleL ---");
 	}
 	
 
 void CMediaClientVideoDisplayBody::SetRotationL(const RWindowBase& aWindow, TVideoRotation aRotation, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetRotationL +++"));
-	TInt pos = iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetRotationL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetRotationL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetRotationL - aRotation %d", aRotation);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetRotationL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
+
+    TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
 	User::LeaveIfError(pos);
 	
-	iWindows[pos].iRotation = aRotation;
-	iCropRegion = aCropRegion;
-	
-    if (IsSurfaceCreated() && !iExtDisplayConnected)
-		{
-		User::LeaveIfError(SetBackgroundSurface(iWindows[pos], aCropRegion));
-		}
-	
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetRotationL ---"));
+	iClientWindows[pos].iRotation = aRotation;
+
+    UpdateCropRegionL(aCropRegion, pos);
+
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetRotationL ---");
 	}
 
 TVideoRotation CMediaClientVideoDisplayBody::RotationL(const RWindowBase& aWindow)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RotationL +++"));
-	TInt pos = iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RotationL +++");
+	TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
 	User::LeaveIfError(pos);
 	
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RotationL ---"));
-	return iWindows[pos].iRotation;
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RotationL ---");
+	return iClientWindows[pos].iRotation;
 	}
 
 void CMediaClientVideoDisplayBody::SetScaleFactorL(const RWindowBase& aWindow, TReal32 aWidthPercentage, TReal32 aHeightPercentage, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetScaleFactorL +++"));
-	TInt pos = iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetScaleFactorL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetScaleFactorL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetScaleFactorL - aWidthPercentage %f, aHeightPercentage %f", aWidthPercentage, aHeightPercentage);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetScaleFactorL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
+
+    TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
 	User::LeaveIfError(pos);
 	
 	if (aWidthPercentage <= 0.0 || aHeightPercentage <= 0.0)
@@ -364,137 +450,171 @@
 		User::Leave(KErrArgument);
 		}
 
-	
-	iWindows[pos].iScaleWidth = aWidthPercentage;
-	iWindows[pos].iScaleHeight = aHeightPercentage;
-	iWindows[pos].iAutoScaleType = EAutoScaleNone;
-	iCropRegion = aCropRegion;
+	iClientWindows[pos].iScaleWidth = aWidthPercentage;
+	iClientWindows[pos].iScaleHeight = aHeightPercentage;
+	iClientWindows[pos].iAutoScaleType = EAutoScaleNone;
 	
-    if (IsSurfaceCreated() && !iExtDisplayConnected)
-		{
-		User::LeaveIfError(SetBackgroundSurface(iWindows[pos], aCropRegion));
-		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetScaleFactorL ---"));
+    UpdateCropRegionL(aCropRegion, pos);
+	
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetScaleFactorL ---");
 	}
 	
 void CMediaClientVideoDisplayBody::GetScaleFactorL(const RWindowBase& aWindow, TReal32& aWidthPercentage, TReal32& aHeightPercentage)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::GetScaleFactorL +++"));
-	TInt pos = iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::GetScaleFactorL +++");
+	TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
 	User::LeaveIfError(pos);
 	
-	aWidthPercentage = iWindows[pos].iScaleWidth;
-	aHeightPercentage = iWindows[pos].iScaleHeight;
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::GetScaleFactorL ---"));
+	aWidthPercentage = iClientWindows[pos].iScaleWidth;
+	aHeightPercentage = iClientWindows[pos].iScaleHeight;
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::GetScaleFactorL ---");
 	}
 
 void CMediaClientVideoDisplayBody::SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetAutoScaleL +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetAutoScaleL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetAutoScaleL - aScaleType %d", aScaleType);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetAutoScaleL - aHorizPos %d, aVertPos %d", aHorizPos, aVertPos);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetAutoScaleL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
 	
+    TRect prevCropRegion(iCropRegion);
 	iCropRegion = aCropRegion;
-	TInt count = iWindows.Count();
+	TInt count = iClientWindows.Count();
 	
 	for (TInt i = 0; i < count; ++i)
 		{
-		iWindows[i].iAutoScaleType = aScaleType;
-		iWindows[i].iHorizPos = aHorizPos;
-		iWindows[i].iVertPos = aVertPos;
-	    if (IsSurfaceCreated() && !iExtDisplayConnected)
+		iClientWindows[i].iAutoScaleType = aScaleType;
+		iClientWindows[i].iHorizPos = aHorizPos;
+		iClientWindows[i].iVertPos = aVertPos;
+	    if (IsSurfaceCreated() && (!iExtDisplayConnected || !iExtDisplayHandler))
 			{
-			User::LeaveIfError(SetBackgroundSurface(iWindows[i], aCropRegion));
+			User::LeaveIfError(SetBackgroundSurface(iClientWindows[i], aCropRegion));
 			}
 		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetAutoScaleL ---"));
+	
+	if (IsSurfaceCreated() && iExtDisplayConnected && iExtDisplayHandler && (aCropRegion != prevCropRegion))
+        {
+        User::LeaveIfError(RedrawWindows(aCropRegion));
+        }
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetAutoScaleL ---");
 	}
 
 
 void CMediaClientVideoDisplayBody::SetRotationL(TVideoRotation aRotation, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetRotationL +++"));
-	iCropRegion = aCropRegion;
-	TInt count = iWindows.Count();
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetRotationL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetRotationL - aRotation %d", aRotation);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetRotationL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
+
+    TRect prevCropRegion(iCropRegion);
+    iCropRegion = aCropRegion;
+	TInt count = iClientWindows.Count();
 	
 	for (TInt i = 0; i < count; ++i)
 		{
-		iWindows[i].iRotation = aRotation;
-	    if (IsSurfaceCreated() && !iExtDisplayConnected)
+		iClientWindows[i].iRotation = aRotation;
+        if (IsSurfaceCreated() && (!iExtDisplayConnected || !iExtDisplayHandler))
 			{
-			User::LeaveIfError(SetBackgroundSurface(iWindows[i], aCropRegion));
+			User::LeaveIfError(SetBackgroundSurface(iClientWindows[i], aCropRegion));
 			}
 		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetRotationL ---"));
+	
+    if (IsSurfaceCreated() && iExtDisplayConnected && iExtDisplayHandler && (aCropRegion != prevCropRegion))
+        {
+        User::LeaveIfError(RedrawWindows(aCropRegion));
+        }
+	   
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetRotationL ---");
 	}
 		
 void CMediaClientVideoDisplayBody::SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetScaleFactorL +++"));
-	if (aWidthPercentage <= 0.0 || aHeightPercentage <= 0.0)
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetScaleFactorL +++");
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetScaleFactorL - aWidthPercentage %f, aHeightPercentage %f", aWidthPercentage, aHeightPercentage);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetScaleFactorL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
+
+    if (aWidthPercentage <= 0.0 || aHeightPercentage <= 0.0)
 		{
 		User::Leave(KErrArgument);
 		}
 	
+    TRect prevCropRegion(iCropRegion);
 	iCropRegion = aCropRegion;
-	TInt count = iWindows.Count();
+	TInt count = iClientWindows.Count();
 	
 	for (TInt i = 0; i < count; ++i)
 		{
-		iWindows[i].iScaleWidth = aWidthPercentage;
-		iWindows[i].iScaleHeight = aHeightPercentage;
-		iWindows[i].iAutoScaleType = EAutoScaleNone;
-	    if (IsSurfaceCreated() && !iExtDisplayConnected)
+		iClientWindows[i].iScaleWidth = aWidthPercentage;
+		iClientWindows[i].iScaleHeight = aHeightPercentage;
+		iClientWindows[i].iAutoScaleType = EAutoScaleNone;
+        if (IsSurfaceCreated() && (!iExtDisplayConnected || !iExtDisplayHandler))
 			{
-			User::LeaveIfError(SetBackgroundSurface(iWindows[i], aCropRegion));
+			User::LeaveIfError(SetBackgroundSurface(iClientWindows[i], aCropRegion));
 			}
 		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetScaleFactorL ---"));
+	
+    if (IsSurfaceCreated() && iExtDisplayConnected && iExtDisplayHandler && (aCropRegion != prevCropRegion))
+        {
+        User::LeaveIfError(RedrawWindows(aCropRegion));
+        }
+	   
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetScaleFactorL ---");
 	}
 
 void CMediaClientVideoDisplayBody::SetWindowClipRectL(const RWindowBase& aWindow, const TRect& aWindowClipRect, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetWindowClipRectL +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetWindowClipRectL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetWindowClipRectL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetWindowClipRectL - aWindowClipRect %d,%d - %d,%d", aWindowClipRect.iTl.iX, aWindowClipRect.iTl.iY, aWindowClipRect.iBr.iX, aWindowClipRect.iBr.iY);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetWindowClipRectL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
 	
-	TInt pos = iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
+	TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
 	User::LeaveIfError(pos);
 	
-	iWindows[pos].iClipRect = aWindowClipRect;
-	iCropRegion = aCropRegion;
-	
-    if (IsSurfaceCreated() && !iExtDisplayConnected)
-		{
-		User::LeaveIfError(SetBackgroundSurface(iWindows[pos], aCropRegion));
-		}
-	
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetWindowClipRectL ---"));
+	iClientWindows[pos].iClipRect = aWindowClipRect;
+
+    UpdateCropRegionL(aCropRegion, pos);
+
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetWindowClipRectL ---");
 	}
 	
 void CMediaClientVideoDisplayBody::SetVideoExtentL(const RWindowBase& aWindow, const TRect& aVideoExtent, const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetVideoExtentL +++"));
-	TInt pos = iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetVideoExtentL +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetVideoExtentL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetVideoExtentL - aVideoExtent %d,%d - %d,%d", aVideoExtent.iTl.iX, aVideoExtent.iTl.iY, aVideoExtent.iBr.iX, aVideoExtent.iBr.iY);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetVideoExtentL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
+
+    TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
 	User::LeaveIfError(pos);
 	
-	iWindows[pos].iVideoExtent = aVideoExtent;
-	iCropRegion = aCropRegion;
-	
-    if (IsSurfaceCreated() && !iExtDisplayConnected)
-		{
-		User::LeaveIfError(SetBackgroundSurface(iWindows[pos], aCropRegion));
-		}
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetVideoExtentL ---"));
+	iClientWindows[pos].iVideoExtent = aVideoExtent;
+
+    UpdateCropRegionL(aCropRegion, pos);
+    
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetVideoExtentL ---");
 	}
 	
 TBool CMediaClientVideoDisplayBody::HasWindows() const
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::HasWindows +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::HasWindows ---"));
-	return (iWindows.Count() > 0);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::HasWindows +++");
+	DEBUG_PRINTF2("CMediaClientVideoDisplayBody::HasWindows --- return %d", (iClientWindows.Count() > 0));
+	return (iClientWindows.Count() > 0);
 	}
 	
 TInt CMediaClientVideoDisplayBody::SetBackgroundSurface(TWindowData& aWindowData,  
 									const TRect& aCropRegion)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetBackgroundSurface +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetBackgroundSurface +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetBackgroundSurface - iWindow WsHandle 0x%X", aWindowData.iWindow->WsHandle());
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - iWindow abs pos %d,%d - width %d, height %d", aWindowData.iWindow->AbsPosition().iX, aWindowData.iWindow->AbsPosition().iY, aWindowData.iWindow->Size().iWidth, aWindowData.iWindow->Size().iHeight);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - iClipRect %d,%d - %d,%d", aWindowData.iClipRect.iTl.iX, aWindowData.iClipRect.iTl.iY, aWindowData.iClipRect.iBr.iX, aWindowData.iClipRect.iBr.iY);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - iVideoExtent %d,%d - %d,%d", aWindowData.iVideoExtent.iTl.iX, aWindowData.iVideoExtent.iTl.iY, aWindowData.iVideoExtent.iBr.iX, aWindowData.iVideoExtent.iBr.iY);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetBackgroundSurface - iScaleWidth %f, iScaleHeight %f", aWindowData.iScaleWidth, aWindowData.iScaleHeight);
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetBackgroundSurface - iRotation %d", aWindowData.iRotation);
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetBackgroundSurface - iAutoScaleType %d", aWindowData.iAutoScaleType);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetBackgroundSurface - iHorizPos %d, iVertPos %d", aWindowData.iHorizPos, aWindowData.iVertPos);
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
 	
 	// required as this private function is called directly from external friend class
 	iCropRegion = aCropRegion;
@@ -509,39 +629,11 @@
     // Viewport is 0 size, don't show any video
     if (viewport.Width() <= 0 || viewport.Height() <= 0)
         {
+        DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetBackgroundSurface --- Returned with error %d", KErrArgument);
         return KErrArgument;
         }
 
-	TRect extent;
-	CalculateExtentAndViewport(aWindowData, extent, viewport);
-	
-	aWindowData.iSurfaceConfig.SetViewport(viewport);
-	aWindowData.iSurfaceConfig.SetExtent(extent);
-	aWindowData.iSurfaceConfig.SetOrientation(ConvertRotation(aWindowData.iRotation));
-	
-	aWindowData.iSurfaceConfig.SetSurfaceId(iSurfaceId);
-	
-	// Get the rectangle that bounds the crop rectangle and the viewport.  This should be
-	// the same as the crop rectangle as long as the viewport does not go outside this area.
-	TRect rect(iCropRect);
-	rect.BoundingRect(viewport);
-	TInt err = KErrNone;
-	
-	// Check if the viewport and extent can be displayed as a background surface. The viewport 
-	// is valid if it is within the crop rectangle and is not empty.  The extent is valid if 
-	// it is not empty. 
-	if (rect == iCropRect && !viewport.IsEmpty() && !extent.IsEmpty())
-		{
-		err = aWindowData.iWindow->SetBackgroundSurface(aWindowData.iSurfaceConfig, ETrue);
-		}
-
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetBackgroundSurface ---"));
-	return err;
-	}
-
-void CMediaClientVideoDisplayBody::CalculateExtentAndViewport(const TWindowData& aWindowData, TRect& aExtent, TRect& aViewport)
-    {
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CalculateExtentAndViewport +++"));
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - viewport1 %d,%d - %d,%d", viewport.iTl.iX, viewport.iTl.iY, viewport.iBr.iX, viewport.iBr.iY);
 
     TRect videoExtent(aWindowData.iVideoExtent);
     
@@ -552,14 +644,14 @@
         {
         case EVideoRotationNone:
         case EVideoRotationClockwise180:
-            inputWidth = static_cast<TReal32>(aViewport.Width());
-            inputHeight = static_cast<TReal32>(aViewport.Height());
+            inputWidth = static_cast<TReal32>(viewport.Width());
+            inputHeight = static_cast<TReal32>(viewport.Height());
             pixelAspectRatio = static_cast<TReal32>(iAspectRatio.iNumerator) / iAspectRatio.iDenominator;
             break;
         case EVideoRotationClockwise90:
         case EVideoRotationClockwise270:
-            inputWidth = static_cast<TReal32>(aViewport.Height());
-            inputHeight = static_cast<TReal32>(aViewport.Width());
+            inputWidth = static_cast<TReal32>(viewport.Height());
+            inputHeight = static_cast<TReal32>(viewport.Width());
             pixelAspectRatio = static_cast<TReal32>(iAspectRatio.iDenominator) / iAspectRatio.iNumerator;
             break;
         default:
@@ -567,14 +659,17 @@
             User::Invariant();
             break;
         }
-        
+    
     TReal32 viewportAspect = pixelAspectRatio * inputWidth / inputHeight;
     TReal32 vidextAspect = static_cast<TReal32>(videoExtent.Width()) / static_cast<TReal32>(videoExtent.Height());
     
+    DEBUG_PRINTF4("CMediaClientVideoDisplayBody::SetBackgroundSurface - inputWidth %f, inputHeight %f, PAR %f", inputWidth, inputHeight, pixelAspectRatio);
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetBackgroundSurface - viewportAspect %f, vidextAspect %f", viewportAspect, vidextAspect);
+
     // Set the extent to the display area in the window.  The final height and with is to 
     // be changed by deltaHeight and deltaWidth respectively.
-    aExtent = videoExtent;
-    
+    TRect extent(videoExtent);
+
     TInt deltaHeight = 0;
     TInt deltaWidth = 0;
     
@@ -583,12 +678,12 @@
         if (viewportAspect > vidextAspect)
             {
             // Shrink height to get the correct aspect ratio
-            deltaHeight = (TInt) (aExtent.Width() / viewportAspect - aExtent.Height());
+            deltaHeight = (TInt) (extent.Width() / viewportAspect - extent.Height());
             }
         else
             {
             // Shrink width to get the correct aspect ratio
-            deltaWidth = (TInt) (aExtent.Height() * viewportAspect - aExtent.Width());
+            deltaWidth = (TInt) (extent.Height() * viewportAspect - extent.Width());
             }
         }
     else if (aWindowData.iAutoScaleType == EAutoScaleClip)
@@ -596,12 +691,12 @@
         if (viewportAspect > vidextAspect)
             {
             // Expand width to get the correct aspect ratio
-            deltaWidth = (TInt) (aExtent.Height() * viewportAspect - aExtent.Width());
+            deltaWidth = (TInt) (extent.Height() * viewportAspect - extent.Width());
             }
         else
             {
             // Expand height to get the correct aspect ratio
-            deltaHeight = (TInt) (aExtent.Width() / viewportAspect - aExtent.Height());
+            deltaHeight = (TInt) (extent.Width() / viewportAspect - extent.Height());
             }
         }
     else if (aWindowData.iAutoScaleType == EAutoScaleStretch)
@@ -624,23 +719,25 @@
         deltaWidth = (TInt) (inputWidth * aWindowData.iScaleWidth * 0.01 - videoExtent.Width());
         }
     
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetBackgroundSurface - deltaWidth %d, deltaHeight %d", deltaWidth, deltaHeight);
+
     // Change the width of the extent in the proper directions and propertions.
     switch (aWindowData.iHorizPos)
         {
     case EHorizontalAlignCenter:
-        aExtent.iTl.iX -= deltaWidth / 2;
-        aExtent.iBr.iX += deltaWidth / 2;
+        extent.iTl.iX -= deltaWidth / 2;
+        extent.iBr.iX += deltaWidth / 2;
         break;
     case EHorizontalAlignLeft:
-        aExtent.iBr.iX += deltaWidth;
+        extent.iBr.iX += deltaWidth;
         break;
     case EHorizontalAlignRight:
-        aExtent.iTl.iX -= deltaWidth;
+        extent.iTl.iX -= deltaWidth;
         break;
     default:
-        TInt width = aExtent.Width() + deltaWidth;
-        aExtent.iTl.iX += aWindowData.iHorizPos;
-        aExtent.iBr.iX = aExtent.iTl.iX + width;
+        TInt width = extent.Width() + deltaWidth;
+        extent.iTl.iX += aWindowData.iHorizPos;
+        extent.iBr.iX = extent.iTl.iX + width;
         break;
         }
     
@@ -648,22 +745,24 @@
     switch (aWindowData.iVertPos)
         {
     case EVerticalAlignCenter:
-        aExtent.iTl.iY -= deltaHeight / 2;
-        aExtent.iBr.iY += deltaHeight / 2;
+        extent.iTl.iY -= deltaHeight / 2;
+        extent.iBr.iY += deltaHeight / 2;
         break;
     case EVerticalAlignTop:
-        aExtent.iBr.iY += deltaHeight;
+        extent.iBr.iY += deltaHeight;
         break;
     case EVerticalAlignBottom:
-        aExtent.iTl.iY -= deltaHeight;
+        extent.iTl.iY -= deltaHeight;
         break;
     default:
-        TInt height = aExtent.Height() + deltaHeight;
-        aExtent.iTl.iY += aWindowData.iVertPos;
-        aExtent.iBr.iY = aExtent.iTl.iY + height;
+        TInt height = extent.Height() + deltaHeight;
+        extent.iTl.iY += aWindowData.iVertPos;
+        extent.iBr.iY = extent.iTl.iY + height;
         break;
         }
         
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - extent1 %d,%d - %d,%d", extent.iTl.iX, extent.iTl.iY, extent.iBr.iX, extent.iBr.iY);
+
     // The video should not be displayed outside the intended video extent or clipping rectangle.  
     // The extent already has the correct size and position for displaying the entire viewport.  
     // The viewport is clipped such that the video is not moved/distorted when we take the extent 
@@ -672,137 +771,180 @@
     TRect viewableArea(videoExtent);
     viewableArea.Intersection(aWindowData.iClipRect);
     
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - viewableArea %d,%d - %d,%d", viewableArea.iTl.iX, viewableArea.iTl.iY, viewableArea.iBr.iX, viewableArea.iBr.iY);
+
     // Number of pixels (in window coordinates) to be clipped on the right, bottom, top and left sides of
     // the video.
-    TInt dr = Max(0, aExtent.iBr.iX - viewableArea.iBr.iX);
-    TInt db = Max(0, aExtent.iBr.iY - viewableArea.iBr.iY);
-    TInt dt = Max(0, viewableArea.iTl.iY - aExtent.iTl.iY);
-    TInt dl = Max(0, viewableArea.iTl.iX - aExtent.iTl.iX);
+    TInt dr = Max(0, extent.iBr.iX - viewableArea.iBr.iX);
+    TInt db = Max(0, extent.iBr.iY - viewableArea.iBr.iY);
+    TInt dt = Max(0, viewableArea.iTl.iY - extent.iTl.iY);
+    TInt dl = Max(0, viewableArea.iTl.iX - extent.iTl.iX);
     
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - dr %d, db %d, dt %d, dl %d", dr, db, dt, dl);
+
     // Calculate the number of pixels in the video per window pixel in both x and y directions.
     TReal32 wRatio = 0.0f; 
     TReal32 hRatio = 0.0f;
-    
+
     // Make sure we don't divide by 0
-    if (aExtent.Width() != 0)
+    if (extent.Width() != 0)
         {
-        wRatio = inputWidth / static_cast<TReal32>(aExtent.Width());
+        wRatio = inputWidth / static_cast<TReal32>(extent.Width());
         }
     
-    if (aExtent.Height() != 0)
+    if (extent.Height() != 0)
         {
-        hRatio = inputHeight / static_cast<TReal32>(aExtent.Height());
+        hRatio = inputHeight / static_cast<TReal32>(extent.Height());
         }
     
+    DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SetBackgroundSurface - wRatio %f, hRatio %f", wRatio, hRatio);
+
     // Clip the viewport 
     switch (aWindowData.iRotation)
+    {
+    case EVideoRotationNone:
+        viewport.iBr.iX -= (TInt) (wRatio * static_cast<TReal32>(dr));
+        viewport.iBr.iY -= (TInt) (hRatio * static_cast<TReal32>(db));
+        viewport.iTl.iX += (TInt) (wRatio * static_cast<TReal32>(dl));
+        viewport.iTl.iY += (TInt) (hRatio * static_cast<TReal32>(dt));
+        break;
+    case EVideoRotationClockwise180:
+        viewport.iBr.iX -= (TInt) (wRatio * static_cast<TReal32>(dl));
+        viewport.iBr.iY -= (TInt) (hRatio * static_cast<TReal32>(dt));
+        viewport.iTl.iX += (TInt) (wRatio * static_cast<TReal32>(dr));
+        viewport.iTl.iY += (TInt) (hRatio * static_cast<TReal32>(db));
+        break;
+    case EVideoRotationClockwise90:
+        viewport.iBr.iX -= (TInt) (wRatio * static_cast<TReal32>(db));
+        viewport.iBr.iY -= (TInt) (hRatio * static_cast<TReal32>(dl));
+        viewport.iTl.iX += (TInt) (wRatio * static_cast<TReal32>(dt));
+        viewport.iTl.iY += (TInt) (hRatio * static_cast<TReal32>(dr));
+        break;
+    case EVideoRotationClockwise270:
+        viewport.iBr.iX -= (TInt) (wRatio * static_cast<TReal32>(dt));
+        viewport.iBr.iY -= (TInt) (hRatio * static_cast<TReal32>(dr));
+        viewport.iTl.iX += (TInt) (wRatio * static_cast<TReal32>(db));
+        viewport.iTl.iY += (TInt) (hRatio * static_cast<TReal32>(dl));
+        break;
+    default:
+        // Should never get to default unless there's been some programming error.
+        User::Invariant();
+        break;
+    }
+    
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - viewport2 %d,%d - %d,%d", viewport.iTl.iX, viewport.iTl.iY, viewport.iBr.iX, viewport.iBr.iY);
+
+    // Clip the extent.
+    extent.Intersection(viewableArea);
+    
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - extent2 %d,%d - %d,%d", extent.iTl.iX, extent.iTl.iY, extent.iBr.iX, extent.iBr.iY);
+
+    aWindowData.iSurfaceConfig.SetViewport(viewport);
+    aWindowData.iSurfaceConfig.SetExtent(extent);
+    aWindowData.iSurfaceConfig.SetOrientation(ConvertRotation(aWindowData.iRotation));
+    
+    aWindowData.iSurfaceConfig.SetSurfaceId(iSurfaceId);
+    
+    // Get the rectangle that bounds the crop rectangle and the viewport.  This should be
+    // the same as the crop rectangle as long as the viewport does not go outside this area.
+    TRect rect(iCropRect);
+    rect.BoundingRect(viewport);
+    TInt err = KErrNone;
+    
+    DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - rect %d,%d - %d,%d", rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY);
+
+    // Check if the viewport and extent can be displayed as a background surface. The viewport 
+    // is valid if it is within the crop rectangle and is not empty.  The extent is valid if 
+    // it is not empty. 
+    if (rect == iCropRect && !viewport.IsEmpty() && !extent.IsEmpty())
         {
-        case EVideoRotationNone:
-            aViewport.iBr.iX -= (TInt) (wRatio * static_cast<TReal32>(dr));
-            aViewport.iBr.iY -= (TInt) (hRatio * static_cast<TReal32>(db));
-            aViewport.iTl.iX += (TInt) (wRatio * static_cast<TReal32>(dl));
-            aViewport.iTl.iY += (TInt) (hRatio * static_cast<TReal32>(dt));
-            break;
-        case EVideoRotationClockwise180:
-            aViewport.iBr.iX -= (TInt) (wRatio * static_cast<TReal32>(dl));
-            aViewport.iBr.iY -= (TInt) (hRatio * static_cast<TReal32>(dt));
-            aViewport.iTl.iX += (TInt) (wRatio * static_cast<TReal32>(dr));
-            aViewport.iTl.iY += (TInt) (hRatio * static_cast<TReal32>(db));
-            break;
-        case EVideoRotationClockwise90:
-            aViewport.iBr.iX -= (TInt) (wRatio * static_cast<TReal32>(db));
-            aViewport.iBr.iY -= (TInt) (hRatio * static_cast<TReal32>(dl));
-            aViewport.iTl.iX += (TInt) (wRatio * static_cast<TReal32>(dt));
-            aViewport.iTl.iY += (TInt) (hRatio * static_cast<TReal32>(dr));
-            break;
-        case EVideoRotationClockwise270:
-            aViewport.iBr.iX -= (TInt) (wRatio * static_cast<TReal32>(dt));
-            aViewport.iBr.iY -= (TInt) (hRatio * static_cast<TReal32>(dr));
-            aViewport.iTl.iX += (TInt) (wRatio * static_cast<TReal32>(db));
-            aViewport.iTl.iY += (TInt) (hRatio * static_cast<TReal32>(dl));
-            break;
-        default:
-            // Should never get to default unless there's been some programming error.
-            User::Invariant();
-            break;
+        DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetBackgroundSurface - Calling SetBackgroundSurface");
+        err = aWindowData.iWindow->SetBackgroundSurface(aWindowData.iSurfaceConfig, ETrue);
         }
-    
-    // Clip the extent.
-    aExtent.Intersection(viewableArea);
-    
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CalculateExtentAndViewport ---"));
+
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetBackgroundSurface --- err %d", err);
+    return err;
     }
 
 TBool CMediaClientVideoDisplayBody::IsUsed() const
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::IsUsed +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::IsUsed ---"));
-	return (iEventHandler != NULL || iWindows.Count() > 0);
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::IsUsed +++");
+	DEBUG_PRINTF2("CMediaClientVideoDisplayBody::IsUsed --- return %d", (iEventHandler || iClientWindows.Count() > 0));
+	return (iEventHandler || iClientWindows.Count() > 0);
 	}
 	
 
 TBool CMediaClientVideoDisplayBody::IsSurfaceCreated() const
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::IsSurfaceCreated +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::IsSurfaceCreated ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::IsSurfaceCreated +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::IsSurfaceCreated --- return %d", !(iSurfaceId.IsNull()));
 	return !(iSurfaceId.IsNull());
 	}
 		
 TInt CMediaClientVideoDisplayBody::DisplayId() const
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::DisplayId +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::DisplayId ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::DisplayId +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::DisplayId --- return %d", iDisplayId);
 	return iDisplayId;
 	}
 	
 TInt CMediaClientVideoDisplayBody::CompareByDisplay(const TInt* aDisplayId, const CMediaClientVideoDisplayBody& aDisplay)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CompareByDisplay +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CompareByDisplay ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::CompareByDisplay +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::CompareByDisplay --- return %d", (*aDisplayId - aDisplay.DisplayId()));
 	return (*aDisplayId - aDisplay.DisplayId());
 	}
 		
 TInt CMediaClientVideoDisplayBody::Compare(const CMediaClientVideoDisplayBody& aLeft, const CMediaClientVideoDisplayBody& aRight)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::Compare +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::Compare ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::Compare +++");
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::Compare --- return %d", (aLeft.DisplayId() - aRight.DisplayId()));
 	return (aLeft.DisplayId() - aRight.DisplayId());
 	}
 	
 CFbsBitGc::TGraphicsOrientation CMediaClientVideoDisplayBody::ConvertRotation(TVideoRotation aRotation)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::ConvertRotation +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::ConvertRotation ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::ConvertRotation +++");
+	
+	CFbsBitGc::TGraphicsOrientation orientation;
+	
 	switch(aRotation)
 		{
 		case EVideoRotationNone:
-			return CFbsBitGc::EGraphicsOrientationNormal;
+		    orientation = CFbsBitGc::EGraphicsOrientationNormal;
+		    break;
 		case EVideoRotationClockwise90:
-			return CFbsBitGc::EGraphicsOrientationRotated270;
+		    orientation = CFbsBitGc::EGraphicsOrientationRotated270;
+		    break;
 		case EVideoRotationClockwise180:
-			return CFbsBitGc::EGraphicsOrientationRotated180;
+		    orientation = CFbsBitGc::EGraphicsOrientationRotated180;
+		    break;
 		case EVideoRotationClockwise270:
-			return CFbsBitGc::EGraphicsOrientationRotated90;
+		    orientation = CFbsBitGc::EGraphicsOrientationRotated90;
+		    break;
 		default:
 			// Should never get to default unless there's been some programming error.
 			User::Invariant();
 			// This is never reached, just to keep the compiler happy
-			return CFbsBitGc::EGraphicsOrientationNormal;
+			orientation = CFbsBitGc::EGraphicsOrientationNormal;
 		}
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::ConvertRotation --- return %d", orientation);	
+    return orientation;
 	}
 
 CMediaClientVideoDisplayBody* CMediaClientVideoDisplayBody::FindDisplayWithWindowL(const RPointerArray<CMediaClientVideoDisplayBody>& aDisplays, const RWindowBase& aWindow)
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::FindDisplayWithWindowL +++"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::FindDisplayWithWindowL +++");
 	TInt count = aDisplays.Count();
 	
 	for (TInt i = 0; i < count; ++i)
 		{
 		CMediaClientVideoDisplayBody* display = aDisplays[i];
 	
-		if (display->iWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle) != KErrNotFound)
+		if (display->iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle) != KErrNotFound)
 			{
-			DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::FindDisplayWithWindowL ---"));
+			DEBUG_PRINTF2("CMediaClientVideoDisplayBody::FindDisplayWithWindowL window found at position ", i);
+			DEBUG_PRINTF("CMediaClientVideoDisplayBody::FindDisplayWithWindowL ---");
 			return display;	
 			}
 		}
@@ -813,87 +955,14 @@
 	
 RArray<CMediaClientVideoDisplayBody::TWindowData>& CMediaClientVideoDisplayBody::Windows()
 	{
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::Windows +++"));
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::Windows ---"));
-	return iWindows;	
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::Windows +++");
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::Windows ---");
+	return iClientWindows;	
 	}
 
-void CMediaClientVideoDisplayBody::MedcpcExtDisplayCalculateExtentAndViewportL(TRect& aExtent, TRect& aViewport, TRect& aExternalDisplayRect)
-    {
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::MedcpcExtDisplayCalculateExtentAndViewportL +++"));
-    
-    TWindowData windowData;
-    windowData.iVideoExtent = aExternalDisplayRect;
-    windowData.iRotation = EVideoRotationNone;
-    windowData.iAutoScaleType = EAutoScaleBestFit;
-    windowData.iHorizPos = EHorizontalAlignCenter;
-    windowData.iVertPos = EVerticalAlignCenter;
-    windowData.iClipRect = aExternalDisplayRect;
-    
-    aViewport = iCropRect;
-    // Viewport is 0 size, don't show any video
-    if (aViewport.Width() <= 0 || aViewport.Height() <= 0)
-        {
-        User::Leave(KErrArgument);
-        }
-    
-    CalculateExtentAndViewport(windowData, aExtent, aViewport);
-    
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::MedcpcExtDisplayCalculateExtentAndViewportL ---"));
-    }
-
-void CMediaClientVideoDisplayBody::CreateExtDisplayConnProvAndRemoveSurfaceL(TBool aRemoveBackgroundSurface)
-    {
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CreateExtDisplayConnProvAndRemoveSurfaceL +++"));
-
-    if((iExtDisplayConnectionProvider == NULL) && (iWindows.Count() > 0))
-        {
-        iExtDisplayConnectionProvider = CExtDisplayConnectionProviderInterface::NewL(*this, iSurfaceId);
-        iExtDisplayConnected = iExtDisplayConnectionProvider->ExtDisplayConnectedL();
-        
-        if(iExtDisplayConnected && aRemoveBackgroundSurface)
-            {
-            RemoveBackgroundSurface(ETrue);
-            }
-        }
-
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::CreateExtDisplayConnProvAndRemoveSurfaceL ---"));
-    }
-   
-void CMediaClientVideoDisplayBody::RemoveExtDisplayConnProvAndRedrawL()
-    {
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveExtDisplayConnProvAndRedrawL +++"));
-
-    if(iExtDisplayConnectionProvider != NULL)
-        {
-        delete iExtDisplayConnectionProvider;
-        REComSession::FinalClose();
-        iExtDisplayConnectionProvider = NULL;
-        iExtDisplayConnected = EFalse;
-        User::LeaveIfError(RedrawWindows(iCropRegion));
-        }
-
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveExtDisplayConnProvAndRedrawL ---"));
-    }
-
-void CMediaClientVideoDisplayBody::RemoveExtDisplayConnProv()
-    {
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveExtDisplayConnProv +++"));
-
-    if(iExtDisplayConnectionProvider != NULL)
-        {
-        delete iExtDisplayConnectionProvider;
-        REComSession::FinalClose();
-        iExtDisplayConnectionProvider = NULL;
-        iExtDisplayConnected = EFalse;
-        }
-
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::RemoveExtDisplayConnProv ---"));
-    }
-
 void CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL(TBool aControl)
     {
-    DEBUG_PRINT2(_L("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL +++ aControl=%d"), aControl);
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL +++ aControl=%d", aControl);
 
     // not supported
     if(!iExtDisplaySwitchingSupported)
@@ -902,7 +971,7 @@
         }
     
     // need active scheduler installed
-    if(CActiveScheduler::Current() == NULL)
+    if(!CActiveScheduler::Current())
         {
         User::Leave(KErrNotReady);
         }
@@ -911,48 +980,159 @@
         {
         iClientRequestedExtDisplaySwitching = aControl;
         
-        if(IsSurfaceCreated())
+        DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL SurfaceCreated %d", IsSurfaceCreated());
+        DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL Client window count %d", iClientWindows.Count());
+        DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL External Display Connected %d", iExtDisplayConnected);          
+        DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL Client Requested Ext Display Switching %d", iClientRequestedExtDisplaySwitching);          
+        
+        if(IsSurfaceCreated() && (iClientWindows.Count() > 0) && iExtDisplayConnected)
             {
             if(iClientRequestedExtDisplaySwitching)
                 {
-                CreateExtDisplayConnProvAndRemoveSurfaceL(ETrue);
+                TRAPD(err, CreateExtDisplayHandlerL());
+                DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL CreateExtDisplayHandlerL error %d", err);
+                if(err == KErrNone)
+                    {
+                    RemoveBackgroundSurface(ETrue);
+                    SetWindowArrayPtr2Ext();
+                    RedrawWindows(iCropRegion);
+                    }
                 }
-            else
+            else if(iExtDisplayHandler)
                 {
-                RemoveExtDisplayConnProvAndRedrawL();
+                RemoveBackgroundSurface(ETrue);
+                RemoveExtDisplayHandler();
+                SetWindowArrayPtr2Client();
+                RedrawWindows(iCropRegion);
                 }
             }
-        else
-            {
-            DEBUG_PRINT(_L("No Surface exists"));
-            }
         }
     
-    DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL ---"));
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetExternalDisplaySwitchingL ---");
     }
 
 void CMediaClientVideoDisplayBody::MedcpcExtDisplayNotifyConnected(TBool aExtDisplayConnected)
 	{
-	DEBUG_PRINT2(_L("CMediaClientVideoDisplayBody::MedcpcExtDisplayNotifyConnected +++ aExtDisplayConnected=%d"), aExtDisplayConnected);
+	DEBUG_PRINTF2("CMediaClientVideoDisplayBody::MedcpcExtDisplayNotifyConnected +++ aExtDisplayConnected=%d", aExtDisplayConnected);
 	
 	if(iExtDisplayConnected != aExtDisplayConnected)
 	    {
 	    iExtDisplayConnected = aExtDisplayConnected;
-	    if(iExtDisplayConnected)
-	        {
-	        RemoveBackgroundSurface(ETrue);
-	        }
-	    else
-	        {
-	        // ignore error - no need to tell provider - but lets log it in case it fails
-	        TInt err = RedrawWindows(iCropRegion);
-	        DEBUG_PRINT2(_L("RedrawWindows returned with %d"), err);
-	        }
+
+        if(IsSurfaceCreated() && (iClientWindows.Count() > 0) && iClientRequestedExtDisplaySwitching)
+            {
+            if(iExtDisplayConnected)
+                {
+                TRAPD(err, CreateExtDisplayHandlerL());
+                DEBUG_PRINTF2("CMediaClientVideoDisplayBody::MedcpcExtDisplayNotifyConnected CreateExtDisplayHandlerL error %d", err);
+                if(err == KErrNone)
+                    {
+                    RemoveBackgroundSurface(ETrue);
+                    SetWindowArrayPtr2Ext();
+                    RedrawWindows(iCropRegion);
+                    }
+                }
+            else if(iExtDisplayHandler)
+                {
+                RemoveBackgroundSurface(ETrue);
+                RemoveExtDisplayHandler();
+                SetWindowArrayPtr2Client();
+                RedrawWindows(iCropRegion);
+                }
+            }
 	    }
 	else
 	    {
-	    DEBUG_PRINT(_L("No change in ext display connection status"));
+	    DEBUG_PRINTF("CMediaClientVideoDisplayBody::MedcpcExtDisplayNotifyConnected No change in ext display connection status");
 	    }
 	
-	DEBUG_PRINT(_L("CMediaClientVideoDisplayBody::MedcpcExtDisplayNotifyConnected ---"));
+	DEBUG_PRINTF("CMediaClientVideoDisplayBody::MedcpcExtDisplayNotifyConnected ---");
 	}
+
+void CMediaClientVideoDisplayBody::SetWindowArrayPtr2Client()
+    {
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetWindowArrayPtr2Client +++");
+
+    iWindowsArrayPtr = &iClientWindows;
+
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetWindowArrayPtr2Client ---");
+    }
+
+void CMediaClientVideoDisplayBody::SetWindowArrayPtr2Ext()
+    {
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetWindowArrayPtr2Ext +++");
+
+    iWindowsArrayPtr = &iExtDisplayWindows;
+
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetWindowArrayPtr2Ext ---");
+    }
+
+void CMediaClientVideoDisplayBody::CreateExtDisplayHandlerL()
+    {
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::CreateExtDisplayHandlerL +++");
+
+    CMediaClientExtDisplayHandler* extDisplayHandler = CMediaClientExtDisplayHandler::NewL(iExtDisplayConnectionProvider->ExtDisplayId());
+    CleanupStack::PushL(extDisplayHandler);
+    
+    TWindowData windowData;
+    windowData.iWindow = extDisplayHandler->Window();
+    DEBUG_PRINTF2("CMediaClientVideoDisplayBody::CreateExtDisplayHandlerL - iWindow WsHandle 0x%X", windowData.iWindow->WsHandle());
+    
+    TRect externalDisplayRect(TPoint(0, 0), extDisplayHandler->DisplaySizeInPixels());
+    windowData.iClipRect = externalDisplayRect;
+    windowData.iVideoExtent = externalDisplayRect;
+    // windowData.iScaleWidth not required for EAutoScaleBestFit
+    // windowData.iScaleHeight not required for EAutoScaleBestFit
+    windowData.iRotation = EVideoRotationNone;
+    windowData.iAutoScaleType = EAutoScaleBestFit;
+    windowData.iHorizPos = EHorizontalAlignCenter;
+    windowData.iVertPos = EVerticalAlignCenter;
+    // windowData.iWindow2 not used        
+    
+    iExtDisplayWindows.AppendL(windowData);
+    CleanupStack::Pop(extDisplayHandler);
+    iExtDisplayHandler = extDisplayHandler;
+    
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::CreateExtDisplayHandlerL ---");
+    }
+
+void CMediaClientVideoDisplayBody::RemoveExtDisplayHandler()
+    {
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveExtDisplayHandler +++");
+
+    delete iExtDisplayHandler;
+    iExtDisplayHandler = NULL;
+    iExtDisplayWindows.Reset();
+
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveExtDisplayHandler ---");
+    }
+
+void CMediaClientVideoDisplayBody::CreateExtDisplayPluginL()
+    {
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::CreateExtDisplayPluginL +++");
+    
+    iExtDisplayConnectionProvider = CExtDisplayConnectionProviderInterface::NewL();
+    
+    if(iExtDisplayConnectionProvider)
+        {
+        iExtDisplaySwitchingSupported = ETrue;
+        iExtDisplayConnectionProvider->SetExtDisplayConnectionProviderCallback(*this);
+        iExtDisplayConnected = iExtDisplayConnectionProvider->ExtDisplayConnected();
+        }
+
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::CreateExtDisplayPluginL ---");
+    }
+
+void CMediaClientVideoDisplayBody::RemoveExtDisplayPlugin()
+    {
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveExtDisplayPlugin +++");
+    
+    if(iExtDisplaySwitchingSupported)
+        {
+        delete iExtDisplayConnectionProvider;
+        iExtDisplayConnectionProvider = NULL;
+        iExtDisplaySwitchingSupported = EFalse;
+        iExtDisplayConnected = EFalse;
+        }    
+    DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveExtDisplayPlugin ---");
+    }
--- a/mmlibs/mmfw/src/Client/Video/mediaclientvideodisplaybody.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/src/Client/Video/mediaclientvideodisplaybody.h	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 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"
@@ -16,7 +16,7 @@
 #ifndef MEDIACLIENTVIDEODISPLAYBODY_H
 #define MEDIACLIENTVIDEODISPLAYBODY_H
 
-#include <w32std.h>
+#include "mediaclientextdisplayhandler.h"
 #include <graphics/surface.h>
 #include <graphics/surfaceconfiguration.h>
 #include <mmf/common/mmfvideosurfacecustomcommands.h>
@@ -92,8 +92,8 @@
 		};
 public:
 
-	static CMediaClientVideoDisplayBody* NewL(TInt aDisplayId);
-	static CMediaClientVideoDisplayBody* NewL(TInt aDisplayId, const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio);
+	static CMediaClientVideoDisplayBody* NewL(TInt aDisplayId, TBool aExtDisplaySwitchingControl);
+	static CMediaClientVideoDisplayBody* NewL(TInt aDisplayId, const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio, TBool aExtDisplaySwitchingControl);
 	
 	~CMediaClientVideoDisplayBody();
 	
@@ -129,7 +129,7 @@
 	CMediaClientVideoDisplayBody(TInt aDisplayId);
 	CMediaClientVideoDisplayBody(TInt aDisplayId, const TSurfaceId& aSurfaceId, const TRect& aCropRect,	TVideoAspectRatio aAspectRatio);
 	
-	void ConstructL();
+	void ConstructL(TBool aExtDisplaySwitchingControl);
 	
 	CFbsBitGc::TGraphicsOrientation ConvertRotation(TVideoRotation aRotation);
 	
@@ -141,15 +141,18 @@
 	static CMediaClientVideoDisplayBody* FindDisplayWithWindowL(const RPointerArray<CMediaClientVideoDisplayBody>& aDisplays, const RWindowBase& aWindow);
 	TBool IsSurfaceCreated() const;
 	TInt SetBackgroundSurface(TWindowData& aWindowData, const TRect& aCropRegion);
-	void CalculateExtentAndViewport(const TWindowData& aWindowData, TRect& aExtent, TRect& aViewport);
 	TBool HasWindows() const;
 	
-    void CreateExtDisplayConnProvAndRemoveSurfaceL(TBool aRemoveBackgroundSurface);
-    void RemoveExtDisplayConnProvAndRedrawL();
-    void RemoveExtDisplayConnProv();
-    void MedcpcExtDisplayCalculateExtentAndViewportL(TRect& aExtent, TRect& aViewport, TRect& aExternalDisplayRect);
     void MedcpcExtDisplayNotifyConnected(TBool aExtDisplayConnected);
 
+    void UpdateCropRegionL(const TRect& aCropRegion, TInt aPos);
+    void CreateExtDisplayPluginL();
+    void RemoveExtDisplayPlugin();
+    void CreateExtDisplayHandlerL();
+    void RemoveExtDisplayHandler();
+    void SetWindowArrayPtr2Client();
+    void SetWindowArrayPtr2Ext();
+    
 private:
 
     MMMFSurfaceEventHandler* iEventHandler;
@@ -157,11 +160,15 @@
 	TSurfaceId iSurfaceId;
 	TRect iCropRect;
 	TVideoAspectRatio iAspectRatio;
-	RArray<TWindowData> iWindows;
+	
+	RArray<TWindowData> iClientWindows;
+	RArray<TWindowData> iExtDisplayWindows;
+	RArray<TWindowData>* iWindowsArrayPtr;
 	
 	TRect iCropRegion;
 	TBool iClientRequestedExtDisplaySwitching;
 	CExtDisplayConnectionProviderInterface* iExtDisplayConnectionProvider;
+	CMediaClientExtDisplayHandler* iExtDisplayHandler;
     TBool iExtDisplayConnected;
     TBool iExtDisplaySwitchingSupported;
 	
--- a/mmlibs/mmfw/src/Client/Video/mediaclientvideotrace.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/src/Client/Video/mediaclientvideotrace.h	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 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"
@@ -22,9 +22,6 @@
 
 #include <e32debug.h>
 
-#define DEBUG_PRINT(a) RDebug::Print(a)
-#define DEBUG_PRINT2(a, b) RDebug::Print(a, b)
-
 #define DEBUG_PRINTF(a) RDebug::Printf(a)
 #define DEBUG_PRINTF2(a,b) RDebug::Printf(a,b)
 #define DEBUG_PRINTF3(a,b,c) RDebug::Printf(a,b,c)
@@ -33,9 +30,6 @@
 
 #else // __ENABLE_MEDIA_CLIENT_VIDEO_TRACE__
 
-#define DEBUG_PRINT(a)
-#define DEBUG_PRINT2(a, b)
-
 #define DEBUG_PRINTF(a)
 #define DEBUG_PRINTF2(a, b)
 #define DEBUG_PRINTF3(a, b, c)
--- a/mmlibs/mmfw/src/Client/Video/mmfclientvideoplayerbody.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/src/Client/Video/mmfclientvideoplayerbody.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 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"
@@ -23,6 +23,7 @@
 #include "VideoPlayerBody.h"
 #include "mmfclientvideocommon.h"
 #include "mmfclientutility.h"
+#include "mediaclientvideotrace.h"
 
 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
 #include <mmf/common/mmfvideoenums.h>
@@ -69,10 +70,12 @@
 															 const TRect& aScreenRect,
 															 const TRect& aClipRect)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::NewL (CVPU1)++");
 	CBody* self = new(ELeave) CBody(aParent, aObserver, aScreenDevice.GetScreenNumber(), aPriority, aPref);
 	CleanupStack::PushL(self);
 	self->ConstructL(aWs, aScreenDevice, aWindow, aScreenRect, aClipRect);
 	CleanupStack::Pop();
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::NewL (CVPU1)--");
 	return self;
 	}
 
@@ -82,16 +85,19 @@
 															 TInt aPriority,
 															 TInt aPref)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::NewL (CVPU2)++");
 	CBody* self = new(ELeave) CBody(aParent, aObserver, aPriority, aPref);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop();
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::NewL (CVPU2)--");
 	return self;
 	}
 #endif // SYMBIAN_BUILD_GCE
 
 CVideoPlayerUtility::CBody::~CBody()
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::~CBody++");
 	Close();
 	
 	delete iControllerImplementationInformation;
@@ -104,10 +110,12 @@
 	delete iFrameBitmap;
 	if (iFbsSessionConnected)
 		iFbsSession.Disconnect();
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::~CBody--");
 	}
 
 void CVideoPlayerUtility::CBody::Close()
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::Close++");
 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
 	DisableSubtitles();
 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
@@ -135,6 +143,7 @@
 	iControllerUid = KNullUid;
 	iControllerOpen = EFalse;
 	iDirectScreenAccessAbort = EFalse;
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::Close--");
 	}
 
 CVideoPlayerUtility::CBody::CBody(CVideoPlayerUtility* aParent,
@@ -201,11 +210,13 @@
 
 void CVideoPlayerUtility::CBody::ConstructL()
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::ConstructL1++");
 	CommonConstructL();
 	iFindAndOpenController = CMMFFindAndOpenController::NewL(*this);
 	iFindAndOpenController->SetSurfaceMode(iUsingVPU2, &iVideoPlaySurfaceSupportCustomCommands);
 	iFindAndOpenController->Configure(KUidMediaTypeVideo, iPrioritySettings, CMMFPluginSelectionParameters::EAllowOtherMediaIds);
 	iFindAndOpenController->ConfigureController(iController, *iControllerEventMonitor, CMMFFindAndOpenController::EPlayback);
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::ConstructL1--");
 	}
 
 #endif // SYMBIAN_BUILD_GCE
@@ -216,6 +227,7 @@
 						const TRect& aWindowRect,
 						const TRect& aClipRect)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::ConstructL2++");
 	CommonConstructL();
 	
 	SetDisplayWindowL(aWs, aScreenDevice, aWindow, aWindowRect, aClipRect);
@@ -235,6 +247,7 @@
 #endif
 	iFindAndOpenController->Configure(KUidMediaTypeVideo, iPrioritySettings, CMMFPluginSelectionParameters::EAllowOtherMediaIds);
 	iFindAndOpenController->ConfigureController(iController, *iControllerEventMonitor, CMMFFindAndOpenController::EPlayback);
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::ConstructL2--");
 	}
 
 void CVideoPlayerUtility::CBody::CommonConstructL()
@@ -249,6 +262,7 @@
 
 void CVideoPlayerUtility::CBody::Reset() 
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::Reset++");
 	Close();
 	
 	// reset all state variables
@@ -259,10 +273,12 @@
 	iGraphicsSurfaceSupported = EFalse;
 #endif
 	iControllerUid = KNullUid;
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::Reset--");
 	}
 
 void CVideoPlayerUtility::CBody::SetAndUpdateWindow()
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetAndUpdateWindow++");
 	if (iOpenError == KErrNone)	
 		{
 		// Set the display window and update display region if the controller doesn't support graphics surface. 		
@@ -273,6 +289,7 @@
 		{
 		iOpenError = iVideoPlayControllerCustomCommands.UpdateDisplayRegion(*iDirectScreenAccess->DrawingRegion());
 		}
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetAndUpdateWindow--");
 	}
 
 void CVideoPlayerUtility::CBody::MfaocComplete(		
@@ -282,6 +299,8 @@
 	TMMFMessageDestination* /*aSourceHandle*/, 
 	TMMFMessageDestination* /*aSinkHandle*/)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::MfaocComplete++");
+    DEBUG_PRINTF3("CVideoPlayerUtility::CBody::MfaocComplete - aError %d, aControllerUid 0x%X", aError, aControllerUid.iUid);
 	iCallbackOpenReceived = ETrue;
 
 	// save the error in iOpenError -
@@ -295,6 +314,8 @@
 #ifdef SYMBIAN_BUILD_GCE
 		// Check if the graphics surfaces is supported
 		TInt err = CheckSurfaceSupported();
+
+		DEBUG_PRINTF4("CVideoPlayerUtility::CBody::MfaocComplete - Checked surfaces supported - Err %d, Surfaces supported %d, Using VPU2 %d", err, iGraphicsSurfaceSupported, iUsingVPU2);
 	
 		if (!iGraphicsSurfaceSupported)
 			{
@@ -397,24 +418,31 @@
 		iCallbackOpenReceived = EFalse;
 		iAsyncCallback->Signal(iOpenError, CMMFVideoPlayerCallback::EOpenCompleteEvent);
 		}
-
+	
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::MfaocComplete--");
 	}
 
 void CVideoPlayerUtility::CBody::OpenFileL(const TDesC& aFileName, TUid aControllerUid)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenFileL (filename)++");
 	TMMFileSource filesource(aFileName, KDefaultContentObject, EPlay);
 	OpenFileL(filesource, aControllerUid);
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenFileL (filename)--");
 	}
 	
 void CVideoPlayerUtility::CBody::OpenFileL(const RFile& aFile, TUid aControllerUid)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenFileL (filehandle)++");
 	RFile& file = const_cast<RFile&>(aFile);
 	TMMFileHandleSource filehandlesource(file, KDefaultContentObject, EPlay);
 	OpenFileL(filehandlesource, aControllerUid);
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenFileL (filehandle)--");
 	}
 
 void CVideoPlayerUtility::CBody::OpenFileL(const TMMSource& aSource, TUid aControllerUid)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenFileL (source)++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::OpenFileL - aControllerUid 0x%X", aControllerUid.iUid);
 	// Make sure we are closed
 	Reset();
 
@@ -434,6 +462,8 @@
 		{
 		iFindAndOpenController->OpenByFileSource(aSource);
 		}
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenFileL (source)--");
 	}
 	
 //
@@ -442,6 +472,7 @@
 //
 void CVideoPlayerUtility::CBody::OpenDesL(const TDesC8& aDescriptor, TUid aControllerUid)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenDesL++");
 	// Make sure we are closed
 	Reset();
 
@@ -461,10 +492,12 @@
 		{
 		iFindAndOpenController->OpenByDescriptor(aDescriptor);
 		}
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenDesL--");
 	}
 	
 void CVideoPlayerUtility::CBody::OpenUrlL(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType, TUid aControllerUid)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenUrlL++");
 	// Make sure we are closed
 	Reset();
 
@@ -487,16 +520,20 @@
 		iFindAndOpenController->OpenByUrl(aUrl, aIapId, aMimeType);
 
 	delete urlCfgBuffer;
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::OpenUrlL--");
 	}
 
 void CVideoPlayerUtility::CBody::Play()
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::Play++");
 	TInt err = iController.Prime();
 	if (err == KErrNone)
 		err = iController.Play();
 	if (err != KErrNone)
 	    {
 	    iAsyncCallback->Signal(err,CMMFVideoPlayerCallback::EPlayCompleteEvent);
+	    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::Play (exit 1)-- - Err %d", err);
 	    return;
 	    }
 	iState = EPlaying;
@@ -511,16 +548,20 @@
 			iAsyncCallback->Signal(err, CMMFVideoPlayerCallback::EPlayCompleteEvent);
 			}
 		}
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::Play-- - Err %d", err);
 	}
 
 void CVideoPlayerUtility::CBody::Play(const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aEndTime)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::Play++");
+    DEBUG_PRINTF3("CVideoPlayerUtility::CBody::Play - aStartTime %ld, aEndTime %ld", aStartTime.Int64(), aEndTime.Int64());
 	TInt err = iController.Prime();
 	if (err == KErrNone)
 	err = iVideoPlayControllerCustomCommands.Play(aStartTime, aEndTime);
 	if (err != KErrNone)
 	    {
 	    iAsyncCallback->Signal(err, CMMFVideoPlayerCallback::EPlayCompleteEvent);
+		DEBUG_PRINTF2("CVideoPlayerUtility::CBody::Play (exit1)-- - Err %d", err);
 	    return;
 	    }
 	iState = EPlaying;
@@ -535,20 +576,25 @@
 			iAsyncCallback->Signal(err, CMMFVideoPlayerCallback::EPlayCompleteEvent);
 			}
 		}
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::Play-- - Err %d", err);
 	}
 
 
 TInt CVideoPlayerUtility::CBody::Stop()
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::Stop++");
 	TInt err = iController.Stop();
 	iState = EStopped;
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::Stop-- - Err %d", err);
 	return err;
 	}
 
 void CVideoPlayerUtility::CBody::PauseL()
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::PauseL++");
 	User::LeaveIfError(iController.Pause());
 	iState = EPaused;
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::PauseL--");
 	}
 
 void CVideoPlayerUtility::CBody::SetVolumeL(TInt aVolume)
@@ -558,17 +604,27 @@
 
 void CVideoPlayerUtility::CBody::PrepareDSAL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindowBase& aWindow)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::PrepareDSAL++");
 	CDirectScreenAccess* old = iDirectScreenAccess;
 	iDirectScreenAccess = CDirectScreenAccess::NewL(aWs,aScreenDevice,aWindow,*this);
 	delete old;
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::PrepareDSAL - Starting");
 	iDirectScreenAccess->StartL();
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::PrepareDSAL--");
 	}
 
 void CVideoPlayerUtility::CBody::SetDisplayWindowL(RWsSession& aWs, CWsScreenDevice& aScreenDevice,
 							RWindowBase& aWindow, const TRect& aWindowRect,
 							const TRect& aClipRect)
 	{	
-	iWindowRect = aWindowRect;
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetDisplayWindowL++");
+    DEBUG_PRINTF4("CVideoPlayerUtility::CBody::SetDisplayWindowL - aScreenDevice num %d, width %d, height %d", aScreenDevice.GetScreenNumber(), aScreenDevice.SizeInPixels().iWidth, aScreenDevice.SizeInPixels().iHeight);
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetDisplayWindowL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::SetDisplayWindowL - aWindow abs pos %d,%d - width %d, height %d", aWindow.AbsPosition().iX, aWindow.AbsPosition().iY, aWindow.Size().iWidth, aWindow.Size().iHeight);
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::SetDisplayWindowL - aWindowRect %d,%d - %d,%d", aWindowRect.iTl.iX, aWindowRect.iTl.iY, aWindowRect.iBr.iX, aWindowRect.iBr.iY);
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::SetDisplayWindowL - aClipRect %d,%d - %d,%d", aClipRect.iTl.iX, aClipRect.iTl.iY, aClipRect.iBr.iX, aClipRect.iBr.iY);
+
+    iWindowRect = aWindowRect;
 	iClipRect = aClipRect;
 	
 #ifdef SYMBIAN_BUILD_GCE
@@ -630,6 +686,7 @@
 			}
 		}
 #endif
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetDisplayWindowL--");
 	}
 
 TReal32 CVideoPlayerUtility::CBody::VideoFrameRateL() const
@@ -668,6 +725,9 @@
 
 void CVideoPlayerUtility::CBody::SetRotationL(TVideoRotation aRotation)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetRotationL++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetRotationL - aRotation %d", aRotation);
+
 #ifdef SYMBIAN_BUILD_GCE
 	if (!iGraphicsSurfaceSupported)
 		{
@@ -708,6 +768,8 @@
 #else 
 	User::LeaveIfError(iVideoPlayControllerCustomCommands.SetRotation(aRotation));
 #endif // SYMBIAN_BUILD_GCE
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetRotationL--");
 	}
 
 TVideoRotation CVideoPlayerUtility::CBody::RotationL() const
@@ -731,6 +793,9 @@
 
 void CVideoPlayerUtility::CBody::SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetScaleFactorL");
+    DEBUG_PRINTF4("CVideoPlayerUtility::CBody::SetScaleFactorL - aWidthPercentage %f, aHeightPercentage %f, aAntiAliasFiltering %d", aWidthPercentage, aHeightPercentage, aAntiAliasFiltering);
+
 #ifdef SYMBIAN_BUILD_GCE
 	if (!iGraphicsSurfaceSupported)
 		{
@@ -755,6 +820,8 @@
 #else
 	User::LeaveIfError(iVideoPlayControllerCustomCommands.SetScaleFactor(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering));
 #endif	// SYMBIAN_BUILD_GCE
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetScaleFactorL--");
 	}
 
 void CVideoPlayerUtility::CBody::GetScaleFactorL(TReal32& aWidthPercentage, TReal32& aHeightPercentage, TBool& aAntiAliasFiltering) const
@@ -853,7 +920,10 @@
 
 void CVideoPlayerUtility::CBody::SetPriorityL(TInt aPriority, TInt aPref)
 	{
-	iPrioritySettings.iPref = aPref;
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetPriorityL++");
+    DEBUG_PRINTF3("CVideoPlayerUtility::CBody::SetPriorityL - aPriority %d, aPref %d", aPriority, aPref);
+
+    iPrioritySettings.iPref = aPref;
 	iPrioritySettings.iPriority = aPriority;
 
 	TInt err = iController.SetPrioritySettings(iPrioritySettings);
@@ -865,6 +935,7 @@
 		{
 		User::Leave(err);
 		}
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetPriorityL--");
 	}
 
 void CVideoPlayerUtility::CBody::PriorityL(TInt & aPriority, TMdaPriorityPreference &aPref) const 
@@ -876,7 +947,10 @@
 
 void CVideoPlayerUtility::CBody::SetPositionL(const TTimeIntervalMicroSeconds& aPosition)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetPositionL++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetPositionL - aPosition %ld", aPosition.Int64());
 	User::LeaveIfError(iController.SetPosition(aPosition));
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetPositionL--");
 	}
 
 
@@ -971,7 +1045,10 @@
 
 void CVideoPlayerUtility::CBody::HandleEvent(const TMMFEvent& aEvent)
 	{
-	if (aEvent.iEventType == KMMFEventCategoryVideoOpenComplete)
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::HandleEvent++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::HandleEvent - Event type 0x%X", aEvent.iEventType);
+
+    if (aEvent.iEventType == KMMFEventCategoryVideoOpenComplete)
 		{
 		// if we haven't had a MfaocComplete() callback yet,
 		// we need to delay the call back to the client
@@ -1066,12 +1143,16 @@
 	else 
 		// Pass on all unrecognised events to the client
 		iObserver.MvpuoEvent(aEvent);
+
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::HandleEvent--");
 	}
 
 #ifdef SYMBIAN_BUILD_GCE
 TInt CVideoPlayerUtility::CBody::SurfaceCreated()
 	{
-	TInt count = iActiveDisplays.Count();
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SurfaceCreated++");
+
+    TInt count = iActiveDisplays.Count();
 	TBool replaceSurface = !(iSurfaceId.IsNull());
 	TSurfaceId oldSurfaceId(iSurfaceId);
 	
@@ -1130,11 +1211,14 @@
             error = error2;
             }
         }
-    return error;
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::SurfaceCreated--");
+	return error;
 	}
 
 TInt CVideoPlayerUtility::CBody::SurfaceParametersChanged()
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SurfaceParametersChanged++");
 	if (iSurfaceId.IsNull())
 		{
 		return KErrNotSupported;
@@ -1171,7 +1255,8 @@
 			error = error2;
 			}
 		}
-	return error;
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SurfaceParametersChanged-- - Error %d", error);
+    return error;
 	}
 		
 TInt CVideoPlayerUtility::CBody::SetAllBackgroundSurfaces()
@@ -1194,6 +1279,7 @@
 
 TInt CVideoPlayerUtility::CBody::RemoveSurface(TBool aControllerEvent)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::RemoveSurface++");
 	if (iSurfaceId.IsNull())
 		{
 		return KErrNotFound;
@@ -1209,6 +1295,7 @@
 
 	iSurfaceId = TSurfaceId::CreateNullId();
 	
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::RemoveSurface-- - Error %d", error);
 	return error;
 	}
 	
@@ -1402,7 +1489,14 @@
 							RWindow& aWindow, const TRect& aVideoExtent, 
 							const TRect& aWindowClipRect)
 	{
-	// set window and get display ID for the window
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::AddDisplayWindowL++");
+    DEBUG_PRINTF4("CVideoPlayerUtility::CBody::AddDisplayWindowL - aScreenDevice num %d, width %d, height %d", aScreenDevice.GetScreenNumber(), aScreenDevice.SizeInPixels().iWidth, aScreenDevice.SizeInPixels().iHeight);
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::AddDisplayWindowL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::AddDisplayWindowL - aWindow abs pos %d,%d - width %d, height %d", aWindow.AbsPosition().iX, aWindow.AbsPosition().iY, aWindow.Size().iWidth, aWindow.Size().iHeight);
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::AddDisplayWindowL - aVideoExtent %d,%d - %d,%d", aVideoExtent.iTl.iX, aVideoExtent.iTl.iY, aVideoExtent.iBr.iX, aVideoExtent.iBr.iY);
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::AddDisplayWindowL - aWindowClipRect %d,%d - %d,%d", aWindowClipRect.iTl.iX, aWindowClipRect.iTl.iY, aWindowClipRect.iBr.iX, aWindowClipRect.iBr.iY);
+
+    // set window and get display ID for the window
 	TRect windowRect = TRect(aWindow.Size()); 
 	
 	// Check the rectangle is contained completely within the window
@@ -1415,11 +1509,19 @@
 		}
 		
 	DoAddDisplayWindowL(aWs, aScreenDevice.GetScreenNumber(), aWindow, aWindowClipRect, aVideoExtent, &aWindow);
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::AddDisplayWindowL--");
 	}
 	
 void CVideoPlayerUtility::CBody::AddDisplayWindowL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindow& aWindow)
 	{
-	DoAddDisplayWindowL(aWs, aScreenDevice.GetScreenNumber(), aWindow, TRect(aWindow.Size()), TRect(aWindow.Size()), &aWindow);
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::AddDisplayWindowL++");
+    DEBUG_PRINTF4("CVideoPlayerUtility::CBody::AddDisplayWindowL - aScreenDevice num %d, width %d, height %d", aScreenDevice.GetScreenNumber(), aScreenDevice.SizeInPixels().iWidth, aScreenDevice.SizeInPixels().iHeight);
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::AddDisplayWindowL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::AddDisplayWindowL - aWindow abs pos %d,%d - width %d, height %d", aWindow.AbsPosition().iX, aWindow.AbsPosition().iY, aWindow.Size().iWidth, aWindow.Size().iHeight);
+
+    DoAddDisplayWindowL(aWs, aScreenDevice.GetScreenNumber(), aWindow, TRect(aWindow.Size()), TRect(aWindow.Size()), &aWindow);
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::AddDisplayWindowL--");
 	}
 
 void CVideoPlayerUtility::CBody::DoAddDisplayWindowL(RWsSession& aWs, TInt aDisplayId, RWindowBase& aWindow,
@@ -1450,11 +1552,11 @@
 		{
 		if(iSurfaceId.IsNull())
 			{
-			display = CMediaClientVideoDisplayBody::NewL(aDisplayId);
+			display = CMediaClientVideoDisplayBody::NewL(aDisplayId, ETrue);
 			}
 		else
 			{
-			display = CMediaClientVideoDisplayBody::NewL(aDisplayId, iSurfaceId, iSurfaceCropRect, iAspectRatio);
+			display = CMediaClientVideoDisplayBody::NewL(aDisplayId, iSurfaceId, iSurfaceCropRect, iAspectRatio, ETrue);
 			}
 		CleanupStack::PushL(display);
 		iActiveDisplays.InsertInOrderL(display, CMediaClientVideoDisplayBody::Compare);
@@ -1485,7 +1587,10 @@
 
 void CVideoPlayerUtility::CBody::RemoveDisplayWindow(RWindowBase& aWindow)
 	{
-	CMediaClientVideoDisplayBody* display = NULL;
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::RemoveDisplayWindow++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::RemoveDisplayWindow - aWindow WsHandle 0x%X", aWindow.WsHandle());
+
+    CMediaClientVideoDisplayBody* display = NULL;
 	TRAPD(err, display = CMediaClientVideoDisplayBody::FindDisplayWithWindowL(iActiveDisplays, aWindow));
 	
 	if (err == KErrNone)
@@ -1508,10 +1613,13 @@
 			}
 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
 		}	
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::RemoveDisplayWindow--");
 	}
 
 void CVideoPlayerUtility::CBody::AddDisplayL(TInt aDisplay, MMMFSurfaceEventHandler& aEventHandler)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::AddDisplayL");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::AddDisplayL - aDisplay %d", aDisplay);
 	if (!iControllerOpen)
 		{
 		User::Leave(KErrNotReady);
@@ -1524,11 +1632,11 @@
 		CMediaClientVideoDisplayBody* display;
 		if(iSurfaceId.IsNull())
 			{
-			display = CMediaClientVideoDisplayBody::NewL(aDisplay);
+			display = CMediaClientVideoDisplayBody::NewL(aDisplay, ETrue);
 			}
 		else
 			{
-			display = CMediaClientVideoDisplayBody::NewL(aDisplay, iSurfaceId, iSurfaceCropRect, iAspectRatio);
+			display = CMediaClientVideoDisplayBody::NewL(aDisplay, iSurfaceId, iSurfaceCropRect, iAspectRatio, ETrue);
 			}
 		CleanupStack::PushL(display);
 		iActiveDisplays.InsertInOrderL(display, CMediaClientVideoDisplayBody::Compare);
@@ -1540,10 +1648,13 @@
 		User::LeaveIfError(err);
 		iActiveDisplays[err]->AddDisplayL(aEventHandler);
 		}
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::AddDisplayL--");
 	}
 
 void CVideoPlayerUtility::CBody::RemoveDisplay(TInt aDisplay)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::RemoveDisplay++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::RemoveDisplay - aDisplay %d", aDisplay);
 	TInt pos = iActiveDisplays.FindInOrder(aDisplay, CMediaClientVideoDisplayBody::CompareByDisplay);
 	
 	if (pos >= KErrNone)
@@ -1557,6 +1668,7 @@
 			delete disp;
 			}
 		}
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::RemoveDisplay--");
 	}
 
 void CVideoPlayerUtility::CBody::ConvertFromRelativeToDisplayToRelativeToWindow(
@@ -1566,6 +1678,7 @@
             TRect& aToWindowRect,
             TRect& aToClipRect)
     {
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::ConvertFromRelativeToDisplayToRelativeToWindow++");
     TPoint windowOrigin = aWindow.AbsPosition();
     
     // window rect
@@ -1579,11 +1692,19 @@
     aToClipRect.iTl.iY = aFromClipRect.iTl.iY - windowOrigin.iY;
     aToClipRect.iBr.iX = aFromClipRect.iBr.iX - windowOrigin.iX;
     aToClipRect.iBr.iY = aFromClipRect.iBr.iY - windowOrigin.iY;
+
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::ConvertFromRelativeToDisplayToRelativeToWindow - New Window rect %d,%d - %d,%d", aToWindowRect.iTl.iX, aToWindowRect.iTl.iY, aToWindowRect.iBr.iX, aToWindowRect.iBr.iY);
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::ConvertFromRelativeToDisplayToRelativeToWindow - New Clip rect %d,%d - %d,%d", aToClipRect.iTl.iX, aToClipRect.iTl.iY, aToClipRect.iBr.iX, aToClipRect.iBr.iY);
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::ConvertFromRelativeToDisplayToRelativeToWindow--");
     }
 
 void CVideoPlayerUtility::CBody::SetVideoExtentL(const RWindowBase& aWindow, const TRect& aVideoExtent)
 	{
-	// check opening the source is complete and the client has been recieved an MvpuoOpenComplete() callback
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetVideoExtentL++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetVideoExtentL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::SetVideoExtentL - aVideoExtent %d,%d - %d,%d", aVideoExtent.iTl.iX, aVideoExtent.iTl.iY, aVideoExtent.iBr.iX, aVideoExtent.iBr.iY);
+
+    // check opening the source is complete and the client has been recieved an MvpuoOpenComplete() callback
 	if (!iControllerOpen)
 		{
 		User::Leave(KErrNotReady);
@@ -1591,10 +1712,16 @@
 		
 	CMediaClientVideoDisplayBody* display = CMediaClientVideoDisplayBody::FindDisplayWithWindowL(iActiveDisplays, aWindow);
 	display->SetVideoExtentL(aWindow, aVideoExtent, iCropRegion);
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetVideoExtentL--");
 	}
 
 void CVideoPlayerUtility::CBody::SetWindowClipRectL(const RWindowBase& aWindow, const TRect& aWindowClipRect)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetWindowClipRectL++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetWindowClipRectL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF5("CVideoPlayerUtility::CBody::SetWindowClipRectL - aWindowClipRect %d,%d - %d,%d", aWindowClipRect.iTl.iX, aWindowClipRect.iTl.iY, aWindowClipRect.iBr.iX, aWindowClipRect.iBr.iY);
+
     // check opening the source is complete and the client has been recieved an MvpuoOpenComplete() callback
 	if (!iControllerOpen)
 		{
@@ -1623,6 +1750,8 @@
 #else
 	display->SetWindowClipRectL(aWindow, aWindowClipRect, iCropRegion);
 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetWindowClipRectL--");
 	}
 
 // Check if the controller supports the graphics surface. Has to be called after resource opened.
@@ -1658,18 +1787,28 @@
 	
 void CVideoPlayerUtility::CBody::SetAutoScaleL(const RWindowBase& aWindow, TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos)
 	{
-	if (!iControllerOpen)
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetAutoScaleL++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetAutoScaleL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF4("CVideoPlayerUtility::CBody::SetAutoScaleL - aScaleType %d, aHorizPos %d, aVertPos %d", aScaleType, aHorizPos, aVertPos);
+
+    if (!iControllerOpen)
 		{
 		User::Leave(KErrNotReady);
 		}
 		
 	CMediaClientVideoDisplayBody* display = CMediaClientVideoDisplayBody::FindDisplayWithWindowL(iActiveDisplays, aWindow);
 	display->SetAutoScaleL(aWindow, aScaleType, aHorizPos, aVertPos, iCropRegion);
+
+	DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetAutoScaleL--");
 	}
 
 void CVideoPlayerUtility::CBody::SetRotationL(const RWindowBase& aWindow, TVideoRotation aRotation)
 	{
-	if (!iControllerOpen)
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetRotationL++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetRotationL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetRotationL - aRotation %d", aRotation);
+
+    if (!iControllerOpen)
 		{
 		User::Leave(KErrNotReady);
 		}
@@ -1688,6 +1827,7 @@
 #else
 	display->SetRotationL(aWindow, aRotation, iCropRegion);
 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetRotationL--");
 	}
 	
 TVideoRotation CVideoPlayerUtility::CBody::RotationL(const RWindowBase& aWindow) const
@@ -1702,6 +1842,9 @@
 	
 void CVideoPlayerUtility::CBody::SetScaleFactorL(const RWindowBase& aWindow, TReal32 aWidthPercentage, TReal32 aHeightPercentage)
 	{
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetScaleFactorL++");
+    DEBUG_PRINTF2("CVideoPlayerUtility::CBody::SetScaleFactorL - aWindow WsHandle 0x%X", aWindow.WsHandle());
+    DEBUG_PRINTF3("CVideoPlayerUtility::CBody::SetScaleFactorL - aWidthPercentage %f, aHeightPercentage %f", aWidthPercentage, aHeightPercentage);
 	if (!iControllerOpen)
 		{
 		User::Leave(KErrNotReady);
@@ -1709,6 +1852,7 @@
 		}
 	CMediaClientVideoDisplayBody* display = CMediaClientVideoDisplayBody::FindDisplayWithWindowL(iActiveDisplays, aWindow);
 	display->SetScaleFactorL(aWindow, aWidthPercentage, aHeightPercentage, iCropRegion);
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetScaleFactorL--");
 	}
 	
 void CVideoPlayerUtility::CBody::GetScaleFactorL(const RWindowBase& aWindow, TReal32& aWidthPercentage, TReal32& aHeightPercentage) const
@@ -1852,7 +1996,10 @@
 	}
 void CVideoPlayerUtility::CBody::SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos)
 	{
-	// Leave if Open is not yet called.
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetAutoScaleL++");
+    DEBUG_PRINTF4("CVideoPlayerUtility::CBody::SetAutoScaleL - aScaleType %d, aHorizPos %d, aVertPos %d", aScaleType, aHorizPos, aVertPos);
+
+    // Leave if Open is not yet called.
 	if(!iEventOpenReceived )
 		{
 		User::Leave(KErrNotReady);
@@ -1882,6 +2029,7 @@
 #else
 	User::LeaveIfError(iVideoPlayControllerExtCustomCommands.SetAutoScale(aScaleType, aHorizPos, aVertPos));
 #endif // SYMBIAN_BUILD_GCE
+    DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetAutoScaleL--");
 	}
 
 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
--- a/mmlibs/mmfw/src/Plugin/StdSourceAndSink/Mmffile.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/src/Plugin/StdSourceAndSink/Mmffile.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -1032,7 +1032,10 @@
 			fileOpened = ETrue;
 		}
 	if (err == KErrNone)
+	    {
+	    __ASSERT_DEBUG(iFile != NULL,Panic(EMMFFileHandleNULL));
 		err = iFile->Size(size);
+	    }
 	if (err)
 		{
 		size = 0;
@@ -1043,6 +1046,7 @@
 
 	if (fileOpened)
 		{
+		__ASSERT_DEBUG(iFile != NULL,Panic(EMMFFileHandleNULL));
 		delete iFile;
 		iFile = NULL;
 		iFileSize = -1;
--- a/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/TestRecorder.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/TestRecorder.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -1286,10 +1286,10 @@
 
 		if (iError != KErrOverflow)
 			{
-			ERR_PRINTF2( _L("CMdaAudioRecorderUtility failed with error %d"),iError );
-			CleanupStack::PopAndDestroy(recUtil);	
-			User::After(KOneSecond);
-			return ret;
+            ERR_PRINTF2( _L("CMdaAudioRecorderUtility failed with error %d"),iError );
+            CleanupStack::PopAndDestroy(recUtil);	
+            User::After(KOneSecond);
+            return ret;
 			}
 
 		TInt expectedLength=0;
@@ -1376,6 +1376,29 @@
 			else
 				{
 				INFO_PRINTF3(_L("Expected length %d, actual length %d"), expectedLength, actualLength);
+				
+				TInt machineType;
+	            TInt err = HAL::Get(HALData::EMachineUid, machineType);
+	            if (err)
+	                {
+				    ERR_PRINTF1(_L("Error Getting Device information"));
+				    iTestStepResult = EFail;
+				    CActiveScheduler::Stop();
+				    }
+	            else
+	                {
+                    if ((machineType == 0x102864F7) && (sampleRate == 8000))
+                        {
+                            // If test is running on a NaviEngine and uses 8K sample rate
+                            // then apply a tollerance when checking duration as we will
+                            // have applied conversion function.
+                            if ((iAudio->Length() >= expectedLength - 1000) &&
+                                 (iAudio->Length() <= expectedLength + 1000))
+                                {
+                                ret = EPass;
+                                }
+                        }
+	                }
 				}
 			}
 		else
--- a/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/inc/TSU_MMF_DEVSOUND_STEP.h	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/inc/TSU_MMF_DEVSOUND_STEP.h	Fri Apr 16 16:34:49 2010 +0300
@@ -1529,6 +1529,7 @@
 _LIT(KRecordDataFollowingResume, "RecordDataFollowingResume");
 _LIT(KRecordDataPriorToResume, "RecordDataPriorToResume");
 _LIT(KCheckForNoDataAfterResume, "CheckForNoDataAfterResume");
+_LIT(KCallResumeAfterResume, "CallResumeAfterResume ");
 
 enum TPanicCodes
 	{
@@ -1806,6 +1807,7 @@
 	TBool iRecordDataPriorToResume;
 	TBool iCheckForNoDataAfterResume;
 	TBool iInitAfterPauseClause;
+	TBool iResumeAfterResume;
 	};
 
 /*
--- a/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/scripts/tsu_mmf_devsound_suite_truepause.script	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/scripts/tsu_mmf_devsound_suite_truepause.script	Fri Apr 16 16:34:49 2010 +0300
@@ -256,6 +256,32 @@
 RUN_TEST_STEP 60000, TSU_MMF_DEVSOUND_SUITE, MM-MMF-DEVSOUND-U-0088-HP, c:\tsu_mmf_truepause_devsound.ini MM-MMF-DEVSOUND-U-0288-HP 
 TEST_COMPLETE
 
+//! @SYMTestCaseID			MM-MMF-DEVSOUND-U-0388-HP
+//! @SYMREQ				REQ11453
+//!					REQ11455
+//! @SYMPREQ				1540
+//! @SYMTestCaseDec			Resume Record audio - Pause and resume for PCM.
+//! @SYMTestPriority			Normal
+//! @SYMTestType			Negative Usecase
+//! @SYMTestActions			1. Create a Devsound instance.
+//!					2. Create a CPeriodic instance.
+//!					3. Open the audio files to be recorded and initialize the Devsound instance to record audio(PCM).
+//!					3.1 Wait for InitializeComplete(KErrNone) callback response.
+//!					4. Start the CPeriodic instance.
+//!					5. Call RecodInitL() to start the recording process.
+//!					6. Wait for BufferToBeEmptied(..) callback to retrieve the buffered data from DevSound. To continue receiving BTBE callbacks, is mandatory to call RecordData() method.
+//!					7. On the CPeriodic timer event, use Pause() to temporarily stop the record process.
+//!					7.1  Continue RecordData()/BufferToBeEmptied() loop until last buffer flag is set. 
+//!					8. After last buffer is received, call IsResumeSupported(), and Resume() an then Resume() again
+//!					9. On timer event (2s) we should not have received any buffers - if we get a buffer in this time, that is an error
+//!					10. Close file session.	
+//! @SYMTestExpectedResults		IsResumeSupported() will return ETrue.
+//!					Resume()(will return KErrNone) is supported for PCM.
+//!					Output is recorded at c:\mm\mmf\testfiles\truepause_devsound_test_data\record_1.raw
+PRINT Resume Record audio - Pause and resume for PCM.
+RUN_TEST_STEP 60000, TSU_MMF_DEVSOUND_SUITE, MM-MMF-DEVSOUND-U-0088-HP, c:\tsu_mmf_truepause_devsound.ini MM-MMF-DEVSOUND-U-0388-HP 
+TEST_COMPLETE
+
 //! @SYMTestCaseID			MM-MMF-DEVSOUND-U-0089-HP
 //! @SYMREQ				REQ11453
 //!					REQ11455
--- a/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/scripts/tsu_mmf_truepause_devsound.ini	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/scripts/tsu_mmf_truepause_devsound.ini	Fri Apr 16 16:34:49 2010 +0300
@@ -41,6 +41,7 @@
 RecordDataFollowingResume = true
 RecordDataPriorToResume = false
 CheckForNoDataAfterResume = false
+CallResumeAfterResume = false
 
 [MM-MMF-DEVSOUND-U-0188-HP]
 Duration = 4
@@ -49,6 +50,7 @@
 RecordDataFollowingResume = false
 RecordDataPriorToResume = true
 CheckForNoDataAfterResume = false
+CallResumeAfterResume = false
 
 [MM-MMF-DEVSOUND-U-0288-HP]
 Duration = 4
@@ -57,6 +59,16 @@
 RecordDataFollowingResume = false
 RecordDataPriorToResume = false
 CheckForNoDataAfterResume = true
+CallResumeAfterResume = false
+
+[MM-MMF-DEVSOUND-U-0388-HP]
+Duration = 4
+Filename = c:\mm\mmf\testfiles\truepause_devsound_test_data\record_1.raw
+FourccCode = P16
+RecordDataFollowingResume = false
+RecordDataPriorToResume = false
+CheckForNoDataAfterResume = true
+CallResumeAfterResume = true
 
 [MM-MMF-DEVSOUND-U-0089-HP]
 Duration = 4
@@ -127,6 +139,7 @@
 RecordDataFollowingResume = true
 RecordDataPriorToResume = false
 CheckForNoDataAfterResume = false
+CallResumeAfterResume = false
 
 [MM-MMF-DEVSOUND-U-0199-HP]
 Filename = c:\mm\mmf\testfiles\truepause_devsound_test_data\cerrodelasilla.raw
--- a/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/src/TSU_MMF_DEVSOUND_STEP.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/src/TSU_MMF_DEVSOUND_STEP.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -8815,6 +8815,7 @@
     iRecordDataPriorToResume = EFalse;
     iCheckForNoDataAfterResume = EFalse;
     iInitAfterPauseClause = EFalse;
+    iResumeAfterResume = EFalse;
     }
 
 RA3FDevSoundTestRecord::~RA3FDevSoundTestRecord()
@@ -9111,7 +9112,11 @@
 						    INFO_PRINTF1(_L("Calling CMMFDevSound::Resume()"));
 						    err = iMMFDevSound->Resume();
 						    }
-						
+						if(iResumeAfterResume)
+						    {
+						    INFO_PRINTF1(_L("Calling CMMFDevSound::Resume()"));
+						    err = iMMFDevSound->Resume();
+						    }
 						if (iTestStepName != _L("MM-MMF-DEVSOUND-U-0088-HP"))
 						    {
 						    INFO_PRINTF1(_L("Calling CMMFDevSound::RecordData()"));
@@ -10238,6 +10243,12 @@
         StopTest(KErrNotFound, ETestSuiteError);
         return;     
         }
+    if ( !GetBoolFromConfig(iDefaultParamSet, KCallResumeAfterResume, iResumeAfterResume) )
+        {
+        ERR_PRINTF2(KMsgErrorGetParameter, &KCallResumeAfterResume);
+        StopTest(KErrNotFound, ETestSuiteError);
+        return;     
+        }
     if ( !GetBoolFromConfig(iDefaultParamSet, KCheckForNoDataAfterResume, iCheckForNoDataAfterResume) )
         {
         ERR_PRINTF2(KMsgErrorGetParameter, &KCheckForNoDataAfterResume);
@@ -11387,6 +11398,12 @@
         StopTest(KErrNotFound, ETestSuiteError);
         return;     
         }
+    if ( !GetBoolFromConfig(iDefaultParamSet, KCallResumeAfterResume, iResumeAfterResume) )
+        {
+        ERR_PRINTF2(KMsgErrorGetParameter, &KCallResumeAfterResume);
+        StopTest(KErrNotFound, ETestSuiteError);
+        return;     
+        }
     if ( !GetBoolFromConfig(iDefaultParamSet, KCheckForNoDataAfterResume, iCheckForNoDataAfterResume) )
         {
         ERR_PRINTF2(KMsgErrorGetParameter, &KCheckForNoDataAfterResume);
@@ -11468,3 +11485,6 @@
     iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
     }
 
+
+
+
--- a/mmlibs/mmfw/tsrc/mmfunittest/MmpFiles/TSU_MMF_VCLNT_01.mmp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/MmpFiles/TSU_MMF_VCLNT_01.mmp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 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"
@@ -49,6 +49,7 @@
 source			../../../../src/Client/Video/mmfclientvideoplayer2.cpp
 source			../../../../src/Client/Video/mediaclientvideodisplaybody.cpp
 source			../../../../src/Client/Video/mediaclientextdisplayinterface.cpp
+source			../../../../src/Client/Video/mediaclientextdisplayhandler.cpp
 source			teststepvidplayereventhandler.cpp
 #endif
 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
--- a/mmlibs/mmfw/tsrc/mmfunittest/VCLNT/TSU_MMF_VCLNT_01/TestStepUnitMMFVidClient.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/VCLNT/TSU_MMF_VCLNT_01/TestStepUnitMMFVidClient.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 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"
@@ -538,7 +538,7 @@
 
 	if (iVpu2)
 		{
-		aRect = iPlayer2->iBody->iActiveDisplays[0]->iWindows[0].iClipRect;
+		aRect = (*(iPlayer2->iBody->iActiveDisplays[0]->iWindowsArrayPtr))[0].iClipRect;
 		}
 #endif	
 	return KErrNone;
@@ -569,7 +569,7 @@
 
 	if (iVpu2)
 		{
-		aRect = iPlayer2->iBody->iActiveDisplays[0]->iWindows[0].iVideoExtent;
+		aRect = (*(iPlayer2->iBody->iActiveDisplays[0]->iWindowsArrayPtr))[0].iVideoExtent;
 		}
 #endif	
 	return KErrNone;
--- a/mmlibs/mmfw/tsrc/mmfunittest/aclnt/TSU_MMF_ACLNT_01/TestStepAudInStream.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/aclnt/TSU_MMF_ACLNT_01/TestStepAudInStream.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -135,7 +135,9 @@
 	{
 	// Issue reads on all available buffers
 	for (TInt ii=0; ii<KRecNumBuffer; ii++)
+	    {
 		iAudInStream->ReadL(iBufferList[ii]);
+	    }
 	}
 
 CTestStepAudInStream::CWriteBufferActive::CWriteBufferActive() : CActive(0)
@@ -1166,10 +1168,12 @@
 
 	TInt err = KErrNone;
 	TRAP(err, iAudInStream->SetDataTypeL(iTestParameters->iEncoding));
+
 	if (err != KErrNone)
 		 return EInconclusive;
 
 	iAudInStream->Open(NULL);
+	
 	CActiveScheduler::Start();
 
 	if (iError != KErrNone)
@@ -1217,7 +1221,7 @@
 	StartReadL();
 
 	CCallBackTimer* timer  = CCallBackTimer::NewL(TCallBack(stopActiveScheduler));
-	timer->After(5000000); // 3s
+	timer->After(5000000); // 5s
 	CActiveScheduler::Start();
 	delete timer;
 	if (iError != KErrNone)
@@ -1232,6 +1236,7 @@
 	CMdaAudioOutputStream* outputStream = CMdaAudioOutputStream::NewL(*this);
 	CleanupStack::PushL(outputStream);
 	TRAPD(err, outputStream->SetDataTypeL(iTestParameters->iEncoding));
+	
 	if (err != KErrNone)
 		{
 		CleanupStack::PopAndDestroy(1, outputStream);
@@ -1239,9 +1244,12 @@
 		}
 	outputStream->Open(NULL);
 	outputStream->SetVolume(outputStream->MaxVolume());
+
 	CActiveScheduler::Start(); // wait for open to complete
 	TInt size = 0;
+
 	User::LeaveIfError(iFile.Size(size));
+
 	// Read the entire file into a buffer - bit naughty but OK for test code
 	INFO_PRINTF2(_L("HBufC8:NewLC(size):  size=%d"), size);
 	HBufC8* buffer = HBufC8::NewLC(size);
--- a/mmlibs/mmfw/tsrc/mmfunittest/aclnt/TSU_MMF_ACLNT_01/TestStepPlayerPlay.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/aclnt/TSU_MMF_ACLNT_01/TestStepPlayerPlay.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -142,7 +142,7 @@
 	CleanupClosePushL(fs);
 	
 	RFile temp;
-	temp.Open(fs, iFileName, EFileRead|EFileWrite|EFileShareAny);
+	temp.Open(fs, iFileName, EFileRead|EFileWrite|EFileShareReadersOnly);
 	CleanupClosePushL(temp);
 	
     iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
--- a/mmlibs/mmfw/tsrc/mmfunittest/ctlfrm/mp3/MmfMP3Format/101F7D99.rss	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmfw/tsrc/mmfunittest/ctlfrm/mp3/MmfMP3Format/101F7D99.rss	Fri Apr 16 16:34:49 2010 +0300
@@ -33,13 +33,8 @@
 					implementation_uid = KUidMP3ImplementationFormat;  
 					version_no = 1;
 					display_name = "MP3 Raw Read Format||Copyright 2003 Symbian Ltd. All Rights Reserved.||";
-#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
-					// KMmfUidPlayerAudioImplementationMp3 = 0x10272914 from PV
-					default_data = "0x10272914"; //Preferred Controller
-#else
 					// KMmfUidControllerAudio = 0x101F5022
 					default_data = "0x101f5022"; //Preferred Controller
-#endif
 					// KUidMediaTypeAudio = 0x101F5D07
 					// match by extension only
 					opaque_data = "<s>Symbian<i>0x101f5d07<e>.mp3<m>audio/mp3<m>audio/x-mp3";
@@ -56,15 +51,8 @@
 					implementation_uid = KUidMP3ImplementationFormatID3;
 					version_no = 1;
 					display_name = "MP3 ID3 Read Format||Copyright 2003 Symbian Ltd. All Rights Reserved.||";
-
-#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
-					// KMmfUidPlayerAudioImplementationMp3 = 0x10272914 from PV
-					default_data = "0x10272914"; //Preferred Controller
-#else
 					// KMmfUidControllerAudio = 0x101F5022
 					default_data = "0x101f5022"; //Preferred Controller
-#endif
-
 					// match by ID3 header & extension
 					opaque_data = "<s>Symbian<i>0x101f5d07<e>.mp3<h>ID3?????????<m>audio/mp3<m>audio/x-mp3";
 					}
--- a/mmlibs/mmutilitylib/group/multimedia_common.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmlibs/mmutilitylib/group/multimedia_common.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_common.mrp
 #
-#Copyright (c) 2005-2009 Symbian Ltd.  All rights reserved.
+# Copyright (c) 2005-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	multimedia_common
--- a/mmplugins/lib3gp/group/multimedia_3gplibrary.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmplugins/lib3gp/group/multimedia_3gplibrary.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_3gplibrary.mrp
 #
-#Copyright (c) Symbian Software Ltd 2009.  All rights reserved.
+# 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	multimedia_3gplibrary
--- a/mmplugins/lib3gp/impl/src/file.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmplugins/lib3gp/impl/src/file.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -119,7 +119,6 @@
     // for compatibility, if opening in Any mode fails try more restrictive approach.
     if (file->Open(*fs, TPtrC((const TUint16 *)filename), EFileRead | EFileShareReadersOnly) != KErrNone)
     {
-        fs->Close();
         return -1;
     }
   }
@@ -183,7 +182,6 @@
 
   if (file->Replace(*fs, TPtrC((const TUint16 *)filename), EFileWrite|EFileShareExclusive ) != KErrNone)
   {
-    fs->Close();
     return -1;
   }
 
--- a/mmresourcemgmt/mmresctrl/group/multimedia_a3f_refmmrc.mrp	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmresourcemgmt/mmresctrl/group/multimedia_a3f_refmmrc.mrp	Fri Apr 16 16:34:49 2010 +0300
@@ -1,6 +1,17 @@
-#multimedia_a3f_refmmrc.mrp
 #
-#Copyright (c) Symbian Software Ltd 2007.  All rights reserved.
+# Copyright (c) 2007 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	multimedia_a3f_refmmrc
--- a/mmtestenv/mmtesttools/Build/buildutils/mmbuild2.py	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmtestenv/mmtesttools/Build/buildutils/mmbuild2.py	Fri Apr 16 16:34:49 2010 +0300
@@ -151,14 +151,16 @@
         commands += ["--logfile=-"] # send output to stdout
         if self.iOptions.keepgoing:
             commands += ["--keepgoing"]
-        if len(remainingArgs)>0 and remainingArgs[0]=="winscw":
+        if testBuild:
+            commands += ["--config=winscw.test"]
+        else:
+            commands += ["--config=winscw"]
+        if not(len(remainingArgs)>0 and remainingArgs[0]=="winscw"):
+            # not the winscw scenario - we want both winscw and armv5
             if testBuild:
-                commands += ["--config=winscw.test"]
+                commands += ["--config=armv5.test"]
             else:
-                commands += ["--config=winscw"]
-        else:
-            if testBuild:
-               commands += ["--config=default.test"]
+                commands += ["--config=armv5"]
         commands += ["--filters=FilterSquashLog"] # reduce log size
         commands += ["--tries=2"] # retry on failure - e.g. for license fails
         commands += ["build"]
--- a/mmtestenv/mmtesttools/Build/mmbuildrom.pl	Tue Feb 02 01:56:55 2010 +0200
+++ b/mmtestenv/mmtesttools/Build/mmbuildrom.pl	Fri Apr 16 16:34:49 2010 +0300
@@ -336,7 +336,8 @@
 	if($uni ne "")
 		{
 		#Use Flexible Memory Model for UniCore
-		$command .= " -DWITH_FLEXIBLE_MM";
+		#Until base have fixed the issue related to this keep commented out.
+		#$command .= " -DWITH_FLEXIBLE_MM";
 		}
 	
 	$command .= " -D_NAND2" if ($nand ne "" && $arm ne "");
--- a/video/ARM_MDF_Decoders/Utilities/BufferProcessor/src/BaseEngineImplementation.cpp	Tue Feb 02 01:56:55 2010 +0200
+++ b/video/ARM_MDF_Decoders/Utilities/BufferProcessor/src/BaseEngineImplementation.cpp	Fri Apr 16 16:34:49 2010 +0300
@@ -282,4 +282,6 @@
 	    }
 	
 	return iEngineHandle->FetchInputBuffer();
-	}
\ No newline at end of file
+	}
+	
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/video/ARM_MDF_Decoders/Utilities/group/bld.inf	Fri Apr 16 16:34:49 2010 +0300
@@ -0,0 +1,33 @@
+// BLD.INF
+/*
+* Copyright (c) 2007 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:  
+*
+*/
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+// Buffer Processor related
+#include "../BufferProcessor/group/bld.inf"
+
+// State Machine related
+#include "../StateMachine/group/bld.inf"
+
+//-----------------------------------------------------------------------------
+//  End of BLD.INF
+//-----------------------------------------------------------------------------