vtuis/lcvtplugin/src/base/clcvtsession.cpp
changeset 43 fc383c0181e8
parent 41 f65a18712d2e
child 39 7510ce99d5ea
equal deleted inserted replaced
42:607cc97c6047 43:fc383c0181e8
    23 #include <w32std.h>
    23 #include <w32std.h>
    24 #include <coecntrl.h>
    24 #include <coecntrl.h>
    25 #include <eikenv.h>
    25 #include <eikenv.h>
    26 #include <eikappui.h>
    26 #include <eikappui.h>
    27 #include <apgcli.h>
    27 #include <apgcli.h>
       
    28 #include <centralrepository.h> 
    28 
    29 
    29 #include "clcvtsession.h"
    30 #include "clcvtsession.h"
    30 
    31 
    31 #include "cvtengmodel.h"
    32 #include "cvtengmodel.h"
    32 
    33 
    36 #include "tlcvtstates.h"
    37 #include "tlcvtstates.h"
    37 #include "clcvtcmdexecutor.h"
    38 #include "clcvtcmdexecutor.h"
    38 #include "mlcvtenginecommandmanager.h"
    39 #include "mlcvtenginecommandmanager.h"
    39 #include "lcvtplugincommand.h"
    40 #include "lcvtplugincommand.h"
    40 #include "lcvtutility.h"
    41 #include "lcvtutility.h"
       
    42 
       
    43 // User selectable Call answer status values
       
    44 const TInt KAllwaysQuery = 0;
       
    45 const TInt KAllwaysAllow = 2;
    41 
    46 
    42 // Default call index.
    47 // Default call index.
    43 const TInt KVtUiDefaultCallId = 1;
    48 const TInt KVtUiDefaultCallId = 1;
    44 
    49 
    45 // Granularity of command observer array.
    50 // Granularity of command observer array.
   264     iLayoutChangeCallback =
   269     iLayoutChangeCallback =
   265         new ( ELeave ) CAsyncCallBack(
   270         new ( ELeave ) CAsyncCallBack(
   266             TCallBack( &DelayedHandleLayoutChanged, this ),
   271             TCallBack( &DelayedHandleLayoutChanged, this ),
   267             CActive::EPriorityStandard );   
   272             CActive::EPriorityStandard );   
   268 #endif    
   273 #endif    
   269 
   274     CRepository* repository = CRepository::NewL( KCRUidTelephonySettings );
   270     //iIndicatorCtr = new  ( ELeave ) LcVtIndicatorController();
   275 
       
   276     if ( repository->Get( KSettingsVTVideoSending, VideoSendingKey ) == KErrNone )
       
   277         {
       
   278         __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsFeatureSupported get key=%d", VideoSendingKey )
       
   279         }
       
   280     else
       
   281         {
       
   282         __VTPRINT( DEBUG_GEN, "CLcVtSession.IsFeatureSupported set key to default KAllwaysAllow" )
       
   283         VideoSendingKey = KAllwaysAllow;
       
   284         }
       
   285     delete repository;
       
   286     
       
   287     iIndicatorCtr = new  ( ELeave ) LcVtIndicatorController();
   271     __VTPRINTEXIT( "CLcVtSession.ConstructL" )
   288     __VTPRINTEXIT( "CLcVtSession.ConstructL" )
   272     
   289     
   273     }
   290     }
   274 
   291 
   275 // -----------------------------------------------------------------------------
   292 // -----------------------------------------------------------------------------
   301     delete iLocalVideoPlayer;
   318     delete iLocalVideoPlayer;
   302     delete iRemoteVideoPlayer;
   319     delete iRemoteVideoPlayer;
   303     
   320     
   304     delete iRemoteDisplayName;
   321     delete iRemoteDisplayName;
   305     delete iRemoteDetails;
   322     delete iRemoteDetails;
   306 //    if (iIndicatorCtr) {
   323     if (iIndicatorCtr) {
   307 //        iIndicatorCtr->disableActiveCallIndicator();
   324         iIndicatorCtr->disableActiveCallIndicator();
   308 //        delete iIndicatorCtr;
   325         delete iIndicatorCtr;
   309 //    }    
   326     }    
   310     __VTPRINTEXIT( "CLcVtSession.~CLcVtSession" )
   327     __VTPRINTEXIT( "CLcVtSession.~CLcVtSession" )
   311     FeatureManager::UnInitializeLib();  
   328     FeatureManager::UnInitializeLib();  
   312     }
   329     }
   313 
   330 
   314 #ifndef NGA_VIDEO_RENDER
   331 #ifndef NGA_VIDEO_RENDER
   842     //iUplinkWindow->SetStreamBitmap( NULL );
   859     //iUplinkWindow->SetStreamBitmap( NULL );
   843 
   860 
   844     TInt err = KErrNotFound;
   861     TInt err = KErrNotFound;
   845     if ( LcVtUtility::HasStillImage( iModel->Media() ) )
   862     if ( LcVtUtility::HasStillImage( iModel->Media() ) )
   846         {
   863         {
   847         __VTPRINT( DEBUG_GEN, "VtUi.:CmdDisableVideoL.HasStill" )
   864         __VTPRINT( DEBUG_GEN, "CLcVtSession.CmdDisableVideoL.HasStill" )
   848         MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaStillImage;
   865         MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaStillImage;
   849         TRAP( err, ExecuteCmdL( KVtEngSetSource, source ) );
   866         TRAP( err, ExecuteCmdL( KVtEngSetSource, source ) );
   850         }
   867         }
   851     if ( ( err != KErrNone ) )
   868     if ( ( err != KErrNone ) )
   852         {
   869         {
   853         __VTPRINT( DEBUG_GEN, "VtUi.:CmdDisableVideoL.MediaNone" )
   870         __VTPRINT( DEBUG_GEN, "CLcVtSession.CmdDisableVideoL.MediaNone" )
   854         MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaNone;
   871         MVtEngMedia::TMediaSource source = MVtEngMedia::EMediaNone;
   855         ExecuteCmdL( KVtEngSetSource, source );
   872         ExecuteCmdL( KVtEngSetSource, source );
   856         }
   873         }
   857 
   874 
   858     ExecuteCmdL( KVtEngStartViewFinder );
   875     ExecuteCmdL( KVtEngStartViewFinder );
   944         iRwGroup->SetOrdinalPosition( 1 , priority );
   961         iRwGroup->SetOrdinalPosition( 1 , priority );
   945         iRemoteVideoWindow->SetOrdinalPosition( 1 , priority );
   962         iRemoteVideoWindow->SetOrdinalPosition( 1 , priority );
   946         iLocalVideoWindow->SetOrdinalPosition( 1 , priority );
   963         iLocalVideoWindow->SetOrdinalPosition( 1 , priority );
   947         iRwSession.Flush();
   964         iRwSession.Flush();
   948         }
   965         }
   949 //    if ( aIsForeground ) {
   966     if ( aIsForeground )
   950 //            iIndicatorCtr->disableActiveCallIndicator();
   967        {
   951 //        }
   968        iIndicatorCtr->disableActiveCallIndicator();
   952 //    else  {
   969        }
   953 //            iIndicatorCtr->enableActiveCallIndicator();
   970     else {
   954 //        }
   971        iIndicatorCtr->enableActiveCallIndicator();
       
   972        }
   955 
   973 
   956     __VTPRINTEXIT( "CLcVtSession.SetForegroundStatus" )
   974     __VTPRINTEXIT( "CLcVtSession.SetForegroundStatus" )
   957     
   975     
   958     return KErrNone;   
   976     return KErrNone;   
   959 }
   977 }
  1173         case EVtSessionAnsweredStartRemoteRender:            
  1191         case EVtSessionAnsweredStartRemoteRender:            
  1174             {
  1192             {
  1175             ActiveExecInitExecuteCommandL( KVtEngStartRenderRemote, aRequest );
  1193             ActiveExecInitExecuteCommandL( KVtEngStartRenderRemote, aRequest );
  1176             //TRequestStatus* status = &aRequest;
  1194             //TRequestStatus* status = &aRequest;
  1177             //User::RequestComplete( status, KErrNone );            
  1195             //User::RequestComplete( status, KErrNone );            
  1178             
  1196 
  1179             MVtEngSessionInfo& session = iModel->Session();
  1197             MVtEngSessionInfo::TDirection direction;
       
  1198             if ( iModel->Session().GetDirection( direction ) != KErrNone )
       
  1199                 {
       
  1200                 direction = MVtEngSessionInfo::EDirectionMT;
       
  1201                 }
       
  1202             
  1180             MVtEngMedia& media = iModel->Media();    
  1203             MVtEngMedia& media = iModel->Media();    
  1181             if ( LcVtUtility::HasCameras( media ) )
  1204             if ( LcVtUtility::HasCameras( media ) )
  1182                 {
  1205                 {
  1183                 //aNextState = EVtSessionAnsweredDoPrepareCamera;
  1206                 if ( direction == MVtEngSessionInfo::EDirectionMT )
  1184                 aNextState = EVtSessionAnsweredSetlectNone;
  1207                     {
       
  1208                         if ( VideoSendingKey == KAllwaysAllow)
       
  1209                             {
       
  1210                             aNextState = EVtSessionAnsweredDoPrepareCamera;
       
  1211                             }
       
  1212                         else
       
  1213                             {
       
  1214                             aNextState = EVtSessionAnsweredSetlectNone;
       
  1215                             }
       
  1216                     }
       
  1217                 else
       
  1218                     {
       
  1219                     //MVtEngSessionInfo::EDirectionMO
       
  1220                     aNextState = EVtSessionAnsweredDoPrepareCamera;
       
  1221                     }
  1185                 }
  1222                 }
  1186             else
  1223             else
  1187                 {
  1224                 {
  1188                 aNextState = EVtSessionAnsweredSetlectNone;
  1225                 aNextState = EVtSessionAnsweredSetlectNone;
  1189                 }
  1226                 }
  2196 
  2233 
  2197 TBool CLcVtSession::IsFeatureSupported( CLcEngine::TLcFeature aLcFeature )
  2234 TBool CLcVtSession::IsFeatureSupported( CLcEngine::TLcFeature aLcFeature )
  2198 {
  2235 {
  2199     __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsFeatureSupported feature=%d", aLcFeature)
  2236     __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsFeatureSupported feature=%d", aLcFeature)
  2200     TBool flag = EFalse;
  2237     TBool flag = EFalse;
       
  2238 
  2201     switch ( aLcFeature )
  2239     switch ( aLcFeature )
  2202         {
  2240         {
  2203         case CLcEngine::ELcSendVideoQuery:
  2241         case CLcEngine::ELcSendVideoQuery:
  2204             {
  2242             {
       
  2243             //MO call: return false; MT call: return true if key = Ask first, return false if key = No or Yes.
  2205             MVtEngSessionInfo::TDirection direction;
  2244             MVtEngSessionInfo::TDirection direction;
  2206             if ( iModel->Session().GetDirection( direction ) != KErrNone )
  2245             if ( iModel->Session().GetDirection( direction ) != KErrNone )
  2207                 {
  2246                 {
  2208                 direction = MVtEngSessionInfo::EDirectionMT;
  2247                 direction = MVtEngSessionInfo::EDirectionMT;
  2209                 }
  2248                 }
  2210             __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsFeatureSupported direction=%d", direction )
  2249             __VTPRINT2( DEBUG_GEN, "CLcVtSession.IsFeatureSupported direction=%d", direction )
  2211             flag = ( direction == MVtEngSessionInfo::EDirectionMT );
  2250 
       
  2251             if ( direction == MVtEngSessionInfo::EDirectionMT 
       
  2252                  && VideoSendingKey == KAllwaysQuery )
       
  2253                 {
       
  2254                 flag = ETrue;
       
  2255                 }
  2212             }
  2256             }
  2213             break;
  2257             break;
  2214 
  2258 
  2215         default:
  2259         default:
  2216             break;
  2260             break;