Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 09:44:39 +0300
branchRCL_3
changeset 18 e1a893011fac
parent 17 9ec13d39cc2e
child 20 b95d12697049
Revision: 201021 Kit: 2010123
vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp
vtuis/videotelui/inc/CVtUiAppUi.h
vtuis/videotelui/src/CVtUiAppUi.cpp
vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp
vtuis/videotelui/src/commands/tvtuistates.cpp
vtuis/videotelui/src/cvtuivideocontrolbase.cpp
--- a/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp	Tue May 25 12:45:10 2010 +0300
+++ b/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp	Wed Jun 09 09:44:39 2010 +0300
@@ -1295,7 +1295,7 @@
                 }
 
             // Do send an intra message
-            if ( IsFlag( EProtoVideoTrackPaused ) )
+            if ( videoEnabledByUser && IsFlag( EProtoVideoTrackPaused ) )
                 {
                 ClearFlag( EProtoVideoTrackPaused );
                 if ( IsFlag( EProtoSendIntraFrame ) )
--- a/vtuis/videotelui/inc/CVtUiAppUi.h	Tue May 25 12:45:10 2010 +0300
+++ b/vtuis/videotelui/inc/CVtUiAppUi.h	Wed Jun 09 09:44:39 2010 +0300
@@ -1220,6 +1220,12 @@
         * option menus is not visible.
         */
         void TryToStartTbL();
+        
+        /*
+        * Retries to start toolbar. Toolbar is started if
+        * option menus is not visible.
+        */
+        void RetryToStartTbL();
 
         /*
         * Update video prefrence
@@ -1482,6 +1488,8 @@
         TBool iLayoutChg;
         //save cmd for later use 
         TInt iDelayedCmd;
+        //disable video process
+        TBool iDisableVideoOngoing;
     };
 
 #endif      // CVTUIAPPUI_H
--- a/vtuis/videotelui/src/CVtUiAppUi.cpp	Tue May 25 12:45:10 2010 +0300
+++ b/vtuis/videotelui/src/CVtUiAppUi.cpp	Wed Jun 09 09:44:39 2010 +0300
@@ -1828,6 +1828,46 @@
     }
 
 // -----------------------------------------------------------------------------
+// CVtUiAppUi::ReTryToStartTbL
+// -----------------------------------------------------------------------------
+//
+void CVtUiAppUi::RetryToStartTbL()
+    {
+    // only with fixed toolbar
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        if ( iUiStates->IsFixedToolbarVisible())
+            {
+            // When option menu is opened fixed toolbar should
+            // be set hidden
+            iUiStates->SetIsFixedToolbarVisible( EFalse );
+            // Stop toolbar
+            MVtUiFeature* tb =
+                iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar );
+            if ( tb )
+                {
+                // timer could be active
+                if ( iTbPeriodic )
+                    {
+                    iTbPeriodic->Cancel();
+                    }
+                tb->Stop();
+                }
+            if ( !iTbPeriodic )
+                {
+                iTbPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
+                }
+            // Toolbar doesn't come visible until options menu is closed.
+            iTbPeriodic->Start( KStartTime, KPeriodTime, TCallBack( DoTryToStartTbL, this ) );
+            }
+        }
+    else
+        {
+        StopSliders(); 
+        }
+    }
+
+// -----------------------------------------------------------------------------
 // CVtUiAppUi::SetRenderingModeL
 // -----------------------------------------------------------------------------
 //
@@ -1999,38 +2039,7 @@
     MVtEngCommandHandler& command = Model().CommandHandler();
     command.ExecuteL( KVtEngRequestLastRemoteFrame, NULL );
     
-    // only with fixed toolbar
-    if ( AknLayoutUtils::PenEnabled() )
-        {
-        if ( iUiStates->IsFixedToolbarVisible())
-            {
-            // When option menu is opened fixed toolbar should
-            // be set hidden
-            iUiStates->SetIsFixedToolbarVisible( EFalse );
-            // Stop toolbar
-            MVtUiFeature* tb =
-            iFeatureManager->GetFeatureById( EVtUiFeatureIdToolbar );
-            if ( tb )
-                {
-                // timer could be active
-                if ( iTbPeriodic )
-                    {
-                    iTbPeriodic->Cancel();
-                    }
-                tb->Stop();
-                }
-            if ( !iTbPeriodic )
-                {
-                iTbPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
-                }
-            // Toolbar doesn't come visible until options menu is closed.
-            iTbPeriodic->Start( KStartTime, KPeriodTime, TCallBack( DoTryToStartTbL, this ) );
-            }
-        }
-    else
-        {
-        StopSliders(); 
-        }
+    RetryToStartTbL();
 
     iInstance->iMainControl->SetSize( iInstance->iMainControl->Size() );
     iInstance->iMainControl->DrawNow();
@@ -2130,7 +2139,7 @@
         TInt aCommand )
     {
     __VTPRINTENTER( "VtUi.HandleCommand" )
-
+    __VTPRINT2( DEBUG_GEN, "VtUi.HandleCommand.Cmd=%d", aCommand );
     // Check if same command is already being performed.
     if ( IsActiveCommand( aCommand ) || ( iState &&
          iState->HandleCommandL( aCommand ) ==
@@ -2248,8 +2257,11 @@
             break;
 
         case EVtUiCmdDisableBoth:
-            HandleCommandL( EVtUiCmdDisableAudio );
-            HandleCommandL( EVtUiCmdDisableVideo );
+            refresh = ETrue;
+            EnableCommandActivatingAndCleanupPushL();
+            CmdDisableVideoL();
+            CmdDisableAudioL();
+            CleanupStack::PopAndDestroy();
             break;
 
         case EVtUiCmdActivateBT:
@@ -2984,20 +2996,20 @@
 //
 void CVtUiAppUi::CmdDisableVideoL()
     {
-        
-        if( iUiStates->IsZoomModeOn() )
+    iDisableVideoOngoing = ETrue;
+    if( iUiStates->IsZoomModeOn() )
+        {
+        // if zoom feature is active, stop that
+        MVtUiFeature* zm = iFeatureManager->GetFeatureById( EVtUiFeatureIdZoom );
+        if ( zm )
             {
-            // if zoom feature is active, stop that
-            MVtUiFeature* zm = iFeatureManager->GetFeatureById( EVtUiFeatureIdZoom );
-            if ( zm )
+            if ( zm->State() ==  MVtUiFeature::EActive )
                 {
-                if ( zm->State() ==  MVtUiFeature::EActive )
-                    {
-                    __VTPRINT( DEBUG_GEN, "VtUi.CmdDisableVideoL zm->STOP" )
-                    zm->Stop();
-                    }
+                __VTPRINT( DEBUG_GEN, "VtUi.CmdDisableVideoL zm->STOP" )
+                zm->Stop();
                 }
             }
+        }
         
     ExecuteCmdL( KVtEngStopViewFinder );
 
@@ -3018,6 +3030,7 @@
         }
 
     ExecuteCmdL( KVtEngStartViewFinder );
+    iDisableVideoOngoing = EFalse;
     }
 
 // -----------------------------------------------------------------------------
@@ -3393,7 +3406,7 @@
     CVtUiAppUi::CVtUiAppUiMGVerifier* verifier =
         CVtUiAppUi::CVtUiAppUiMGVerifier::NewLC( *this, *iCoeEnv );
 
-     // number erntry is not availabe while media gallery is open
+    // number erntry is not availabe while media gallery is open
     iInstance->iNumberEntryActivation->SetActive( EFalse );
     iUiStates->SetSelectingShare( ETrue );
 
@@ -4801,12 +4814,15 @@
     __VTPRINTENTER( "VtUi.HandleForegroundChangedL" )
     __VTPRINT2( DEBUG_GEN, "VtUi.foreground=%d", (TInt) aIsForeground )
 
-
     // Let the Engine know that Application's foregorund
     // has changed. Then Engine can do some initalize/uninitalize
     // before rendering due to the foreground state.
-    iState->PreHandleForegroundChangedL(aIsForeground);
-
+    iState->PreHandleForegroundChangedL( aIsForeground );
+
+    // The availability of number entry depends on application is
+    // foreground or not
+    iInstance->iNumberEntryActivation->SetActive( aIsForeground );
+    
     // These operations must be done before
     // sending KVtEngSetUIForeground command to engine i.e. calling
     // iState->HandleForegroundChangedL( aIsForeground )
@@ -4839,7 +4855,6 @@
                cr->Stop();
                }
             }
-
         }
 
     TBool foregroundAndReady = EFalse;
@@ -4856,8 +4871,6 @@
         }
     else if ( !aIsForeground )
         {
-
-
         iEventObserver->StopBeat();
         }
     SetIncallBubbleAllowedInUsualL( !foregroundAndReady );
@@ -5005,11 +5018,19 @@
 void CVtUiAppUi::DoHandleLayoutChangedL()
     {
     __VTPRINTENTER( "VtUi.DoLayoutChg" )
+    TInt error;
     // Fully update rendering parameters
     UpdateRenderingParametersL();
     // Notify engine about layout change
     iLayoutChg = ETrue;
-    TRAPD( error, ExecuteCmdL( KVtEngHandleLayoutChange ) );
+    if( iDisableVideoOngoing )
+        {
+        error = KErrNotReady;
+        }
+    else
+        {
+        TRAP( error, ExecuteCmdL( KVtEngHandleLayoutChange ) );
+        }
     iLayoutChg = EFalse;
 
     // Not ready error is allowed to happen (e.g. when sharing)
@@ -5042,6 +5063,11 @@
             iPendingCmd = pendingCommand;
             iUiStates->SetLayoutChangeNeeded( ETrue );
             }
+        if( iDisableVideoOngoing && pendingCommand == KVtEngCommandNone )
+            {
+            iPendingCmd = KVtEngSetSource;
+            iUiStates->SetLayoutChangeNeeded( ETrue );
+            }
         }
     // Notify component manager
     iComponentManager->HandleLayoutChangeL();
@@ -5739,6 +5765,7 @@
         {
         RefreshStatesL();
         }
+    iDisableVideoOngoing = EFalse;
     __VTPRINTEXIT( "VtUi.HandleCommandDeactivationL" )
     }
 
@@ -6546,6 +6573,8 @@
                         }
                     }
                 }
+            
+            iAppUi.RetryToStartTbL();
             volume->StartL();
             
             // Toolbar needs to be refreshed if zoom, contrat and brightness were dismissed
--- a/vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp	Tue May 25 12:45:10 2010 +0300
+++ b/vtuis/videotelui/src/CVtUiEndCallButtonPane.cpp	Wed Jun 09 09:44:39 2010 +0300
@@ -75,12 +75,6 @@
     // Activate the window, which makes it ready to be drawn
     ActivateL();
     
-    // Disable fading when using DP (eliminates nasty color error)
-    if ( FeatureManager::FeatureSupported( KFeatureIdDisplayPost ) )
-        {
-        Window().SetNonFading( ETrue );
-        }
-    
     // For set non focus and recieve all point event
     SetNonFocusing();
     ClaimPointerGrab( ETrue );
--- a/vtuis/videotelui/src/commands/tvtuistates.cpp	Tue May 25 12:45:10 2010 +0300
+++ b/vtuis/videotelui/src/commands/tvtuistates.cpp	Wed Jun 09 09:44:39 2010 +0300
@@ -112,7 +112,7 @@
     if ( iCameraPref )
         {
         TInt temp;
-	    ret = !iCameraPref->GetBrightness( temp );
+	    ret = !iCameraPref->GetContrast( temp );
         }
     return ret;
     }
--- a/vtuis/videotelui/src/cvtuivideocontrolbase.cpp	Tue May 25 12:45:10 2010 +0300
+++ b/vtuis/videotelui/src/cvtuivideocontrolbase.cpp	Wed Jun 09 09:44:39 2010 +0300
@@ -82,11 +82,6 @@
     CreateWindowL();
     SetExtent( TPoint(), TSize() );
     ActivateL();
-    // Disable fading when using DP (eliminates nasty color error)
-    if ( FeatureManager::FeatureSupported( KFeatureIdDisplayPost ) )
-        {
-        Window().SetNonFading( ETrue );
-        }
     WrapOnDemand();
     __VTPRINTEXIT( "VidCtrlBase.BaseConstructL" )
     }