vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp
branchRCL_3
changeset 25 779871d1e4f4
parent 24 f15ac8e65a02
equal deleted inserted replaced
24:f15ac8e65a02 25:779871d1e4f4
    80 const TText KVtEngCharacterSpace( ' ' );
    80 const TText KVtEngCharacterSpace( ' ' );
    81 // New line (\n) character constant.
    81 // New line (\n) character constant.
    82 const TInt KVtEngCharacterEndLine( 10 );
    82 const TInt KVtEngCharacterEndLine( 10 );
    83 
    83 
    84 // Multiplex delay in milliseconds
    84 // Multiplex delay in milliseconds
    85 //const TInt KVtEngMultiplexingDelay = 150;
    85 const TInt KVtEngMultiplexingDelay = 150;
    86 
    86 
    87 // TradeOff values
    87 // TradeOff values
    88 const TInt KVtEngTradeOffDetailMax = 9;
    88 const TInt KVtEngTradeOffDetailMax = 9;
    89 const TInt KVtEngTradeOffNormalMax = 19;
    89 const TInt KVtEngTradeOffNormalMax = 19;
    90 const TInt KVtEngTradeOffMotionMax = 31;
    90 const TInt KVtEngTradeOffMotionMax = 31;
   800             AssignPendingOp( aOperation );
   800             AssignPendingOp( aOperation );
   801             }
   801             }
   802             break;
   802             break;
   803         case KVtEngPrepareViewFinder:
   803         case KVtEngPrepareViewFinder:
   804             {
   804             {
   805             const TPckgC<TVtEngRenderingOptionsNGA>& pckg =
   805             const TPckgC<TVtEngRenderingOptions>& pckg =
   806                 static_cast< const TPckgC<TVtEngRenderingOptionsNGA>& >
   806                 static_cast< const TPckgC<TVtEngRenderingOptions>& >
   807                 ( *aOperation.Parameters() );
   807                 ( *aOperation.Parameters() );
   808             const TVtEngRenderingOptionsNGA &options = pckg();
   808             const TVtEngRenderingOptions& options = pckg();
   809             iLocalVideo->SetViewFinderParameters( options );
   809             iLocalVideo->SetViewFinderParameters( options );
   810             }
   810             }
   811             break;
   811             break;
   812         case KVtEngPrepareRemoteRenderNGA:
   812         case KVtEngPrepareRemoteRenderNGA:
   813             {
   813             {
  3889 //
  3889 //
  3890 void CVtEngMediaHandler::HandleVideoEncoderCommandCompletedL(
  3890 void CVtEngMediaHandler::HandleVideoEncoderCommandCompletedL(
  3891     const TVtCommandResponse& aResponse )
  3891     const TVtCommandResponse& aResponse )
  3892     {
  3892     {
  3893     __VTPRINTENTER( "MH.EncExtCommandCompleted" )
  3893     __VTPRINTENTER( "MH.EncExtCommandCompleted" )
  3894 
  3894     const TInt type( aResponse.iCmdType );
  3895     __VTPRINT2( DEBUG_MEDIA, "MH.263 ComC type=%d", aResponse.iCmdType )
  3895     const TInt protoCmdId( aResponse.iCmdId );
       
  3896     const TInt protoResponse( aResponse.iCmdStatus );
       
  3897     __VTPRINT2( DEBUG_MEDIA, "MH.263 ComC type=%d", type )
  3896     __VTPRINT3( DEBUG_MEDIA, "MH.263 ComC cmdId=%d,response=%d",
  3898     __VTPRINT3( DEBUG_MEDIA, "MH.263 ComC cmdId=%d,response=%d",
  3897       aResponse.iCmdId, aResponse.iCmdStatus )
  3899       protoCmdId, protoResponse )
  3898 
  3900 
  3899     // Find correct entry in iPendingOps based on TOperation because there can
  3901     // Find correct entry in iPendingOps based on TOperation because there can
  3900     // be several entries with same Protocol cmd id since each Protocol interface has their
  3902     // be several entries with same Protocol cmd id since each Protocol interface has their
  3901     // own id allocation and ids may overlap.
  3903     // own id allocation and ids may overlap.
  3902     TInt index( KErrNotFound );
  3904     TInt index( KErrNotFound );
  3903     TOperation completedOp = ENone;
  3905     TOperation completedOp = ENone;
  3904     if ( MatchResponseToPendingOps( aResponse.iCmdId, ESendIntraframe, &index ) ||
  3906     if ( MatchResponseToPendingOps( protoCmdId, ESendIntraframe, &index ) ||
  3905          MatchResponseToPendingOps( aResponse.iCmdId, ESetIFrameInterval, &index ) ||
  3907          MatchResponseToPendingOps( protoCmdId, ESetIFrameInterval, &index ) ||
  3906          MatchResponseToPendingOps( aResponse.iCmdId, ESetVideoQuality, &index ) )
  3908          MatchResponseToPendingOps( protoCmdId, ESetVideoQuality, &index ) )
  3907         {
  3909         {
  3908         // TOperation entries in are unique in the array...
  3910         // TOperation entries in are unique in the array...
  3909         const TCmdOpPair pair = (*iPendingOps)[ index ];
  3911         const TCmdOpPair pair = (*iPendingOps)[ index ];
  3910         completedOp = pair.iOp;
  3912         completedOp = pair.iOp;
  3911         // ...so remove based on that instead of protoCmdId
  3913         // ...so remove based on that instead of protoCmdId
  3918     if ( completedOp == ESetVideoQuality )
  3920     if ( completedOp == ESetVideoQuality )
  3919         {
  3921         {
  3920         __VTPRINT( DEBUG_MEDIA, "MH.EECC ESetVideoQuality" )
  3922         __VTPRINT( DEBUG_MEDIA, "MH.EECC ESetVideoQuality" )
  3921         if( iPendingOp && ( iPendingOp->Command() == KVtEngSetVideoQuality ) )
  3923         if( iPendingOp && ( iPendingOp->Command() == KVtEngSetVideoQuality ) )
  3922             {
  3924             {
  3923             CompleteOp( aResponse.iCmdStatus );
  3925             CompleteOp( protoResponse );
  3924             }
  3926             }
  3925         if( aResponse.iCmdStatus == KErrNone )
  3927         if( protoResponse == KErrNone )
  3926             {
  3928             {
  3927             TVtEngVideoQuality::TVQSParams vqp;
  3929             TVtEngVideoQuality::TVQSParams vqp;
  3928 
  3930 
  3929             if ( iVideoQuality.SettingSucceeded( aResponse.iCmdId, vqp ) )
  3931             if ( iVideoQuality.SettingSucceeded( protoCmdId, vqp ) )
  3930                 {
  3932                 {
  3931                 __VTPRINT( DEBUG_MEDIA, "MH.EECC sending vq indication" )
  3933                 __VTPRINT( DEBUG_MEDIA, "MH.EECC sending vq indication" )
  3932                 AddOperation( ESendVTSTO,
  3934                 AddOperation( ESendVTSTO,
  3933                     iH324Config->SendVideoTemporalSpatialTradeoffIndication(
  3935                     iH324Config->SendVideoTemporalSpatialTradeoffIndication(
  3934                     iVideoOutgoingLogicalChannel.iLogicalChannelId,
  3936                     iVideoOutgoingLogicalChannel.iLogicalChannelId,
  3940                     }
  3942                     }
  3941                 }
  3943                 }
  3942             }
  3944             }
  3943         else
  3945         else
  3944             {
  3946             {
  3945             iVideoQuality.SettingFailed( aResponse.iCmdId );
  3947             iVideoQuality.SettingFailed( protoCmdId );
  3946             }
  3948             }
  3947         }
  3949         }
  3948     if ( iProtoState == MVtProtocolCommand::EIdle )
  3950     if ( iProtoState == MVtProtocolCommand::EIdle )
  3949         { // Command was complete during uninitialization.
  3951         { // Command was complete during uninitialization.
  3950         NextUninitStepCallbackL();
  3952         NextUninitStepCallbackL();
  3957 // -----------------------------------------------------------------------------
  3959 // -----------------------------------------------------------------------------
  3958 //
  3960 //
  3959 void CVtEngMediaHandler::HandleVideoEncoderInformationalEventL(
  3961 void CVtEngMediaHandler::HandleVideoEncoderInformationalEventL(
  3960     const TVtIndicationEvent& aEvent)
  3962     const TVtIndicationEvent& aEvent)
  3961     {
  3963     {
  3962     __VTPRINT2( DEBUG_MEDIA, "MH.263 infoevent=%d", aEvent.iEventType )
  3964     const TInt type( aEvent.iEventType );
       
  3965     __VTPRINT2( DEBUG_MEDIA, "MH.263 infoevent=%d", type )
  3963     }
  3966     }
  3964 
  3967 
  3965 // -----------------------------------------------------------------------------
  3968 // -----------------------------------------------------------------------------
  3966 // CVtEngMediaHandler::HandleH324MConfigCommandCompletedL
  3969 // CVtEngMediaHandler::HandleH324MConfigCommandCompletedL
  3967 //
  3970 //
  3969 //
  3972 //
  3970 void CVtEngMediaHandler::HandleH324MConfigCommandCompletedL(
  3973 void CVtEngMediaHandler::HandleH324MConfigCommandCompletedL(
  3971     const TVtCommandResponse& aResponse )
  3974     const TVtCommandResponse& aResponse )
  3972     {
  3975     {
  3973 	__VTPRINTENTER( "MH.HandleH324MConfigCommandCompletedL" )
  3976 	__VTPRINTENTER( "MH.HandleH324MConfigCommandCompletedL" )
  3974 
  3977 	const TInt protoCmdId( aResponse.iCmdId );
  3975 	__VTPRINT2( DEBUG_MEDIA, "MH.HandleH324MConfigCommandCompletedL type=%d", aResponse.iCmdType )
  3978 	const TInt protoResponse( aResponse.iCmdStatus );
  3976     __VTPRINT3( DEBUG_MEDIA, "MH.HandleH324MConfigCommandCompletedL cmdId=%d,response=%d", aResponse.iCmdId, aResponse.iCmdStatus )
  3979 	const TInt type( aResponse.iCmdType );
       
  3980 
       
  3981 	__VTPRINT2( DEBUG_MEDIA, "MH.HandleH324MConfigCommandCompletedL type=%d", type )
       
  3982     __VTPRINT3( DEBUG_MEDIA, "MH.HandleH324MConfigCommandCompletedL cmdId=%d,response=%d", protoCmdId, protoResponse )
  3977     TInt index( KErrNotFound );
  3983     TInt index( KErrNotFound );
  3978     // Find correct entry in iPendingOps based on TOperation because there can
  3984     // Find correct entry in iPendingOps based on TOperation because there can
  3979     // be several entries with same Protocol cmd id since each Protocol interface has their
  3985     // be several entries with same Protocol cmd id since each Protocol interface has their
  3980     // own id allocation and ids may overlap.
  3986     // own id allocation and ids may overlap.
  3981     if ( MatchResponseToPendingOps( aResponse.iCmdId, ESetVendorId, &index ) ||
  3987     if ( MatchResponseToPendingOps( protoCmdId, ESetVendorId, &index ) ||
  3982          MatchResponseToPendingOps( aResponse.iCmdId, ESendVTSTO, &index ) ||
  3988          MatchResponseToPendingOps( protoCmdId, ESendVTSTO, &index ) ||
  3983          MatchResponseToPendingOps( aResponse.iCmdId, ESetSupportedResolutions, &index ) ||
  3989          MatchResponseToPendingOps( protoCmdId, ESetSupportedResolutions, &index ) ||
  3984          MatchResponseToPendingOps( aResponse.iCmdId, ESetFastCsupOptions, &index ) )
  3990          MatchResponseToPendingOps( protoCmdId, ESetFastCsupOptions, &index ) )
  3985         {
  3991         {
  3986         // TOperation entries in are unique in the array...
  3992         // TOperation entries in are unique in the array...
  3987         const TCmdOpPair pair = (*iPendingOps)[ index ];
  3993         const TCmdOpPair pair = (*iPendingOps)[ index ];
  3988         // ...so remove based on that instead of protoCmdId
  3994         // ...so remove based on that instead of protoCmdId
  3989         RemoveOperation( pair.iOp );
  3995         RemoveOperation( pair.iOp );
  3994             {
  4000             {
  3995         	CVtEngStateManager* stateManager = CVtEngUtility::StateManager();
  4001         	CVtEngStateManager* stateManager = CVtEngUtility::StateManager();
  3996 
  4002 
  3997         	// Check does the received command ID match to command ID that was received
  4003         	// Check does the received command ID match to command ID that was received
  3998         	// from Protocol when DTMF was send.
  4004         	// from Protocol when DTMF was send.
  3999         	if( stateManager->Handlers().Dtmf().CheckCommandId( aResponse.iCmdId ) )
  4005         	if( stateManager->Handlers().Dtmf().CheckCommandId( protoCmdId ) )
  4000         		{
  4006         		{
  4001         		__VTPRINT( DEBUG_MEDIA, "MH.Complete DTMF" )
  4007         		__VTPRINT( DEBUG_MEDIA, "MH.Complete DTMF" )
  4002         		stateManager->Handlers().Dtmf().SendComplete( aResponse.iCmdStatus );
  4008         		stateManager->Handlers().Dtmf().SendComplete( protoResponse );
  4003         		}
  4009         		}
  4004         	}
  4010         	}
  4005             break;
  4011             break;
  4006         case MVtProtocolCommand::EIdle: // extension command complete
  4012         case MVtProtocolCommand::EIdle: // extension command complete
  4007             NextUninitStepCallbackL();
  4013             NextUninitStepCallbackL();