multimediacommscontroller/mmccsubcontroller/tsrc/ut_subcontroller/Src/UT_CMccSymDlStream.cpp
branchRCL_3
changeset 59 b0e4b01681c5
parent 42 817c922b90eb
equal deleted inserted replaced
55:f72c4fccd381 59:b0e4b01681c5
    33 #include "mccresourcepool_stub.h"
    33 #include "mccresourcepool_stub.h"
    34 #include "mcccodecconfigurator.h"
    34 #include "mcccodecconfigurator.h"
    35 #include "mccmultiplexer.h"
    35 #include "mccmultiplexer.h"
    36 #include "mmcccryptocontext.h"
    36 #include "mmcccryptocontext.h"
    37 #include "mccjitterbuffer.h"
    37 #include "mccjitterbuffer.h"
    38 #include "mccrtpmediaclock.h"
       
    39 
    38 
    40 #include "mccunittestmacros.h"
    39 #include "mccunittestmacros.h"
    41 
    40 
    42 const TUid KRtpDataSource = { KImplUidRtpDataSource }; 
    41 const TUid KRtpDataSource = { KImplUidRtpDataSource }; 
    43 const TInt KAmrNbBitrate122 = 12200;
    42 const TInt KAmrNbBitrate122 = 12200;
    82     }
    81     }
    83 
    82 
    84 //  METHODS
    83 //  METHODS
    85 void UT_CMccSymDlStream::SetupL()
    84 void UT_CMccSymDlStream::SetupL()
    86     {
    85     {
    87     iRtpMediaClock = CMccRtpMediaClock::NewL();
       
    88     
       
    89     iResources = CMccResourcePoolStub::NewL();
    86     iResources = CMccResourcePoolStub::NewL();
    90     iStreamId = 1;
    87     iStreamId = 1;
    91     iHandler = CMccTestEventHandler::NewL();
    88     iHandler = CMccTestEventHandler::NewL();
    92     iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources, iMccSessionId );
    89     iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources, iMccSessionId );
    93     iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201, *iRtpMediaClock );
    90     iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201 );
    94     CleanupStack::Pop( iStream );
    91     CleanupStack::Pop( iStream );
    95     
    92     
    96     TPckgBuf<TInt> params( 30000 );
    93     TPckgBuf<TInt> params( 30000 );
    97     iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params );
    94     iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params );
    98     iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 );
    95     iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 );
   119     iRtpMan->CreateSessionL( port, ETrue, EFalse );
   116     iRtpMan->CreateSessionL( port, ETrue, EFalse );
   120     }
   117     }
   121     
   118     
   122 void UT_CMccSymDlStream::Setup2L()
   119 void UT_CMccSymDlStream::Setup2L()
   123     {
   120     {
   124     iRtpMediaClock = CMccRtpMediaClock::NewL();
       
   125     
       
   126     iResources = CMccResourcePoolStub::NewL();
   121     iResources = CMccResourcePoolStub::NewL();
   127     iStreamId = 1;
   122     iStreamId = 1;
   128     iHandler = CMccTestEventHandler::NewL();
   123     iHandler = CMccTestEventHandler::NewL();
   129     iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources, iMccSessionId );
   124     iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources, iMccSessionId );
   130     iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201, *iRtpMediaClock );
   125     iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201 );
   131     CleanupStack::Pop( iStream );
   126     CleanupStack::Pop( iStream );
   132     
   127     
   133     TPckgBuf<TInt> params( 30000 );
   128     TPckgBuf<TInt> params( 30000 );
   134     iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params );
   129     iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params );
   135     iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 );
   130     iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 );
   137     iStream->AddSinkAndSourceL( iSinkStub, iSourceStub );
   132     iStream->AddSinkAndSourceL( iSinkStub, iSourceStub );
   138     }
   133     }
   139 
   134 
   140 void UT_CMccSymDlStream::SetupIlbcL()
   135 void UT_CMccSymDlStream::SetupIlbcL()
   141     {
   136     {
   142     iRtpMediaClock = CMccRtpMediaClock::NewL();
       
   143     
       
   144     iResources = CMccResourcePoolStub::NewL();
   137     iResources = CMccResourcePoolStub::NewL();
   145     iStreamId = 1;
   138     iStreamId = 1;
   146     iHandler = CMccTestEventHandler::NewL();
   139     iHandler = CMccTestEventHandler::NewL();
   147     iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources,iMccSessionId );
   140     iRtpMan = CMccRtpManager::NewL( *iHandler, *iResources,iMccSessionId );
   148     iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201, *iRtpMediaClock );
   141     iStream = CMccSymDlStream::NewLC( iStreamId, iHandler, iResources, iRtpMan, 201 );
   149     CleanupStack::Pop( iStream );
   142     CleanupStack::Pop( iStream );
   150     
   143     
   151     TPckgBuf<TInt> params( 30000 );
   144     TPckgBuf<TInt> params( 30000 );
   152     iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params );
   145     iSourceStub = MDataSource::NewSourceL( KRtpDataSource, params );
   153     iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 );
   146     iSinkStub = MDataSink::NewSinkL( KUidMmfAudioOutput, KNullDesC8 );
   190         }
   183         }
   191     
   184     
   192     delete iSourceStub;
   185     delete iSourceStub;
   193     delete iSinkStub;
   186     delete iSinkStub;
   194     delete iResources;
   187     delete iResources;
   195     
       
   196     if ( iRtpMediaClock )
       
   197         {
       
   198         delete iRtpMediaClock;
       
   199         iRtpMediaClock = NULL;
       
   200         }
       
   201     }
   188     }
   202 
   189 
   203 void UT_CMccSymDlStream::UT_CMccSymDlStream_SetPrioritySettingsLL(  )
   190 void UT_CMccSymDlStream::UT_CMccSymDlStream_SetPrioritySettingsLL(  )
   204     {
   191     {
   205     TMMFPrioritySettings priority;
   192     TMMFPrioritySettings priority;