multimediacommscontroller/mmccrtpsourcesink/src/mccrtpinterface.cpp
branchRCL_3
changeset 59 b0e4b01681c5
parent 42 817c922b90eb
equal deleted inserted replaced
55:f72c4fccd381 59:b0e4b01681c5
   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 )
       
   209     {
   208     {
   210     TRACE_RTP_INTERFACE_PRINT( "MMccRtpInterface::ConfigureL, Entry" )
   209     TRACE_RTP_INTERFACE_PRINT( "MMccRtpInterface::ConfigureL, Entry" )
   211     __ASSERT_ALWAYS( NULL != iRtpKeepalive, User::Leave( KErrNotReady ) );
   210     __ASSERT_ALWAYS( NULL != iRtpKeepalive, User::Leave( KErrNotReady ) );
   212     
       
   213     if ( !iRtpMediaClock )
       
   214         {
       
   215         iRtpMediaClock = aRtpMediaClock;
       
   216         }
       
   217     
   211     
   218     if ( aConfig.Size() == sizeof( TMccCodecInfo ) )
   212     if ( aConfig.Size() == sizeof( TMccCodecInfo ) )
   219         {
   213         {
   220         TMccCodecInfoBuffer infoBuffer;
   214         TMccCodecInfoBuffer infoBuffer;
   221         infoBuffer.Copy( aConfig );
   215         infoBuffer.Copy( aConfig );
   232             // kept disabled by not configuring interval at any phase.
   226             // kept disabled by not configuring interval at any phase.
   233             TBool updateNeeded = 
   227             TBool updateNeeded = 
   234                 ( iCodecInfo.iKeepalivePT != codecInfo.iKeepalivePT ||
   228                 ( iCodecInfo.iKeepalivePT != codecInfo.iKeepalivePT ||
   235                 iCodecInfo.iKeepaliveInterval != codecInfo.iKeepaliveInterval ||
   229                 iCodecInfo.iKeepaliveInterval != codecInfo.iKeepaliveInterval ||
   236                 iCodecInfo.iKeepaliveData != codecInfo.iKeepaliveData ) &&
   230                 iCodecInfo.iKeepaliveData != codecInfo.iKeepaliveData ) &&
   237                 0 != codecInfo.iKeepaliveInterval ||
   231                 0 != codecInfo.iKeepaliveInterval;
   238 				iRtpKeepaliveUpdatePending;
       
   239             
   232             
   240             if ( updateNeeded )
   233             if ( updateNeeded )
   241                 {
   234                 {
   242 				if ( iRtpMediaClock )
   235                 TRACE_RTP_INTERFACE_PRINT( 
   243 					{
   236                     "MMccRtpInterface::ConfigureL - Update" )
   244 	                TRACE_RTP_INTERFACE_PRINT( 
   237                 
   245 	                    "MMccRtpInterface::ConfigureL - Update" )
   238                 iCodecInfo.iKeepalivePT = codecInfo.iKeepalivePT;
   246 	                
   239                 iCodecInfo.iKeepaliveInterval = codecInfo.iKeepaliveInterval;
   247 	                iCodecInfo.iKeepalivePT = codecInfo.iKeepalivePT;
   240                 iCodecInfo.iKeepaliveData = codecInfo.iKeepaliveData;
   248 	                iCodecInfo.iKeepaliveInterval = codecInfo.iKeepaliveInterval;
   241                 iRtpKeepalive->UpdateParamsL( *this, codecInfo );
   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 					}
       
   259                 }
   242                 }
   260             }
   243             }
   261         }
   244         }
   262     else
   245     else
   263         {
   246         {
   376 //        
   359 //        
   377 TBool MMccRtpInterface::IsSending() const
   360 TBool MMccRtpInterface::IsSending() const
   378     {
   361     {
   379     return EFalse;
   362     return EFalse;
   380     }
   363     }
   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 	}        
       
   437         
   364         
   438 // -----------------------------------------------------------------------------
   365 // -----------------------------------------------------------------------------
   439 // MMccRtpInterface::SendInternalRtpEventToClient
   366 // MMccRtpInterface::SendInternalRtpEventToClient
   440 // -----------------------------------------------------------------------------
   367 // -----------------------------------------------------------------------------
   441 //   
   368 //