Revision: 201029 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 19 Aug 2010 09:57:36 +0300
branchRCL_3
changeset 23 890b5dd735f8
parent 22 f544d10663bf
child 24 f15ac8e65a02
Revision: 201029 Kit: 201033
vtengines/videoteleng/Inc/Media/CVtEngMediaHandler.h
vtengines/videoteleng/Src/Base/CVtEngDeviceLockMonitor.cpp
vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp
vtprotocolplugins/VideoSource/inc/cmultiframeprovider.h
vtprotocolplugins/VideoSource/src/cmultiframedataao.cpp
vtprotocolplugins/VideoSource/src/cmultiframeprovider.cpp
vtuis/videotelui/inc/CVtUiAppUi.h
vtuis/videotelui/inc/CVtUiEndCallButtonPane.h
vtuis/videotelui/src/CVtUiAppUi.cpp
vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp
vtuis/videotelui/src/CVtUiRemoteVideoControl.cpp
vtuis/videotelui/src/commands/cvtuiprimarycmdpolicy.cpp
vtuis/videotelui/src/tvtuistaterunning.cpp
--- a/vtengines/videoteleng/Inc/Media/CVtEngMediaHandler.h	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtengines/videoteleng/Inc/Media/CVtEngMediaHandler.h	Thu Aug 19 09:57:36 2010 +0300
@@ -1067,7 +1067,7 @@
             * @param aSetPeer ETrue if peer video quality needs to be set,
             * EFalse otherwise.
             */
-            void SettingVideoQuality( TInt aId, const TVideoQuality aValue,
+            void SettingVideoQualityL( TInt aId, const TVideoQuality aValue,
                 TBool aSetPeer );
 
             /**
--- a/vtengines/videoteleng/Src/Base/CVtEngDeviceLockMonitor.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtengines/videoteleng/Src/Base/CVtEngDeviceLockMonitor.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -58,20 +58,20 @@
 
     TInt state = EAutolockStatusUninitialized;
 
-	// Get autolock state
-	TInt err = iAutolockListener->Get( state );
+    // Get autolock state
+    TInt err = iAutolockListener->Get( state );
 
-	__VTPRINT2( DEBUG_GEN, "LockMonitor Get err: %d", err );
-	__VTPRINT2( DEBUG_GEN, "LockMonitor state: %d", state );
-
-	if( err == KErrNone )
+    __VTPRINT2( DEBUG_GEN, "LockMonitor Get err: %d", err );
+    __VTPRINT2( DEBUG_GEN, "LockMonitor state: %d", state );
+      
+    // Recognize the uninitialized state as autolock on, or the VT will be wrongly shown when startup & lock is on.
+    if( err == KErrNone )
 		{
 		const TInt event =
-        ( state <= EAutolockOff ) ?
+        ( state == EAutolockOff ) ?
                 KVtEngDeviceLockOff : KVtEngDeviceLockOn;
-        CVtEngEventManager::NotifyEvent( event );
-        }		
-			
+    CVtEngEventManager::NotifyEvent( event );
+    }	
     __VTPRINTEXIT( "LockMonitor.NotifyState" )
     }
 
--- a/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -3865,7 +3865,7 @@
     TInt protoOperId( iH263Encoder->SetVideoFrameRate(
         iVideoQuality.ToFrameRate( aVideoQuality ) ) );
     AddOperation( ESetVideoQuality, protoOperId );
-    iVideoQuality.SettingVideoQuality( protoOperId,
+    iVideoQuality.SettingVideoQualityL( protoOperId,
         aVideoQuality, aSetPeerVideoQuality );
     __VTPRINTEXIT( "MH.SetVideoQualityL" )
     }
@@ -4222,7 +4222,7 @@
 // CVtEngMediaHandler::TVtEngVideoQuality::SettingVideoQuality
 // -----------------------------------------------------------------------------
 //
-void CVtEngMediaHandler::TVtEngVideoQuality::SettingVideoQuality(
+void CVtEngMediaHandler::TVtEngVideoQuality::SettingVideoQualityL(
     TInt aId, const TVideoQuality aValue, TBool aSetPeer )
     {
     __VTPRINTENTER( "MH.VQ.SettingVideoQuality" )
--- a/vtprotocolplugins/VideoSource/inc/cmultiframeprovider.h	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtprotocolplugins/VideoSource/inc/cmultiframeprovider.h	Thu Aug 19 09:57:36 2010 +0300
@@ -156,7 +156,7 @@
 				/**
         * Adds used bitmap to free queue
         */
-				void AddBitmapToFreeQueue();
+				void AddBitmapToFreeQueueL();
 				
 				/**
         * Indicates that second VF buffer needs to be used
--- a/vtprotocolplugins/VideoSource/src/cmultiframedataao.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtprotocolplugins/VideoSource/src/cmultiframedataao.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -134,7 +134,7 @@
         }
     if ( !iVFUpdate )
         {	
-        iRequester->AddBitmapToFreeQueue();
+        iRequester->AddBitmapToFreeQueueL();
         }
     if ( !iInit && !iVFUpdate )  
         {				
--- a/vtprotocolplugins/VideoSource/src/cmultiframeprovider.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtprotocolplugins/VideoSource/src/cmultiframeprovider.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -623,10 +623,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// CMultiframeProvider::AddBitmapToFreeQueue( CVtImageBitmap* aBitmap )
+// CMultiframeProvider::AddBitmapToFreeQueueL( CVtImageBitmap* aBitmap )
 // -----------------------------------------------------------------------------
 //
-void CMultiframeProvider::AddBitmapToFreeQueue()
+void CMultiframeProvider::AddBitmapToFreeQueueL()
     {
     __IF_DEBUG(Print(_L("VideoSource[%d]: CMultiframeProvider::AddBitmapToFreeQueue() >>"), RThread().Id().operator TUint()));
     if ( iOldBM )
--- a/vtuis/videotelui/inc/CVtUiAppUi.h	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtuis/videotelui/inc/CVtUiAppUi.h	Thu Aug 19 09:57:36 2010 +0300
@@ -143,6 +143,11 @@
         * Refreshes blind flags.
         */
         void RefreshBlind();
+        
+        /**
+        * Enable end call button
+        */
+        void EnableEndCallButton();
 
         /**
         * Refreshes synchronisation.
@@ -1490,6 +1495,8 @@
         TInt iDelayedCmd;
         //disable video process
         TBool iDisableVideoOngoing;
+        //disable video process
+        TBool iShareImageOngoing;
     };
 
 #endif      // CVTUIAPPUI_H
--- a/vtuis/videotelui/inc/CVtUiEndCallButtonPane.h	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtuis/videotelui/inc/CVtUiEndCallButtonPane.h	Thu Aug 19 09:57:36 2010 +0300
@@ -84,6 +84,13 @@
          * Handles an event from an observed control.
          */
         void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
+        
+    public:
+        
+        /**
+         * Set end call button enabled or not.
+         */
+        void SetEnabled( TBool aEnabled );
     
     private:
     
--- a/vtuis/videotelui/src/CVtUiAppUi.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtuis/videotelui/src/CVtUiAppUi.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -221,7 +221,9 @@
     // Stop brightness and contrast slider
     EVtUiStopBrightnessOrContrast =         1 << 15,
     // refresh zoom popup
-    EVtUiRefreshZoomPopup =                           1 << 16
+    EVtUiRefreshZoomPopup =                 1 << 16,
+    // enable end call button
+    EVtUiEnableEndCallButton =              1 << 17
     };
 
 // Enumerates states for CVtUiActiveExec.
@@ -1227,6 +1229,15 @@
     }
 
 // -----------------------------------------------------------------------------
+// CVtUiAppUi::EnableEndCallButton
+// -----------------------------------------------------------------------------
+//
+void CVtUiAppUi::EnableEndCallButton()
+    {
+    EndCallButtonPane().SetEnabled( ETrue );
+    }
+
+// -----------------------------------------------------------------------------
 // CVtUiAppUi::OpenNumberEntryL
 // -----------------------------------------------------------------------------
 //
@@ -4613,6 +4624,12 @@
     MVtEngCommandHandler& command = Model().CommandHandler();
     const TInt caps = command.GetCommandCaps( aCommand );
 
+    if ( ( aCommand == KVtEngSetSource ||
+         aCommand == KVtEngHandleLayoutChange ) && ( caps & MVtEngCommandHandler::EAttribEnabled ) )
+        {
+        EndCallButtonPane().SetEnabled( EFalse );
+        }
+
     if ( caps >= KErrNone )
         {
         const TBool asynchronous =
@@ -5040,11 +5057,15 @@
     {
     __VTPRINTENTER( "VtUi.DoLayoutChg" )
     TInt error;
+    if( iUiStates->IsSelectingShare() )
+        {
+        iInstance->iRemoteVideoControl->MakeVisible( ETrue );
+        }
     // Fully update rendering parameters
     UpdateRenderingParametersL();
     // Notify engine about layout change
     iLayoutChg = ETrue;
-    if( iDisableVideoOngoing )
+    if( iDisableVideoOngoing || iShareImageOngoing )
         {
         error = KErrNotReady;
         }
@@ -5079,6 +5100,7 @@
                 pendingCommand  == KVtEngSetSource ||
                 pendingCommand  == KVtEngPrepareCamera ||
                 pendingCommand  == KVtEngUnfreeze ||
+                pendingCommand  == KVtEngStopShareImage ||
                 invalidCommand  == KVtEngHandleLayoutChange )
             {
             iPendingCmd = pendingCommand;
@@ -5089,6 +5111,11 @@
             iPendingCmd = KVtEngSetSource;
             iUiStates->SetLayoutChangeNeeded( ETrue );
             }
+        if( iShareImageOngoing && pendingCommand == KVtEngCommandNone )
+            {
+            iPendingCmd = KVtEngStartShareImage;
+            iUiStates->SetLayoutChangeNeeded( ETrue );
+            }
         }
     // Notify component manager
     iComponentManager->HandleLayoutChangeL();
@@ -7058,6 +7085,7 @@
             callBits |= EVtUiRefreshMenu;
             callBits |= EVtUiStopBrightnessOrContrast;
             callBits |= EVtUiRefreshZoomPopup;
+            callBits |= EVtUiEnableEndCallButton;
             break;
         default:
             break;
@@ -7155,6 +7183,8 @@
         {
         __VTPRINT3( DEBUG_GEN,
             "VtUi.HandleVTCommandPerformedL cmd=%d err=%d", aCommand, aError );
+        
+        iAppUi.iShareImageOngoing = EFalse;
         if( aError != KErrNone )
             {
             // stop toolbar feature to prevent drawing over error dialog
@@ -7181,11 +7211,21 @@
                     TCallBack( &AsyncShare, &iAppUi ) );
                 }
             iAppUi.iAsyncCallback->CallBack();
+            iAppUi.iShareImageOngoing = ETrue;
+            }
+        else if( iAppUi.iUiStates->IsLayoutChangeNeeded() && 
+                aCommand == KVtEngStartShareImage && 
+                aCommand == iAppUi.iPendingCmd )
+            {
+            iAppUi.iPendingCmd = KVtEngCommandNone;
+            iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse );
+            iAppUi.DoHandleLayoutChangedL();
             }
         }
     else if ( iAppUi.iUiStates->IsLayoutChangeNeeded() && 
             ( aCommand  == KVtEngSetSource ||
             aCommand  == KVtEngPrepareCamera ||
+            aCommand  == KVtEngStopShareImage ||
             aCommand  == KVtEngUnfreeze ||
             aCommand  == KVtEngHandleLayoutChange ) ||
             ( ( aCommand  == KVtEngMuteOutgoingAudio || 
@@ -7198,6 +7238,13 @@
         iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse );
         iAppUi.DoHandleLayoutChangedL();
         }
+    // Handle condition that commmand setsource and layoutchange
+    //   without layoutchange needed in UI
+    else if ( aCommand == KVtEngHandleLayoutChange ||
+              aCommand == KVtEngSetSource ) 
+        {
+        iAppUi.EndCallButtonPane().SetEnabled( ETrue );
+        }
     __VTPRINTEXITR( "VtUiComms.HandleVTCommandPerformedL %d", 1 )
     }
 
@@ -7326,7 +7373,8 @@
         &CVtUiAppUi::StopWhiteBalanceOrColortone,
         &CVtUiAppUi::RefreshMenuL,
         &CVtUiAppUi::StopBrightnessOrContrast,
-        &CVtUiAppUi::RefreshZoomPopupL
+        &CVtUiAppUi::RefreshZoomPopupL,
+        &CVtUiAppUi::EnableEndCallButton
         };
     const TInt count = ( sizeof( methodArray ) / sizeof ( TMethodL ) );
 
--- a/vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -233,3 +233,13 @@
     iEndButton->SetLayout( text, icon.Rect() );
      __VTPRINTEXIT( "CVtUiEndCallButtonPane.GetButtonLayoutData" )
     }
+
+// -----------------------------------------------------------------------------
+// CVtUiEndCallButtonPane::SetEnabled
+// -----------------------------------------------------------------------------
+//
+void CVtUiEndCallButtonPane::SetEnabled( TBool aEnabled )
+    {
+    iEndButton->SetDimmed( !aEnabled );
+    DrawNow();
+    }
--- a/vtuis/videotelui/src/CVtUiRemoteVideoControl.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtuis/videotelui/src/CVtUiRemoteVideoControl.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -98,12 +98,6 @@
     SetExtent( TPoint(), TSize() );
     ActivateL();
 	    
-    // Disable fading when using DP (eliminates nasty color error)
-    if ( FeatureManager::FeatureSupported( KFeatureIdDisplayPost ) )
-        {
-        Window().SetNonFading( ETrue );
-        }    
-  
     if ( iAppUi.EventMonitor() )
         {
         iAppUi.EventMonitor()->AddObserverL( this );
--- a/vtuis/videotelui/src/commands/cvtuiprimarycmdpolicy.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtuis/videotelui/src/commands/cvtuiprimarycmdpolicy.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -439,7 +439,9 @@
 #else
         // When RD_BOOT_CUSTOMIZABLE_AI is defined, active idle is always
         // shown in menu
-        result = EFalse;
+        // result = EFalse;
+        // disable the go to idle when autolock is on.
+        result = iUiStates.IsDeviceLockOn();
 #endif //RD_BOOT_CUSTOMIZABLE_AI
         break;
 
--- a/vtuis/videotelui/src/tvtuistaterunning.cpp	Thu Jul 15 18:41:45 2010 +0300
+++ b/vtuis/videotelui/src/tvtuistaterunning.cpp	Thu Aug 19 09:57:36 2010 +0300
@@ -107,7 +107,13 @@
     switch ( aCommand )
         {
     case EVtUiCmdEndActiveCall:
-        ShutdownWithEngineCommandL( KVtEngTerminateSession );
+        {
+        const MVtEngSessionInfo::TSessionState state = SessionState( EFalse );
+        if ( state == MVtEngSessionInfo::EOpen )
+            {
+            ShutdownWithEngineCommandL( KVtEngTerminateSession );
+            }
+        }
         break;
     case EVtUiCmdCreateVoice:
         CreateVoiceCallL();