rtp/rtpstack/src/rtpsession.cpp
changeset 33 b8a7e07b2677
parent 30 d7640adb246b
--- a/rtp/rtpstack/src/rtpsession.cpp	Mon Jun 28 19:10:29 2010 +0300
+++ b/rtp/rtpstack/src/rtpsession.cpp	Fri Jul 09 13:15:39 2010 +0300
@@ -573,6 +573,23 @@
             }
     }
 
+
+// ---------------------------------------------------------------------------
+// TInt CRtpSession::ReadyToSendRtpPacket()
+// 
+// ---------------------------------------------------------------------------
+//
+void CRtpSession::ReadyToSendRtpPacket(TRtpId aTranStreamId)
+    {
+    if ( iRtpPacketObserver )
+        {
+        RTP_DEBUG_DETAIL("Giving ReadyToSendRtpPacket() Call Back " );
+        TPtr8 pktPtr(iPktSnd->Data(), iPktSnd->Size(), iPktSnd->Size());
+        iRtpPacketObserver->ReadyToSendRtpPacket( aTranStreamId , pktPtr );
+        }   
+    }
+
+
 // ---------------------------------------------------------------------------
 // TInt CRtpSession::SendRtpPacket()
 // 
@@ -580,7 +597,8 @@
 //
 TInt CRtpSession::SendRtpPacket( TRtpId aTranStreamId,
                                  const TRtpSendHeader& aHeaderInfo, 
-                                 const TDesC8& aPayloadData )
+                                 const TDesC8& aPayloadData,
+                                 const TArray<TRtpCSRC> *aCsrcList )
     {
     if ( static_cast<TUint> (aPayloadData.Size()) > iCommNet->MaxSocketSize() )
     	{
@@ -595,12 +613,16 @@
         {
         CRtpTranStream* tempStream = ( CRtpTranStream* ) streamAddress;
         tempStream->BuildRtpPacket( aHeaderInfo, aPayloadData, 0, EFalse,
-                                    iPktSnd );
+                                    iPktSnd, aCsrcList );
+        
+        ReadyToSendRtpPacket(aTranStreamId);
+        
         ret = iCommNet->Send( ERTPPort, iPktSnd->Des() );
         }
     return ret;
     }
 
+
 // ---------------------------------------------------------------------------
 // TInt CRtpSession::SendRtpPacket()
 // 
@@ -609,7 +631,8 @@
 TInt CRtpSession::SendRtpPacket( TRtpId aTranStreamId,
                                  const TRtpSendHeader& aHeaderInfo,
                                  const TDesC8& aPayloadData,
-                                 TRequestStatus& aStatus )
+                                 TRequestStatus& aStatus,
+                                 const TArray<TRtpCSRC> *aCsrcList )
     {
     if ( static_cast<TUint>( aPayloadData.Size() ) > iCommNet->MaxSocketSize() )
     	{
@@ -625,7 +648,10 @@
         CRtpTranStream* tempStream =
             reinterpret_cast<CRtpTranStream*>( streamAddress );
         tempStream->BuildRtpPacket( aHeaderInfo, aPayloadData, 0, EFalse,
-                                    iPktSnd );
+                                    iPktSnd, aCsrcList );
+									
+        ReadyToSendRtpPacket(aTranStreamId);
+			
         iCommNet->Send( ERTPPort, iPktSnd->Des(), aStatus );
         }
     return ret;
@@ -707,7 +733,8 @@
                                  TRtpSequence aSequenceNum,
                                  const TRtpSendHeader& aHeaderInfo,
                                  const TDesC8& aPayloadData,
-                                 TRequestStatus& aStatus )
+                                 TRequestStatus& aStatus,
+                                 const TArray<TRtpCSRC> *aCsrcList )
     {
     if ( static_cast<TUint>( aPayloadData.Size() ) > iCommNet->MaxSocketSize() )
     	{
@@ -723,7 +750,10 @@
         CRtpTranStream* tempStream =
             reinterpret_cast<CRtpTranStream*>( streamAddress );
         tempStream->BuildRtpPacket( aHeaderInfo, aPayloadData, aSequenceNum,
-                                    ETrue, iPktSnd );
+                                    ETrue, iPktSnd, aCsrcList );
+        
+        ReadyToSendRtpPacket(aTranStreamId);								
+									
         iCommNet->Send( ERTPPort, iPktSnd->Des(), aStatus );
         }
     return ret;
@@ -1146,6 +1176,29 @@
         }                   
     }
 
+
+// ---------------------------------------------------------------------------
+// TInt CRtpSession::RegisterRtpPostProcessingObserver()
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CRtpSession::RegisterRtpPostProcessingObserver( MRtpPostProcessingObserver& aRTPPacketObserver )
+    {
+    iRtpPacketObserver = &aRTPPacketObserver;  
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CRtpSession::UnregisterRtpPostProcessingObserver()
+// 
+// ---------------------------------------------------------------------------
+//
+void CRtpSession::UnregisterRtpPostProcessingObserver()
+    {
+    iRtpPacketObserver = NULL;
+    }
+
 // ---------------------------------------------------------------------------
 // TInt CRtpSession::RegisterRtcpObserver()
 //