multimediacommscontroller/mmccrtpsourcesink/src/mccrtpinterface.cpp
branchRCL_3
changeset 18 817c922b90eb
parent 0 1bce908db942
equal deleted inserted replaced
17:b9d283c5c7b5 18:817c922b90eb
   202 // -----------------------------------------------------------------------------
   202 // -----------------------------------------------------------------------------
   203 // MMccRtpInterface::ConfigureL
   203 // MMccRtpInterface::ConfigureL
   204 // Configures the RTP source/sink
   204 // Configures the RTP source/sink
   205 // -----------------------------------------------------------------------------
   205 // -----------------------------------------------------------------------------
   206 //
   206 //
   207 void MMccRtpInterface::ConfigureL( const TDesC8& aConfig )
   207 void MMccRtpInterface::ConfigureL( const TDesC8& aConfig, 
       
   208 									CMccRtpMediaClock* aRtpMediaClock )
   208     {
   209     {
   209     TRACE_RTP_INTERFACE_PRINT( "MMccRtpInterface::ConfigureL, Entry" )
   210     TRACE_RTP_INTERFACE_PRINT( "MMccRtpInterface::ConfigureL, Entry" )
   210     __ASSERT_ALWAYS( NULL != iRtpKeepalive, User::Leave( KErrNotReady ) );
   211     __ASSERT_ALWAYS( NULL != iRtpKeepalive, User::Leave( KErrNotReady ) );
       
   212     
       
   213     if ( !iRtpMediaClock )
       
   214         {
       
   215         iRtpMediaClock = aRtpMediaClock;
       
   216         }
   211     
   217     
   212     if ( aConfig.Size() == sizeof( TMccCodecInfo ) )
   218     if ( aConfig.Size() == sizeof( TMccCodecInfo ) )
   213         {
   219         {
   214         TMccCodecInfoBuffer infoBuffer;
   220         TMccCodecInfoBuffer infoBuffer;
   215         infoBuffer.Copy( aConfig );
   221         infoBuffer.Copy( aConfig );
   226             // kept disabled by not configuring interval at any phase.
   232             // kept disabled by not configuring interval at any phase.
   227             TBool updateNeeded = 
   233             TBool updateNeeded = 
   228                 ( iCodecInfo.iKeepalivePT != codecInfo.iKeepalivePT ||
   234                 ( iCodecInfo.iKeepalivePT != codecInfo.iKeepalivePT ||
   229                 iCodecInfo.iKeepaliveInterval != codecInfo.iKeepaliveInterval ||
   235                 iCodecInfo.iKeepaliveInterval != codecInfo.iKeepaliveInterval ||
   230                 iCodecInfo.iKeepaliveData != codecInfo.iKeepaliveData ) &&
   236                 iCodecInfo.iKeepaliveData != codecInfo.iKeepaliveData ) &&
   231                 0 != codecInfo.iKeepaliveInterval;
   237                 0 != codecInfo.iKeepaliveInterval ||
       
   238 				iRtpKeepaliveUpdatePending;
   232             
   239             
   233             if ( updateNeeded )
   240             if ( updateNeeded )
   234                 {
   241                 {
   235                 TRACE_RTP_INTERFACE_PRINT( 
   242 				if ( iRtpMediaClock )
   236                     "MMccRtpInterface::ConfigureL - Update" )
   243 					{
   237                 
   244 	                TRACE_RTP_INTERFACE_PRINT( 
   238                 iCodecInfo.iKeepalivePT = codecInfo.iKeepalivePT;
   245 	                    "MMccRtpInterface::ConfigureL - Update" )
   239                 iCodecInfo.iKeepaliveInterval = codecInfo.iKeepaliveInterval;
   246 	                
   240                 iCodecInfo.iKeepaliveData = codecInfo.iKeepaliveData;
   247 	                iCodecInfo.iKeepalivePT = codecInfo.iKeepalivePT;
   241                 iRtpKeepalive->UpdateParamsL( *this, codecInfo );
   248 	                iCodecInfo.iKeepaliveInterval = codecInfo.iKeepaliveInterval;
       
   249 	                iCodecInfo.iKeepaliveData = codecInfo.iKeepaliveData;
       
   250 	                __ASSERT_ALWAYS( NULL != iRtpMediaClock, User::Leave( KErrNotReady ) );
       
   251 	                iRtpKeepalive->UpdateParamsL( *this, codecInfo, *iRtpMediaClock );
       
   252 					
       
   253 					iRtpKeepaliveUpdatePending = EFalse;
       
   254 					}
       
   255 				else
       
   256 					{
       
   257 					iRtpKeepaliveUpdatePending = ETrue;
       
   258 					}
   242                 }
   259                 }
   243             }
   260             }
   244         }
   261         }
   245     else
   262     else
   246         {
   263         {
   359 //        
   376 //        
   360 TBool MMccRtpInterface::IsSending() const
   377 TBool MMccRtpInterface::IsSending() const
   361     {
   378     {
   362     return EFalse;
   379     return EFalse;
   363     }
   380     }
       
   381         
       
   382 // -----------------------------------------------------------------------------
       
   383 // MMccRtpInterface::SendJitterEventToClient
       
   384 // -----------------------------------------------------------------------------
       
   385 // 
       
   386 void MMccRtpInterface::SendJitterEventToClient( MAsyncEventHandler* aEventHandler,
       
   387 				                              	TUid aEventOriginator,
       
   388 				                            	TMccInternalEventType aInternalEventType,
       
   389 				                            	TMccEventType aEventType,
       
   390 				                            	TUint32 aEndpointId,
       
   391 				                            	TInt aError, 
       
   392 				                            	TUint64 aJitterEstimate,
       
   393 				                           	 	TUint32 aPacketsReceived,
       
   394 				                            	TInt64 aPrevTransTime,
       
   395 				                            	TUint64 aTriggeredJitterLevel,
       
   396 												TInt aPacketLoss,
       
   397 												TInt aTriggeredPacketLoss )
       
   398 	{
       
   399 	
       
   400 	TRACE_RTP_SOURCE_PRINT( "MMccRtpInterface::SendJitterEventToClient" )
       
   401     
       
   402     if ( aEventHandler )
       
   403         {
       
   404         ClearMccEvent();
       
   405         
       
   406         iMccEvent.iEventCategory = KMccEventCategoryRtp;
       
   407         iMccEvent.iStreamId = iMccStreamId;
       
   408         iMccEvent.iEndpointId = aEndpointId;
       
   409         iMccEvent.iEventType = aEventType;
       
   410         iMccEvent.iErrorCode = aError;
       
   411         
       
   412         // Save some stack memory
       
   413         {
       
   414         TMccRtpEventDataExtended eventData;
       
   415         eventData.iJitterEstimate = aJitterEstimate;
       
   416         eventData.iPacketsReceived = aPacketsReceived;
       
   417         eventData.iPrevTransTime = aPrevTransTime;
       
   418         eventData.iTriggeredJitterLevel = aTriggeredJitterLevel;
       
   419         eventData.iPacketLoss = aPacketLoss;
       
   420         eventData.iTriggeredPacketLoss = aTriggeredPacketLoss;
       
   421         
       
   422         iMccEvent.iEventData.Copy( TMccRtpEventDataExtendedPackage( eventData ) );
       
   423         }
       
   424         
       
   425         TMccInternalEvent internalEvent( aEventOriginator, 
       
   426                                          aInternalEventType,
       
   427                                          iMccEvent );
       
   428         
       
   429         aEventHandler->SendEventToClient( internalEvent );
       
   430         }
       
   431     else
       
   432         {
       
   433 	    TRACE_RTP_INTERFACE_PRINT("MMccRtpInterface::SendInternalRtpEventToClient, \
       
   434 aEventHandler=NULL")
       
   435         }  
       
   436 	}        
   364         
   437         
   365 // -----------------------------------------------------------------------------
   438 // -----------------------------------------------------------------------------
   366 // MMccRtpInterface::SendInternalRtpEventToClient
   439 // MMccRtpInterface::SendInternalRtpEventToClient
   367 // -----------------------------------------------------------------------------
   440 // -----------------------------------------------------------------------------
   368 //   
   441 //