--- a/ipappprotocols_plat/rtprtcp_api/inc/rtpapi.h Fri May 28 16:13:10 2010 +0300
+++ b/ipappprotocols_plat/rtprtcp_api/inc/rtpapi.h Thu Jun 24 14:43:49 2010 +0300
@@ -334,7 +334,15 @@
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
TRequestStatus& aStatus );
-
+
+ /**
+ * Send an RTP data packet, with a given CSRC list.
+ * @param aHeaderInfo - [input] TRtpSendPktParam and CSRC list.
+ * @return KErrNone if successful; system wide error code otherwise
+ */
+ IMPORT_C TInt SendRtpPacket( const TRtpSendPktParams& aSendPktParam,
+ TArray<TRtpCSRC> aCSRCList);
+
/**
* Send a non-RTP (control) data packet asynchronously
@@ -533,8 +541,30 @@
* @return KErrNone.
*/
IMPORT_C TInt NotInUseSetNonRTPDataObserver( );
-
-
+
+
+ /**
+ * Register a callback object for Send RTP data packets from an RTP
+ * Session. Only one Sender callback object is allowed to be
+ * registered for one Session.
+ * MRTPPacketObserver::ReadyToSendRtpPacket function from aRtpObserver object is
+ * called when an RTP data packet is received.
+ * @param aSessionId - [input] RTP Session ID
+ * @param aRtpObserver - [input] Callback object to receive RTP packets
+ * @return KErrNone if successful; system wide error code otherwise
+ */
+ IMPORT_C TInt RegisterRtpPostProcessingObserver( TRtpId aSessionId,
+ MRtpPostProcessingObserver& aRtpObserver );
+
+
+ /**
+ * Unregister RTP Packet observer callback object associated with an RTP
+ * session.
+ * @param aSessionId - [input] RTP Session ID
+ * @return None
+ */
+ IMPORT_C void UnregisterRtpPostProcessingObserver( TRtpId aSessionId );
+
private:
/**
* C++ default constructor.
--- a/ipappprotocols_plat/rtprtcp_api/inc/rtpdef.h Fri May 28 16:13:10 2010 +0300
+++ b/ipappprotocols_plat/rtprtcp_api/inc/rtpdef.h Thu Jun 24 14:43:49 2010 +0300
@@ -34,6 +34,7 @@
const TUint KMaxSdesItemSize = 255;
const TUint KSocketBufSize = 4096;
const TInt KMinRtpHeaderSize = 12; // 96 bits in header, 96/8 = 12
+const TInt KMaxCsrcIdentifiers = 15;
// DATA TYPES
@@ -41,6 +42,7 @@
const TRtpId KNullId = 0xffffffff;
typedef TUint32 TRtpSSRC; //
+typedef TUint32 TRtpCSRC; //
typedef TUint8 TRtpPayloadType; // payload type of the RTP packet
typedef TUint16 TRtpSequence; // sequence number of the RTP packet
typedef TUint32 TRtpTimeStamp; // timestamp of the RTP packet
@@ -55,6 +57,7 @@
// FORWARD DECLARATIONS
class TRtpSendHeader;
class TRtpRecvHeader;
+class TRtpSendPktParams;
// CLASS DECLARATION
@@ -206,6 +209,30 @@
};
+/**
+* Header class for sending RTP Packets
+*
+* @lib RtpService.dll
+*/
+class TRtpSendPktParams
+ {
+public:
+
+ TRtpSendPktParams(TRtpSendHeader &aHeaderInfo);
+
+ TRtpId iTranStreamId; // Transtream Id
+ TRtpSendHeader &iHeaderInfo; // Standard fixed header of RTP packet to send.
+ TPtrC8 iPayloadData; // Payload
+ TRequestStatus *iStatus;
+ TRtpSequence *iSequenceNum; // Sequence Number
+ };
+
+inline TRtpSendPktParams::TRtpSendPktParams(TRtpSendHeader &aHeaderInfo) : iTranStreamId( 0 ),
+ iHeaderInfo( aHeaderInfo ),
+ iStatus( 0 ),
+ iSequenceNum( 0 )
+ {
+ };
/**
* An interface to the callback functions for asynchronous event
@@ -318,4 +345,23 @@
};
+
+/**
+* callback functions for Send RTP packets.
+*
+* @lib RtpService.dll
+*/
+class MRtpPostProcessingObserver
+ {
+ public:
+ /**
+ * Callback function to receive a handle to RTP packet which is ready to send.
+ * @param TRtpId aTranStreamId - Transimission stream id
+ * @param TPtr8 &aPacket - RTP packet Ready to send
+ * @return None
+ */
+ virtual void ReadyToSendRtpPacket( TRtpId aTranStreamId, TPtr8 &aPacket ) = 0;
+
+ };
+
#endif // __RTPDEF_H
--- a/realtimenetprots/rtp/cfrtp/src/rtpflowfactory.cpp Fri May 28 16:13:10 2010 +0300
+++ b/realtimenetprots/rtp/cfrtp/src/rtpflowfactory.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -96,7 +96,7 @@
protocolDescription->iServiceInfo = KSIConnectionLess | KSIDatagram |
KSIGracefulClose | KSIPeekData |
KSIRequiresOwnerInfo;
- protocolDescription->iNamingServices = KNSNameResolution | KNSRequiresConnectionStartup;
+ protocolDescription->iNamingServices = 0;
protocolDescription->iSecurity = KSocketNoSecurity;
protocolDescription->iMessageSize = 65536-128; /*KSocketMessageSizeUndefined;*/
protocolDescription->iServiceTypeInfo = ESocketSupport | ETransport |
@@ -116,7 +116,7 @@
protocolDescription->iServiceInfo = KSIConnectionLess | KSIDatagram |
KSIGracefulClose | KSIPeekData |
KSIRequiresOwnerInfo;
- protocolDescription->iNamingServices = KNSNameResolution | KNSRequiresConnectionStartup;
+ protocolDescription->iNamingServices = 0;
protocolDescription->iSecurity = KSocketNoSecurity;
protocolDescription->iMessageSize = 65536-128; /*KSocketMessageSizeUndefined;*/
protocolDescription->iServiceTypeInfo = ESocketSupport | ETransport |
--- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CReceiverTcp.cpp Fri May 28 16:13:10 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CReceiverTcp.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -149,8 +149,8 @@
iContext.SocketContainer().CancelRecv();
}
else
- {
- iContext.SocketContainer().Socket().CancelAll();
+ {
+ iContext.SocketContainer().CancelAll();
}
RemoveReceived();
}
--- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.cpp Fri May 28 16:13:10 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -237,5 +237,21 @@
CSocketContainer( aSocket )
{
}
-
+
+// -----------------------------------------------------------------------------
+// CSecureSocketContainer::CancelAll
+// -----------------------------------------------------------------------------
+//
+void CSecureSocketContainer::CancelAll()
+ {
+ if ( HasSecureSocket() )
+ {
+ iSecureSocket->CancelAll();
+ }
+ else
+ {
+ CSocketContainer::CancelAll();
+ }
+ }
+
// End of file
--- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.h Fri May 28 16:13:10 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.h Thu Jun 24 14:43:49 2010 +0300
@@ -66,6 +66,8 @@
void CancelConnect();
+ void CancelAll();
+
void RemoteName( TSockAddr& aAddr );
TInt SetOpt( TUint aOptionName, TUint aOptionLevel, const TDesC8& aOption );
--- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.cpp Fri May 28 16:13:10 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -192,5 +192,14 @@
CSocketContainer::CSocketContainer( RSocket& aSocket ) : iSocket( aSocket )
{
}
-
+
+// -----------------------------------------------------------------------------
+// CSocketContainer::CancelAll
+// -----------------------------------------------------------------------------
+//
+void CSocketContainer::CancelAll()
+ {
+ iSocket.CancelAll();
+ }
+
// End of file
--- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.h Fri May 28 16:13:10 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.h Thu Jun 24 14:43:49 2010 +0300
@@ -72,6 +72,8 @@
virtual void CancelConnect();
+ virtual void CancelAll();
+
virtual void RemoteName( TSockAddr& aAddr );
virtual TInt SetOpt( TUint aOptionName,
--- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp Fri May 28 16:13:10 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -274,7 +274,7 @@
if ( IsConnectedTransport() )
{
TResponseRoute route( id, aRemoteAddr );
- iIDArray.Append( route );
+ iIDArray.AppendL( route );
}
TRAP( leaveValue,
receiver->ReceiveL( static_cast<CSIPRequest*>( aMessage ) ) );
@@ -1455,39 +1455,44 @@
RStringF transportParam =
uri.SIPURI()->ParamValue(
SIPStrings::StringF( SipStrConsts::ETransport ) );
-
- if ( Protocol() == KProtocolTls )
+
+ RStringF tls = SIPStrings::StringF( SipStrConsts::ETLS );
+ //If the Contact header has parameter transport=tls, remove it
+ //as it is deprecated in RFC 3261
+ if(transportParam == tls)
+ {
+ uri.SIPURI()->DeleteParam(SIPStrings::StringF( SipStrConsts::ETransport ));
+ }
+
+ //If the message is CSIPRequest, make sure its scheme is as per From Header.
+ //So if the FROM header is SIPS, Contact header is SIPS, if FROM header is SIP,
+ //Contact header scheme is sip
+ if(aMessage->IsRequest())
{
- RStringF tls = SIPStrings::StringF( SipStrConsts::ETLS );
- // SIP Scheme in Contact header should be same as From Header
- CURIContainer& FromUri = (((aMessage->From())->SIPAddress()).URI());
- if(FromUri.IsSIPURI())
- {
- CSIPURI* FromSIPUri =FromUri.SIPURI();
- if(FromSIPUri->IsSIPSURI())
+ if ( Protocol() == KProtocolTls )
+ {
+ CURIContainer& FromUri = (((aMessage->From())->SIPAddress()).URI());
+ if(FromUri.IsSIPURI())
{
- uri.SIPURI()->SetSIPS( ETrue );
- }
- else
- {
- uri.SIPURI()->SetSIPS( EFalse );
+ CSIPURI* FromSIPUri =FromUri.SIPURI();
+ if(FromSIPUri->IsSIPSURI())
+ {
+ uri.SIPURI()->SetSIPS( ETrue );
+ }
+ else
+ {
+ uri.SIPURI()->SetSIPS( EFalse );
+ }
}
- }
- if(transportParam == tls)
+ }
+ else
{
- //uri.SIPURI()->SetSIPS(EFalse);
- //Delete the param transport=tls from the URI as it is deprecated in RFC 3261
- uri.SIPURI()->DeleteParam(SIPStrings::StringF( SipStrConsts::ETransport ));
+ uri.SIPURI()->SetSIPS( EFalse );
}
- }
- else
- {
- uri.SIPURI()->SetSIPS( EFalse );
- }
- }
- }
- }
-
+ } //end if (aMessage->IsRequest)
+ } //end if (uri.IsSIPURI())
+ } //end if(sipaddr)
+ } //end while
}
// -----------------------------------------------------------------------------
--- a/rtp/rtpstack/bwins/rtpserviceu.def Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/bwins/rtpserviceu.def Thu Jun 24 14:43:49 2010 +0300
@@ -44,4 +44,7 @@
?UnregisterRtpObserver@CRtpAPI@@QAEXK@Z @ 43 NONAME ; void CRtpAPI::UnregisterRtpObserver(unsigned long)
?Version@CRtpAPI@@QBE?AVTVersion@@XZ @ 44 NONAME ; class TVersion CRtpAPI::Version(void) const
?CreateSessionL@CRtpAPI@@QAEKABVTCreateSessionParams@@AAIHPBVTRtcpParams@@AAVCSRTPSession@@@Z @ 45 NONAME ; unsigned long CRtpAPI::CreateSessionL(class TCreateSessionParams const &, unsigned int &, int, class TRtcpParams const *, class CSRTPSession &)
+ ?SendRtpPacket@CRtpAPI@@QAEHABVTRtpSendPktParams@@V?$TArray@K@@@Z @ 46 NONAME ; int CRtpAPI::SendRtpPacket(class TRtpSendPktParams const &, class TArray<unsigned long>)
+ ?RegisterRtpPostProcessingObserver@CRtpAPI@@QAEHKAAVMRtpPostProcessingObserver@@@Z @ 47 NONAME ; int CRtpAPI::RegisterRtpPostProcessingObserver(unsigned long, class MRtpPostProcessingObserver &)
+ ?UnregisterRtpPostProcessingObserver@CRtpAPI@@QAEXK@Z @ 48 NONAME ; void CRtpAPI::UnregisterRtpPostProcessingObserver(unsigned long)
--- a/rtp/rtpstack/eabi/rtpserviceu.def Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/eabi/rtpserviceu.def Thu Jun 24 14:43:49 2010 +0300
@@ -74,3 +74,7 @@
_ZTI12CRtpSendItem @ 73 NONAME ; #<TI>#
_ZTI15CRtpSessionSrtp @ 74 NONAME ; #<TI>#
_ZTV15CRtpSessionSrtp @ 75 NONAME ; #<VT>#
+ _ZN7CRtpAPI13SendRtpPacketERK17TRtpSendPktParams6TArrayImE @ 76 NONAME
+ _ZN7CRtpAPI33RegisterRtpPostProcessingObserverEmR26MRtpPostProcessingObserver @ 77 NONAME
+ _ZN7CRtpAPI35UnregisterRtpPostProcessingObserverEm @ 78 NONAME
+
--- a/rtp/rtpstack/inc/rtpmanager.h Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/inc/rtpmanager.h Thu Jun 24 14:43:49 2010 +0300
@@ -135,24 +135,31 @@
TInt RegisterRtpObserver( TRtpId aSessionId, MRtpObserver& aObserver );
void UnregisterRtpObserver( TRtpId aSessionId );
+
+ TInt RegisterRtpPostProcessingObserver( TRtpId aSessionId, MRtpPostProcessingObserver& aRtpObserver );
+
+ void UnregisterRtpPostProcessingObserver( TRtpId aSessionId );
TInt SetNonRTPDataObserver( TRtpId aSessionId,
MNonRTPDataObserver* aNonRTPDataObserver );
TInt SendRtpPacket( TRtpId aTranStreamId,
const TRtpSendHeader& aHeaderInfo,
- const TDesC8& aPayloadData );
+ const TDesC8& aPayloadData,
+ const TArray<TRtpCSRC> *aCsrcList = NULL );
TInt SendRtpPacket( TRtpId aTranStreamId,
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
- TRequestStatus& aStatus );
+ TRequestStatus& aStatus,
+ const TArray<TRtpCSRC> *aCsrcList = NULL );
TInt SendRtpPacket( TRtpId aTranStreamId,
TRtpSequence aSequenceNum,
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
- TRequestStatus& aStatus );
+ TRequestStatus& aStatus,
+ const TArray<TRtpCSRC> *aCsrcList = NULL );
void SendDataL( TRtpId aSessionId,
TBool aUseRTPSocket,
--- a/rtp/rtpstack/inc/rtppacketparam.h Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/inc/rtppacketparam.h Thu Jun 24 14:43:49 2010 +0300
@@ -184,6 +184,7 @@
TUint32* CSRCarray;
TUint8* payloadData;
TInt payloadDataLen;
+ const TArray<TRtpCSRC> *iCsrcList;
public://Nested class
/**
--- a/rtp/rtpstack/inc/rtpsession.h Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/inc/rtpsession.h Thu Jun 24 14:43:49 2010 +0300
@@ -108,16 +108,20 @@
TInt RegisterRtpObserver( MRtpObserver& aObserver );
void UnregisterRtpObserver();
+
+ TInt RegisterRtpPostProcessingObserver( MRtpPostProcessingObserver& aObserver );
+ void UnregisterRtpPostProcessingObserver();
TInt SetNonRTPDataObserver( MNonRTPDataObserver* aNonRTPDataObserver );
TInt SendRtpPacket( TRtpId aTranStreamId, const TRtpSendHeader& aHeaderInfo,
- const TDesC8& aPayloadData );
+ const TDesC8& aPayloadData, const TArray<TRtpCSRC> *aCsrcList = NULL );
TInt SendRtpPacket( TRtpId aTranStreamId,
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
- TRequestStatus& aStatus );
+ TRequestStatus& aStatus,
+ const TArray<TRtpCSRC> *aCsrcList = NULL );
TInt SendRtpPacket( const TRtpSendHeader& aHeaderInfo, const TDesC8& aPayloadData );
@@ -128,7 +132,8 @@
TRtpSequence aSequenceNum,
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
- TRequestStatus& aStatus );
+ TRequestStatus& aStatus,
+ const TArray<TRtpCSRC> *aCsrcList = NULL );
void SendData( TBool aUseRTPSocket,
const TDesC8& aData,
@@ -162,6 +167,8 @@
* disabled; system wide error code otherwise
*/
TInt IsRtcpSendingSuspended( TBool& aAutoSending );
+
+ void ReadyToSendRtpPacket(TRtpId aTranStreamId);
public: // from MSsrcCheckCallback
/**
@@ -454,6 +461,7 @@
MNonRTPDataObserver* iNonRTPDataObserver;
MRtpErrNotify& iErrNotify;
MRtpAsignUniqueID& iAssignUniqueID;
+ MRtpPostProcessingObserver* iRtpPacketObserver;
TBool iSessionStarted;
--- a/rtp/rtpstack/inc/rtpsessionsrtp.h Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/inc/rtpsessionsrtp.h Thu Jun 24 14:43:49 2010 +0300
@@ -55,19 +55,21 @@
~CRtpSessionSrtp();
TInt SendRtpPacket( TRtpId aTranStreamId, const TRtpSendHeader& aHeaderInfo,
- const TDesC8& aPayloadData );
+ const TDesC8& aPayloadData, const TArray<TRtpCSRC> *aCsrcList = NULL );
TInt SendRtpPacket( TRtpId aTranStreamId,
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
- TRequestStatus& aStatus );
+ TRequestStatus& aStatus,
+ const TArray<TRtpCSRC> *aCsrcList = NULL);
TInt SendRtpPacket( TRtpId aTranStreamId,
TRtpSequence aSequenceNum,
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
- TRequestStatus& aStatus );
+ TRequestStatus& aStatus,
+ const TArray<TRtpCSRC> *aCsrcList = NULL );
//TInt SendRtcpByePacket( TRtpId aTranStreamId, const TDesC8& aReason );
//TInt SendRtcpAppPacket( TRtpId aTranStreamId, const TRtcpApp& aApp );
--- a/rtp/rtpstack/inc/rtptranstream.h Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/inc/rtptranstream.h Thu Jun 24 14:43:49 2010 +0300
@@ -49,7 +49,8 @@
const TDesC8& aPayloadData,
TRtpSequence aSeqNum,
TBool aSetSeqNum,
- CRtpPacket* aPktSnd );
+ CRtpPacket* aPktSnd,
+ const TArray<TRtpCSRC> *aCsrcList = NULL);
TInt BuildRtcpBYEPacket( const TDesC8& aReason,
CRtpPacket* aPktRtcpSnd );
--- a/rtp/rtpstack/src/rtpapi.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/src/rtpapi.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -389,6 +389,56 @@
{
return iManager->SendRtpPacket( aTranStreamId, aHeaderInfo, aPayloadData, aStatus );
}
+
+
+// ---------------------------------------------------------------------------
+// TInt CRtpAPI::RegisterRtpPostProcessingObserver()
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CRtpAPI::RegisterRtpPostProcessingObserver( TRtpId aSessionId,
+ MRtpPostProcessingObserver& aRtpPacketObserver )
+ {
+ return iManager->RegisterRtpPostProcessingObserver( aSessionId, aRtpPacketObserver );
+ }
+
+
+// ---------------------------------------------------------------------------
+// CRtpAPI::UnregisterRtpPostProcessingObserver()
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRtpAPI::UnregisterRtpPostProcessingObserver( TRtpId aSessionId )
+ {
+ iManager->UnregisterRtpPostProcessingObserver( aSessionId );
+ }
+
+
+// ---------------------------------------------------------------------------
+// TInt CRtpAPI::SendRtpPacket()
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CRtpAPI::SendRtpPacket(const TRtpSendPktParams& aSendPktParam , TArray<TRtpCSRC> aCSRCList)
+ {
+ if(!aSendPktParam.iStatus)
+ {
+ //SYNC Version
+ return iManager->SendRtpPacket( aSendPktParam.iTranStreamId, aSendPktParam.iHeaderInfo,
+ aSendPktParam.iPayloadData, &aCSRCList );
+ }
+ else if (!aSendPktParam.iSequenceNum) //ASYNC Versions With and Without SEQ Number
+ {
+ return iManager->SendRtpPacket( aSendPktParam.iTranStreamId, aSendPktParam.iHeaderInfo,
+ aSendPktParam.iPayloadData, *aSendPktParam.iStatus, &aCSRCList );
+ }
+ else
+ {
+ return iManager->SendRtpPacket( aSendPktParam.iTranStreamId, *aSendPktParam.iSequenceNum, aSendPktParam.iHeaderInfo,
+ aSendPktParam.iPayloadData, *aSendPktParam.iStatus, &aCSRCList );
+ }
+ }
+
// ---------------------------------------------------------------------------
// TInt CRtpAPI::SendData()
--- a/rtp/rtpstack/src/rtpmanager.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/src/rtpmanager.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -721,6 +721,47 @@
return result;
}
+
+// ---------------------------------------------------------------------------
+// TInt CRtpManager::RegisterRtpPostProcessingObserver()
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRtpManager::RegisterRtpPostProcessingObserver( TRtpId aSessionId, MRtpPostProcessingObserver& aRtpPacketObserver )
+ {
+ CRtpSession* session = GetSession( aSessionId );
+ TInt result( KErrGeneral );
+ if ( session )
+ {
+ result = session->RegisterRtpPostProcessingObserver( aRtpPacketObserver );
+ }
+ else
+ {
+ RTP_DEBUG_DETAIL( "CRtpManager::RegisterRtpPostProcessingObserver, Session not found" );
+ }
+ return result;
+ }
+
+
+// ---------------------------------------------------------------------------
+// CRtpManager::UnregisterRtpPostProcessingObserver()
+//
+// ---------------------------------------------------------------------------
+//
+void CRtpManager::UnregisterRtpPostProcessingObserver( TRtpId aSessionId )
+ {
+ CRtpSession* session = GetSession( aSessionId );
+
+ if ( session )
+ {
+ session->UnregisterRtpPostProcessingObserver();
+ }
+ else
+ {
+ RTP_DEBUG_DETAIL( "CRtpManager::UnregisterRtpPostProcessingObserver, Session not found" );
+ }
+ }
+
// ---------------------------------------------------------------------------
// CRtpManager::UnregisterRtpObserver()
//
@@ -773,7 +814,8 @@
//
TInt CRtpManager::SendRtpPacket( TRtpId aTranStreamId,
const TRtpSendHeader& aHeaderInfo,
- const TDesC8& aPayloadData )
+ const TDesC8& aPayloadData,
+ const TArray<TRtpCSRC> *aCsrcList)
{
CRtpSession* rtpSession = GetSession( aTranStreamId );
@@ -786,13 +828,13 @@
return static_cast<CRtpSessionSrtp*>
(rtpSession)->SendRtpPacket( aTranStreamId, aHeaderInfo,
- aPayloadData );
+ aPayloadData, aCsrcList );
}
else
{
return rtpSession->SendRtpPacket( aTranStreamId, aHeaderInfo,
- aPayloadData );
+ aPayloadData, aCsrcList );
}
}
else
@@ -815,7 +857,8 @@
TInt CRtpManager::SendRtpPacket( TRtpId aTranStreamId,
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
- TRequestStatus& aStatus )
+ TRequestStatus& aStatus,
+ const TArray<TRtpCSRC> *aCsrcList)
{
CRtpSession* rtpSession = GetSession( aTranStreamId );
@@ -828,13 +871,13 @@
return static_cast<CRtpSessionSrtp*>
(rtpSession)->SendRtpPacket( aTranStreamId, aHeaderInfo,
- aPayloadData, aStatus );
+ aPayloadData, aStatus, aCsrcList );
}
else
{
return rtpSession->SendRtpPacket( aTranStreamId, aHeaderInfo,
- aPayloadData, aStatus );
+ aPayloadData, aStatus, aCsrcList );
}
}
@@ -860,7 +903,8 @@
TRtpSequence aSequenceNum,
const TRtpSendHeader& aHeaderInfo,
const TDesC8& aPayloadData,
- TRequestStatus& aStatus )
+ TRequestStatus& aStatus,
+ const TArray<TRtpCSRC> *aCsrcList )
{
CRtpSession* rtpSession = GetSession( aTranStreamId );
TInt result( KErrNone );
@@ -874,14 +918,14 @@
result = static_cast<CRtpSessionSrtp*>
(rtpSession)->SendRtpPacket( aTranStreamId, aSequenceNum,
aHeaderInfo, aPayloadData,
- aStatus );
+ aStatus, aCsrcList );
}
else
{
result = rtpSession->SendRtpPacket( aTranStreamId, aSequenceNum,
aHeaderInfo, aPayloadData,
- aStatus );
+ aStatus, aCsrcList );
}
}
--- a/rtp/rtpstack/src/rtppacket.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/src/rtppacket.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -123,8 +123,8 @@
* *
* 2 bit = version *
* 1 bit = padding *
- * 1 bit = CRSRC Count *
- * 4 bit = extension *
+ * 1 bit = extension *
+ * 4 bit = CRSRC Count *
****************************/
//version (2 bit)
@@ -143,13 +143,17 @@
dataP[0] |= ( 1 << 4 );
}
- // CC = 0 (1 bit)
+ // CC 4 bit)
+ if( aInitParam->TRTP.numCSRC)
+ {
+ dataP[0] |= aInitParam->TRTP.numCSRC;
+ }
/****************************
* dataP[1] = 8 bit *
* *
* 1 bit = marker *
- * 1 bit = payload type *
+ * 7 bits = payload type *
****************************/
// marker (1 bit)
@@ -182,6 +186,15 @@
//set the pointer to point to the first bit after SSRC
dataP += 4;
+
+
+ //Set CSRC if Present
+ for(TInt count = 0; count<aInitParam->TRTP.numCSRC; count++)
+ {
+ Write32( dataP, (*aInitParam->TRTP.iCsrcList)[count]);
+ dataP += 4;
+ }
+
if ( aInitParam->TRTP.fHeaderExtension )
{
@@ -675,7 +688,7 @@
// Originally Allocate memory for all CSRC:s
//it will have memeory resouce problem so only allocate when
// CSRC<2
- if ( aExtractParam->TRTP.numCSRC < KCSRCListMax )
+ if ( aExtractParam->TRTP.numCSRC <= KCSRCListMax )
{
if ( !aExtractParam->TRTP.CSRCarray )
{
--- a/rtp/rtpstack/src/rtppacketparam.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/src/rtppacketparam.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -115,6 +115,7 @@
CSRCarray( NULL ),
payloadData( NULL ),
payloadDataLen( 0 ),
+ iCsrcList(0),
extension()
{
}
--- a/rtp/rtpstack/src/rtprecvstream.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/src/rtprecvstream.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -241,6 +241,11 @@
iHdr.iPadding = extractParam.TRTP.padding;
iHdr.iExtension = extractParam.TRTP.fHeaderExtension;
iHdr.iCsrcCount = extractParam.TRTP.numCSRC;
+
+ if ( iHdr.iCsrcCount )
+ {
+ iHdr.iCsrcList = extractParam.TRTP.CSRCarray;
+ }
iHdr.iMarker = extractParam.TRTP.marker;
iHdr.iTimestamp = streamParam.TRTP.timeStamp;
--- a/rtp/rtpstack/src/rtpsession.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/src/rtpsession.cpp Thu Jun 24 14:43:49 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()
//
--- a/rtp/rtpstack/src/rtpsessionsrtp.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/src/rtpsessionsrtp.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -117,7 +117,8 @@
TInt CRtpSessionSrtp::SendRtpPacket( TRtpId aTranStreamId,
const TRtpSendHeader& aHeaderInfo,
- const TDesC8& aPayloadData )
+ const TDesC8& aPayloadData,
+ const TArray<TRtpCSRC> *aCsrcList )
{
if ( static_cast<TUint> (aPayloadData.Size()) > iCommNet->MaxSocketSize() )
{
@@ -132,7 +133,7 @@
{
CRtpTranStream* tempStream = ( CRtpTranStream* ) streamAddress;
tempStream->BuildRtpPacket( aHeaderInfo, aPayloadData, 0, EFalse,
- iPktSnd );
+ iPktSnd, aCsrcList );
if(iSndPacket)
{
@@ -159,7 +160,8 @@
TInt CRtpSessionSrtp::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() )
{
@@ -174,7 +176,7 @@
{
CRtpTranStream* tempStream = ( CRtpTranStream* ) streamAddress;
tempStream->BuildRtpPacket( aHeaderInfo, aPayloadData, 0, EFalse,
- iPktSnd );
+ iPktSnd, aCsrcList );
if(iSndPacket)
{
delete iSndPacket;
@@ -202,7 +204,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() )
{
@@ -218,7 +221,7 @@
CRtpTranStream* tempStream =
reinterpret_cast<CRtpTranStream*>( streamAddress );
tempStream->BuildRtpPacket( aHeaderInfo, aPayloadData, aSequenceNum,
- ETrue, iPktSnd );
+ ETrue, iPktSnd, aCsrcList );
if(iSndPacket)
{
delete iSndPacket;
--- a/rtp/rtpstack/src/rtptranstream.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/src/rtptranstream.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -187,7 +187,8 @@
const TDesC8& aPayloadData,
TRtpSequence aSeqNum,
TBool aSetSeqNum,
- CRtpPacket* aPktSnd )
+ CRtpPacket* aPktSnd,
+ const TArray<TRtpCSRC> *aCsrcList)
{
TRtpPacketStreamParam streamParam;
TRtpPacketIOParam inParam;
@@ -234,6 +235,21 @@
inParam.TRTP.payloadData = const_cast<TUint8*>( aPayloadData.Ptr() );
inParam.TRTP.payloadDataLen = aPayloadData.Length();
+
+ if(aCsrcList && aCsrcList->Count())
+ {
+ // Maxm 15 CSRC identifiers will be supported
+ if( aCsrcList->Count() <= KMaxCsrcIdentifiers )
+ {
+ inParam.TRTP.numCSRC = (TUint8)aCsrcList->Count();
+ }
+ else
+ {
+ inParam.TRTP.numCSRC = KMaxCsrcIdentifiers;
+ }
+
+ inParam.TRTP.iCsrcList = aCsrcList;
+ }
streamParam.TRTP.payload = aHeaderInfo.iPayloadType;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rtp/rtpstack/tsrc/rtptestapp/group/bld.inf Thu Jun 24 14:43:49 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+ @file
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+
+rtptestapp.mmp
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rtp/rtpstack/tsrc/rtptestapp/group/rtptestapp.mmp Thu Jun 24 14:43:49 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Application for Rtp functional testing
+*
+*/
+
+/**
+ @file
+*/
+#include<platform_paths.hrh>
+
+
+
+TARGETTYPE EXE
+TARGET rtptestapp.exe
+UID 0x1000008d 0x101F85CF
+
+SOURCEPATH ../src
+
+SOURCE rtptestapp.cpp
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY rtpservice.lib euser.lib
+LIBRARY esock.lib insock.lib
+LIBRARY commdb.lib srtp.lib
+
+DEBUGLIBRARY flogger.lib
+
+CAPABILITY All -TCB
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rtp/rtpstack/tsrc/rtptestapp/src/rtptestapp.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -0,0 +1,422 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// HEADERS
+#include <connpref.h>
+#include <es_sock.h>
+#include <commdbconnpref.h>
+#include "in_sock.h"
+#include <e32cons.h>
+#include <e32err.h>
+#include <e32std.h>
+#include <e32base.h>
+#include <badesca.h>
+#include <random.h>
+#include "rtpheader.h"
+#include "rtptestapp.h"
+
+const TUint KIAPID = 1;
+const TInt KLength = 20;
+_LIT8(KHello, "RTP APIs...testing");
+_LIT8(KNoCName, "");
+
+CConsoleBase *gConsole;
+CActiveScheduler *sched;
+
+void MainL()
+ {
+ // Create a Console
+ gConsole = Console::NewL(_L("Test Console"), TSize(KConsFullScreen, KConsFullScreen));
+ CleanupStack::PushL(gConsole);
+
+ // Create an Active scheduler
+ sched = new (ELeave) CActiveScheduler;
+ CActiveScheduler::Install(sched);
+
+ //IAP(Internet Access Point) id to be chaged as per comms dat
+ CRtpTestApp * iRtpTestApp = CRtpTestApp::NewL();
+
+ // Send RTP Packet with CSRC and Check RTP Stack
+ // Supports maximum 15 contributing sources
+ iRtpTestApp->SendRtpPacketL();
+
+ // Send RTP packet with zero length paylpoad
+ iRtpTestApp->SendZeroLengthRtpPacketL();
+
+ // Send RTP Packets and Modify packet in callback function
+ iRtpTestApp->SendRtpPacketLoopbackL();
+
+
+ User::After(5000000);
+ delete iRtpTestApp;
+ delete sched;
+ CleanupStack::PopAndDestroy(gConsole);
+
+ }
+
+CRtpTestApp * CRtpTestApp::NewL()
+{
+ gConsole->Printf(_L("RtpTestApp::NewL\n"));
+ CRtpTestApp* self = new( ELeave ) CRtpTestApp();
+ CleanupStack::PushL( self );
+
+ // To construct the objects in the second-phase of the construction
+ self->ConstructL( );
+ CleanupStack::Pop( self);
+ return self;
+}
+
+CRtpTestApp::CRtpTestApp()
+ {
+
+ }
+
+
+void CRtpTestApp::ErrorNotify( TInt /*aErrCode*/ )
+ {
+
+ }
+
+void CRtpTestApp::SdesReceived( TRtpSSRC /*aSSRC*/,
+ const TRtpSdesParams& /*aParams*/ )
+ {
+
+ }
+
+void CRtpTestApp::ByeReceived( TRtpId /*aStreamId*/, TRtpSSRC /*aSSRC*/,
+ const TDesC8& /*aReason*/ )
+ {
+
+ }
+
+void CRtpTestApp::AppReceived( TRtpId /*aStreamId*/, TRtpSSRC /*aSSRC*/,
+ const TRtcpApp& /*aApp*/ )
+ {
+
+ }
+
+void CRtpTestApp::SrReceived( TRtpId /*aStreamId*/, TRtpSSRC /*aSSRC*/,
+ const TTimeStamps& /*aTimeStamps*/ )
+ {
+
+ }
+
+void CRtpTestApp::RrReceived( TRtpId /*aStreamId*/, TRtpSSRC /*aSSRC*/ )
+ {
+
+ }
+
+void CRtpTestApp::RtpPacketReceived( TRtpId /*aStreamId*/, const TRtpRecvHeader& aHeaderInfo, const TDesC8& /*aPayloadData*/ )
+ {
+ gConsole->Printf(_L("RtpPacketReceived .. \n"));
+
+ for(int i=0; i<aHeaderInfo.iCsrcCount; i++)
+ {
+ if ( (*iCsrclist)[i] == *(aHeaderInfo.iCsrcList+i) )
+ {
+ gConsole->Printf(_L("RtpPacketReceived, Successfully\n"));
+ }
+ else
+ {
+ gConsole->Printf(_L("Malformed RTP Packet Received\n"));
+ gConsole->Printf(_L("Test Case Failed\n"));
+ }
+ }
+
+ // Check for modified Padding, header extension, Marker bit values 1
+ if( aHeaderInfo.iMarker == 0 )
+ {
+ gConsole->Printf(_L("Test Case Failed\n"));
+ }
+ }
+
+void CRtpTestApp::ReadyToSendRtpPacket( TRtpId /*aTranStreamId*/, TPtr8 &aPacket )
+ {
+ gConsole->Printf(_L("ReadyToSendRtpPacket Callback..\n"));
+
+ // Change Marker bit value from 0 to 1
+ aPacket[1] = aPacket[1] | 0x80;
+
+ TUint32* data32 = reinterpret_cast<TUint32*>(&(aPacket[8]));
+ //Change SSRC Value from
+ *data32 = ByteOrder::Swap32(0xDEADBEEF);
+ }
+
+void CrtpDataSender::RunL()
+ {
+ gConsole->Printf(_L("CrtpDataSender::RunL\n"));
+ CActiveScheduler::Stop();
+ }
+
+void CRtpTestApp::ConstructL()
+ {
+ iRtpApi = CRtpAPI::NewL(*this );
+
+ TVersion version = iRtpApi->Version();
+
+ TInt result(KErrNone);
+
+ iParams.iCName.Set(KNoCName());
+
+ iRtpApi->OpenL( iParams, NULL, NULL, NULL );
+
+ result = iRtpApi->StartConnection(KIAPID);
+ gConsole->Printf(_L("Local Ip Address %d\n"),result);
+
+ TBuf<50> addrStr;
+ TInetAddr inetaddr = iRtpApi->GetLocalIPAddressL();
+ inetaddr.Output(addrStr);
+
+ gConsole->Printf(_L("Local Ip Address %s\n"),addrStr.PtrZ());
+
+ iSessionParams.iPriority = TCreateSessionParams::EPriorityStandard;
+ iSessionParams.iSocketBufSize = KSocketBufSize;
+
+
+ iPort1 = 8000 ;
+ iPort2 = 9000;
+
+ iRtcpParams.iRtcpFraction = 10;
+ iRtcpParams.iRtcpTimeOut = 5000000;
+ iRtcpParams.iSessionBWidth = 300;
+
+ iEnableRtcp = EFalse;
+
+ //Creating New session
+ iSessionId1 = KNullId;
+ iSessionId2 = KNullId;
+ iSessionId1 = iRtpApi->CreateSessionL(iSessionParams, iPort1, iEnableRtcp, &iRtcpParams);
+ iSessionId2 = iRtpApi->CreateSessionL(iSessionParams,iPort2,EFalse,&iRtcpParams);
+
+ TInetAddr remAddress = iRtpApi->GetLocalIPAddressL();
+ remAddress.SetPort(iPort2); //Session 1 sends data to Session 2
+
+ iRtpApi->SetRemoteAddress(iSessionId1, remAddress);
+
+ iRtpApi->RegisterRtpObserver(iSessionId1, *this);
+ iRtpApi->RegisterRtcpObserver(iSessionId1, *this);
+ iRtpApi->RegisterRtpObserver(iSessionId2, *this);
+ iRtpApi->RegisterRtcpObserver(iSessionId2, *this);
+ iRtpApi->RegisterRtpPostProcessingObserver(iSessionId1, *this);
+
+ TTranStreamParams streamParams;
+ streamParams.iPayloadType = 98;
+ TRtpSSRC locSSRC;
+
+ iS1T1 = iRtpApi->CreateTransmitStreamL(iSessionId1,streamParams,locSSRC);
+
+ TRcvStreamParams rcvParams;
+ rcvParams.iPayloadType = 98;
+
+ iS2R1 = iRtpApi->CreateReceiveStreamL(iSessionId2,rcvParams);
+
+
+ /* Start both the sessions */
+ TInt ret = iRtpApi->StartSession(iSessionId1);
+ ret = iRtpApi->StartSession(iSessionId2);
+
+ iRtpApi->SetSamplingRate(98,8000);
+ }
+
+
+void CRtpTestApp::SendRtpPacketL()
+ {
+ gConsole->Printf(_L("SendRtpPackets TO Loopback address and Verify Header fields.. \n"));
+
+ TRtpSendHeader headerinfo;
+ headerinfo.iHeaderExtension = NULL;
+ headerinfo.iMarker = 0;
+ headerinfo.iPadding = 0;
+ headerinfo.iPayloadType = 98;
+ headerinfo.iTimestamp = 1000;
+
+ HBufC8* data = HBufC8::NewLC(KLength);
+ data->Des().Copy(KHello);
+
+
+ TRtpSendPktParams *header = new(ELeave) TRtpSendPktParams(headerinfo);
+ CleanupDeletePushL(header);
+ header->iTranStreamId = iS1T1;
+ header->iPayloadData.Set(data->Des());
+
+ const TUint KArrayGranularity = 15;
+
+ iCsrclist = new(ELeave) CArrayFixFlat<TUint32>(KArrayGranularity);
+
+ // Send RTP Packets with CSRC list - 17 CSRC. Max Supported CSRC list is 15.
+ iCsrclist->AppendL(100001);
+ iCsrclist->AppendL(100002);
+ iCsrclist->AppendL(100003);
+ iCsrclist->AppendL(100004);
+ iCsrclist->AppendL(100005);
+ iCsrclist->AppendL(100006);
+ iCsrclist->AppendL(100007);
+ iCsrclist->AppendL(100008);
+ iCsrclist->AppendL(100009);
+ iCsrclist->AppendL(100010);
+ iCsrclist->AppendL(100011);
+ iCsrclist->AppendL(100012);
+ iCsrclist->AppendL(100013);
+ iCsrclist->AppendL(100014);
+ iCsrclist->AppendL(100015);
+ iCsrclist->AppendL(100016);
+ iCsrclist->AppendL(100017);
+
+ iRtpApi->SetSamplingRate(headerinfo.iPayloadType, 8000);
+ TInt ret1 = iRtpApi->SendRtpPacket(*header, iCsrclist->Array());
+
+ CrtpDataSender *datasend = CrtpDataSender::NewL(iRtpApi, iS1T1);
+ CleanupStack::PushL(datasend);
+
+ datasend->SendRtpData(*header, iCsrclist->Array());
+
+ gConsole->Printf(_L("SendRtpPacket %d\n"),ret1);
+
+ CActiveScheduler::Start();
+
+ CleanupStack::PopAndDestroy(3);
+ delete iCsrclist;
+ iCsrclist = 0;
+ }
+
+
+void CRtpTestApp::SendRtpPacketLoopbackL()
+ {
+ gConsole->Printf(_L("SendRtpPackets TO Loopback address and Verify Header fields.. \n"));
+
+ TRtpSendHeader header;
+ header.iHeaderExtension = NULL;
+ header.iMarker = 0;
+ header.iPadding = 0;
+ header.iPayloadType = 98;
+ header.iTimestamp = 1000;
+
+ HBufC8* data = HBufC8::NewLC(KLength);
+ data->Des().Copy(KHello);
+
+ TRtpSendPktParams *headerinfo = new(ELeave) TRtpSendPktParams(header);
+ CleanupDeletePushL(headerinfo);
+ headerinfo->iTranStreamId = iS1T1;
+ headerinfo->iPayloadData.Set(data->Des());
+
+ const TUint KArrayGranularity = 15;
+
+ // Create CSRC list and Append CSRC identifiers
+ iCsrclist = new(ELeave) CArrayFixFlat<TUint32>(KArrayGranularity);
+
+ iCsrclist->AppendL(123456);
+ iCsrclist->AppendL(999999);
+
+ TInt error2( KErrNone );
+ // Try sending synchronously with Csrc
+ error2 = iRtpApi->SendRtpPacket(*headerinfo, iCsrclist->Array());
+ gConsole->Printf(_L("SendRtpPacket.. %d\n"), error2);
+
+ // Try sending asynchronously with CSRC
+ CrtpDataSender *datasend = CrtpDataSender::NewL(iRtpApi, iS1T1);
+ CleanupStack::PushL(datasend);
+ datasend->SendRtpData(*headerinfo, iCsrclist->Array());
+ gConsole->Printf(_L("SendRtpPacket.. %d\n"), error2);
+
+ CActiveScheduler::Start();
+
+ CleanupStack::PopAndDestroy(3);
+ delete iCsrclist;
+ iCsrclist = 0;
+ }
+
+void CRtpTestApp::SendZeroLengthRtpPacketL()
+ {
+ // Start Session on Session id
+ iRtpApi->StartSession(iSessionId1);
+
+ TInetAddr remAddress = iRtpApi->GetLocalIPAddressL();
+ remAddress.SetPort(9000); //Session 1 sends data to Session 2
+
+ iRtpApi->SetRemoteAddress(iSessionId1, remAddress);
+
+ iRtpApi->RegisterRtpObserver(iSessionId1, *this);
+ iRtpApi->RegisterRtcpObserver(iSessionId1, *this);
+ iRtpApi->RegisterRtpPostProcessingObserver(iSessionId1, *this);
+
+ //iRtpApi->SetNonRTPDataObserver(iSessionId1, *this);
+
+ TTranStreamParams tranStreamParams;
+ tranStreamParams.iPayloadType = 96;
+ TRtpSSRC ssrc = 4567890;
+
+ TRtpId streamId = iRtpApi->CreateTransmitStreamL(iSessionId1, tranStreamParams, ssrc);
+
+
+ TRtpSendHeader headerinfo;
+ headerinfo.iHeaderExtension = 0;
+ headerinfo.iPayloadType = 96;
+ headerinfo.iTimestamp = 12345678;
+
+ TRtpSendPktParams *header = new(ELeave) TRtpSendPktParams(headerinfo);
+ CleanupDeletePushL(header);
+ header->iTranStreamId = streamId;
+
+ const TUint KArrayGranularity = 15;
+
+ iCsrclist = new(ELeave) CArrayFixFlat<TUint32>(KArrayGranularity);
+
+ // Send RTP Packets with CSRC list
+ iCsrclist->AppendL(100001);
+ iCsrclist->AppendL(100002);
+
+ iRtpApi->SetSamplingRate(headerinfo.iPayloadType, 8000);
+
+ TInt ret1 = iRtpApi->SendRtpPacket(*header, iCsrclist->Array());
+
+ CrtpDataSender *datasend = CrtpDataSender::NewL(iRtpApi, streamId);
+ CleanupStack::PushL(datasend);
+ datasend->SendRtpData(*header, iCsrclist->Array());
+
+ CActiveScheduler::Start();
+
+ CleanupStack::PopAndDestroy(2);
+ delete iCsrclist;
+ iCsrclist = 0;
+ }
+
+CRtpTestApp::~CRtpTestApp()
+ {
+ delete iRtpApi;
+ }
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on exit
+ */
+ {
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+ if(!cleanup)
+ {
+ return KErrNoMemory;
+ }
+ TInt err = 0;
+ TRAP(err,MainL());
+ delete cleanup;
+ __UHEAP_MARKEND;
+ return err;
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rtp/rtpstack/tsrc/rtptestapp/src/rtptestapp.h Thu Jun 24 14:43:49 2010 +0300
@@ -0,0 +1,128 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header for class specific to rtp functional tests
+*
+*/
+
+
+
+#ifndef __RTPTESTAPP_H
+#define __RTPTESTAPP_H
+
+#include "rtpapi.h"
+
+
+// Class Declaration
+class CRtpTestApp : public CBase, public MRtpErrNotify, public MRtcpObserver, public MRtpObserver, public MRtpPostProcessingObserver
+ {
+public:
+
+ static CRtpTestApp* NewL();
+
+ void ConstructL();
+
+ void SendRtpPacketL();
+
+ void SendRtpPacketLoopbackL();
+
+ void SendZeroLengthRtpPacketL();
+
+ ~CRtpTestApp();
+
+ //From observer interface
+ void ErrorNotify( TInt aErrCode ) ;
+
+ // from MRtcpObserver
+
+ void SdesReceived( TRtpSSRC aSSRC,
+ const TRtpSdesParams& aParams );
+
+ void ByeReceived( TRtpId aStreamId, TRtpSSRC aSSRC,
+ const TDesC8& aReason );
+
+ void AppReceived( TRtpId aStreamId, TRtpSSRC aSSRC,
+ const TRtcpApp& aApp );
+
+ void SrReceived( TRtpId aStreamId, TRtpSSRC aSSRC,
+ const TTimeStamps& aTimeStamps );
+
+ void RrReceived( TRtpId aStreamId, TRtpSSRC aSSRC );
+
+ // From MRtpObserver
+ void RtpPacketReceived( TRtpId aStreamId, const TRtpRecvHeader& aHeaderInfo, const TDesC8& aPayloadData );
+
+ // From MRtpPostProcessingObserver
+
+ void ReadyToSendRtpPacket( TRtpId aTranStreamId, TPtr8 &aPacket );
+
+
+ TInt iError;
+ TBool iIgnoreIncrease;
+
+ private:
+ CRtpTestApp();
+ CRtpAPI* iRtpApi ;
+
+ TRtpSdesParams iParams;
+ TCreateSessionParams iSessionParams;
+ TBool iEnableRtcp;
+ TRtcpParams iRtcpParams;
+ TRtpId iSessionId1;
+ TRtpId iSessionId2;
+ TUint iPort1;
+ TUint iPort2;
+ CArrayFixFlat<TUint32>* iCsrclist;
+ TInt iNoOfRtpPackets;
+ TRtpId iS1T1;
+ TRtpId iS2R1;
+ };
+
+
+class CrtpDataSender: public CActive
+ {
+public:
+ static CrtpDataSender* NewL(CRtpAPI* aRtpApi, TRtpId sessId)
+ {
+ CrtpDataSender *pSelf = new(ELeave) CrtpDataSender();
+ pSelf->iRtpApi = aRtpApi;
+ pSelf->iSessId = sessId;
+ return pSelf;
+ }
+
+ virtual void DoCancel()
+ {
+ iRtpApi->CancelSend(iSessId);
+ }
+
+ void RunL();
+
+ void SendRtpData( TRtpSendPktParams& aHeaderInfo , TArray<TRtpCSRC> aCSRCList)
+ {
+ aHeaderInfo.iStatus = &iStatus;
+ iRtpApi->SendRtpPacket(aHeaderInfo, aCSRCList);
+ SetActive();
+ }
+private:
+ CrtpDataSender():CActive(EPriorityStandard)
+ {
+ CActiveScheduler::Add(this);
+ }
+ CRtpAPI *iRtpApi;
+ TRtpId iSessId;
+ };
+
+#endif
+
+
--- a/rtp/rtpstack/tsrc/ut_rtpstack/inc/UT_CRtpAPI.h Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/tsrc/ut_rtpstack/inc/UT_CRtpAPI.h Thu Jun 24 14:43:49 2010 +0300
@@ -65,7 +65,8 @@
public MRtpObserver,
public MNonRTPDataObserver,
public MRtcpObserver,
- public MSRTPReKeyingObserver
+ public MSRTPReKeyingObserver,
+ public MRtpPostProcessingObserver
{
public: // Constructors and destructors
@@ -103,6 +104,8 @@
void SRTPMasterKeyStaleEvent(const CSRTPSession& aSession);
void SRTPMasterKeyStaleEvent(const CSRTPStream& aStream);
+ void ReadyToSendRtpPacket( TRtpId aTranStreamId, TPtr8 &aPacket );
+
private: // New methods
void SetupL();
@@ -240,7 +243,12 @@
void UT_CRtpAPI_VersionL();
-
+
+ void UT_CRtpAPI_RegisterRtpPostProcessingObserverL();
+
+ void UT_CRtpAPI_SendRtpPacketWithCSRCL();
+
+ void UT_CRtpAPI_UnregisterRtpPostProcessingObserverL();
private: // Data
@@ -256,8 +264,9 @@
TBuf8<32> iMKI;
TBuf8<32> iRFC3711_TestMasterKey128bits;
TBuf8<32> iRFC3711_TestMasterSalt112bits;
- TBuf8<32> iSalt;
+ TBuf8<32> iSalt;
TBuf8<32> iKey;
+ TBool iIsCallBackReceived;
};
#endif // __UT_CRTPAPI_H__
--- a/rtp/rtpstack/tsrc/ut_rtpstack/src/UT_CRtpAPI.cpp Fri May 28 16:13:10 2010 +0300
+++ b/rtp/rtpstack/tsrc/ut_rtpstack/src/UT_CRtpAPI.cpp Thu Jun 24 14:43:49 2010 +0300
@@ -68,6 +68,8 @@
#endif
_LIT8(KHello, "hello...testing");
+_LIT8(KNoCName, "");
+
// CONSTRUCTION
UT_CRtpAPI* UT_CRtpAPI::NewL()
{
@@ -1422,6 +1424,7 @@
{
iErr= aErrCode;
}
+
//from Obs
void UT_CRtpAPI::RtpPacketReceived( TRtpId /*aStreamId*/,
const TRtpRecvHeader& /*aHeaderInfo*/,
@@ -1471,6 +1474,279 @@
{
}
+
+void UT_CRtpAPI::ReadyToSendRtpPacket( TRtpId /*aTranStreamId*/, TPtr8 &/*aPacket*/ )
+ {
+ // RTP Packet Callback received
+ iIsCallBackReceived = ETrue;
+ }
+
+
+void UT_CRtpAPI::UT_CRtpAPI_RegisterRtpPostProcessingObserverL( )
+ {
+ TInt result(KErrNone);
+ TRtpSdesParams params;
+
+ result = iRtpAPI->OpenL( params, NULL, NULL, NULL );
+ EUNIT_ASSERT(result==KErrNone);
+
+ TRequestStatus status;
+ result = iRtpAPI->StartConnection( status, KDefaultIap2 ); // KDefaultIap
+ RTP_EUNIT_ASSERT_EQUALS ( result, KErrNone );
+ // Wait until the connection is really up
+ User::WaitForRequest( status );
+
+ //create session
+ TCreateSessionParams sessionParams;
+ sessionParams.iPriority = TCreateSessionParams::EPriorityStandard;
+ sessionParams.iSocketBufSize = KSocketBufSize;
+ TUint port( 5000 );
+ TBool enableRtcp( EFalse );
+ TRtcpParams rtcpParams;
+ rtcpParams.iRtcpFraction = 0.10;
+ rtcpParams.iRtcpTimeOut = 0;
+ rtcpParams.iSessionBWidth = 32000;
+
+ TRtpId error( KNullId );
+ error = iRtpAPI->CreateSessionL( sessionParams,
+ port,
+ enableRtcp,
+ &rtcpParams );
+ RTP_EUNIT_ASSERT_RTP_ID( error );
+
+ TRcvStreamParams recvparams;
+ recvparams.iPayloadType = 0;
+
+ TRtpId error2( KNullId );
+ TInt err( KErrNone );
+ error2 = iRtpAPI->CreateReceiveStreamL( error /*session id*/, recvparams );
+ RTP_EUNIT_ASSERT_RTP_ID ( error2 );
+
+
+ err = iRtpAPI->RegisterRtpPostProcessingObserver( error, *this );
+ EUNIT_ASSERT ( err == KErrNone )
+ }
+
+
+void UT_CRtpAPI::UT_CRtpAPI_SendRtpPacketWithCSRCL()
+ {
+ TInt result(KErrNone);
+ TRtpSdesParams params;
+
+ result = iRtpAPI->OpenL( params, NULL, NULL, NULL );
+ RTP_EUNIT_ASSERT_EQUALS(result, KErrNone);
+
+ TRequestStatus status;
+ result = iRtpAPI->StartConnection( status, KDefaultIap ); // KDefaultIap
+ RTP_EUNIT_ASSERT_EQUALS ( result, KErrNone );
+ // Wait until the connection is really up
+ User::WaitForRequest( status );
+
+ //create session
+ TCreateSessionParams sessionParams;
+ sessionParams.iPriority = TCreateSessionParams::EPriorityStandard;
+ sessionParams.iSocketBufSize = KSocketBufSize;
+ TUint port( 5000 );
+ TBool enableRtcp( EFalse );
+ TRtcpParams rtcpParams;
+ rtcpParams.iRtcpFraction = 0.10;
+ rtcpParams.iRtcpTimeOut = 0;
+ rtcpParams.iSessionBWidth = 32000;
+
+ TRtpId error( KNullId );
+ error = iRtpAPI->CreateSessionL( sessionParams,
+ port,
+ enableRtcp,
+ &rtcpParams );
+ RTP_EUNIT_ASSERT_RTP_ID( error );
+
+ TTranStreamParams transparams;
+ transparams.iPayloadType = 0;
+ TRtpSSRC ssrc( 0 );
+
+ TInt err( KErrNone );
+ err = iRtpAPI->RegisterRtpPostProcessingObserver( error, *this );
+ EUNIT_ASSERT ( err == KErrNone )
+
+
+ err = iRtpAPI->CreateTransmitStreamL( error /*session id*/, transparams, ssrc );
+ RTP_EUNIT_ASSERT_RTP_ID ( err );
+
+
+ TRtpSendHeader header;
+ header.iHeaderExtension = NULL;
+ header.iMarker = 0;
+ header.iPadding = 0;
+ header.iPayloadType = 0;
+ header.iTimestamp = 10;
+
+ HBufC8* data = HBufC8::NewLC(KLength);
+ data->Des().Copy(KHello);
+ CleanupStack::Pop(data);
+
+ TRtpSendPktParams *headerinfo = new(ELeave) TRtpSendPktParams(header);
+ headerinfo->iTranStreamId = err;
+ headerinfo->iPayloadData.Set(data->Des());
+
+ const TUint KArrayGranularity = 15;
+
+ CArrayFixFlat<TUint32>* fix;
+ fix = new(ELeave) CArrayFixFlat<TUint32>(KArrayGranularity);
+
+ fix->AppendL(123456);
+ fix->AppendL(999999);
+
+ TInt error2( KErrNone );
+ iIsCallBackReceived = EFalse;
+ // Try sending synchronously with Csrc
+ error2 = iRtpAPI->SendRtpPacket(*headerinfo, fix->Array());
+ RTP_EUNIT_ASSERT_EQUALS ( error2, KErrNone );
+
+ CRtpSession* rtpSession = iRtpAPI->iManager->GetSession( err );
+ User::WaitForRequest( rtpSession->iCommNet->iSender[ERTPPort]->iStatus );
+ rtpSession->iCommNet->iSender[ERTPPort]->RunL();
+ rtpSession->iCommNet->iSender[ERTPPort]->iStatus = TRequestStatus();
+ EUNIT_ASSERT(iIsCallBackReceived == ETrue);
+
+ iIsCallBackReceived = EFalse;
+ // Try sending asynchronously with CSRC
+ headerinfo->iStatus = &status;
+ error2 = iRtpAPI->SendRtpPacket(*headerinfo, fix->Array());
+ RTP_EUNIT_ASSERT_EQUALS ( error2, KErrNone );
+ EUNIT_ASSERT( KRequestPending == status.Int() );
+ User::WaitForRequest( rtpSession->iCommNet->iSender[ERTPPort]->iStatus );
+ rtpSession->iCommNet->iSender[ERTPPort]->RunL();
+ rtpSession->iCommNet->iSender[ERTPPort]->iStatus = TRequestStatus();
+ User::WaitForRequest( status );
+ EUNIT_ASSERT( KErrNone == status.Int() );
+ // Is call back received check
+ EUNIT_ASSERT(iIsCallBackReceived == ETrue);
+
+ iIsCallBackReceived = EFalse;
+ // Try sending asynchronously, specifying the sequence number with CSRC
+ TRtpSequence seqNum = 42;
+ headerinfo->iSequenceNum = &seqNum;
+ error2 = iRtpAPI->SendRtpPacket(*headerinfo, fix->Array());
+ RTP_EUNIT_ASSERT_EQUALS ( error2, KErrNone );
+ EUNIT_ASSERT( KRequestPending == status.Int() );
+ User::WaitForRequest( rtpSession->iCommNet->iSender[ERTPPort]->iStatus );
+ rtpSession->iCommNet->iSender[ERTPPort]->RunL();
+ rtpSession->iCommNet->iSender[ERTPPort]->iStatus = TRequestStatus();
+ User::WaitForRequest( status );
+ EUNIT_ASSERT( KErrNone == status.Int() );
+ EUNIT_ASSERT(iIsCallBackReceived == ETrue);
+
+ delete fix;
+ delete headerinfo;
+ delete data;
+ }
+
+
+void UT_CRtpAPI::UT_CRtpAPI_UnregisterRtpPostProcessingObserverL( )
+ {
+ TInt result(KErrNone);
+ TRtpSdesParams params;
+
+ result = iRtpAPI->OpenL( params, NULL, NULL, NULL );
+ EUNIT_ASSERT(result==KErrNone);
+
+ TRequestStatus status;
+ result = iRtpAPI->StartConnection( status, KDefaultIap2 ); // KDefaultIap
+ RTP_EUNIT_ASSERT_EQUALS ( result, KErrNone );
+ // Wait until the connection is really up
+ User::WaitForRequest( status );
+
+ //create session
+ TCreateSessionParams sessionParams;
+ sessionParams.iPriority = TCreateSessionParams::EPriorityStandard;
+ sessionParams.iSocketBufSize = KSocketBufSize;
+ TUint port( 5000 );
+ TBool enableRtcp( EFalse );
+ TRtcpParams rtcpParams;
+ rtcpParams.iRtcpFraction = 0.10;
+ rtcpParams.iRtcpTimeOut = 0;
+ rtcpParams.iSessionBWidth = 32000;
+
+ TRtpId error( KNullId );
+ error = iRtpAPI->CreateSessionL( sessionParams,
+ port,
+ enableRtcp,
+ &rtcpParams );
+ RTP_EUNIT_ASSERT_RTP_ID( error );
+
+ TRcvStreamParams recvparams;
+ recvparams.iPayloadType = 0;
+
+ TRtpId error2( KNullId );
+ TInt err( KErrNone );
+ error2 = iRtpAPI->CreateReceiveStreamL( error /*session id*/, recvparams );
+ RTP_EUNIT_ASSERT_RTP_ID ( error2 );
+
+ TTranStreamParams transparams;
+ transparams.iPayloadType = 0;
+ TRtpSSRC ssrc( 0 );
+
+ err = iRtpAPI->RegisterRtpPostProcessingObserver( error, *this );
+ EUNIT_ASSERT ( err == KErrNone )
+
+ err = iRtpAPI->CreateTransmitStreamL( error /*session id*/, transparams, ssrc );
+ RTP_EUNIT_ASSERT_RTP_ID ( err );
+
+
+ TRtpSendHeader header;
+ header.iHeaderExtension = NULL;
+ header.iMarker = 0;
+ header.iPadding = 0;
+ header.iPayloadType = 0;
+ header.iTimestamp = 10;
+
+ HBufC8* data = HBufC8::NewLC(KLength);
+ data->Des().Copy(KHello);
+ CleanupStack::Pop(data);
+
+ TRtpSendPktParams *headerinfo = new(ELeave) TRtpSendPktParams(header);
+ headerinfo->iTranStreamId = err;
+ headerinfo->iPayloadData.Set(data->Des());
+
+ const TUint KArrayGranularity = 15;
+
+ CArrayFixFlat<TUint32>* fix;
+ fix = new(ELeave) CArrayFixFlat<TUint32>(KArrayGranularity);
+
+ fix->AppendL(123456);
+ fix->AppendL(999999);
+
+ TInt error3( KErrNone );
+ iIsCallBackReceived = EFalse;
+ // Try sending synchronously with Csrc
+ error3 = iRtpAPI->SendRtpPacket(*headerinfo, fix->Array());
+ RTP_EUNIT_ASSERT_EQUALS ( error3, KErrNone );
+
+ CRtpSession* rtpSession = iRtpAPI->iManager->GetSession( err );
+ User::WaitForRequest( rtpSession->iCommNet->iSender[ERTPPort]->iStatus );
+ rtpSession->iCommNet->iSender[ERTPPort]->RunL();
+ rtpSession->iCommNet->iSender[ERTPPort]->iStatus = TRequestStatus();
+ EUNIT_ASSERT(iIsCallBackReceived == ETrue);
+
+ // Unregister callback
+ iRtpAPI->UnregisterRtpPostProcessingObserver(error);
+
+ iIsCallBackReceived = EFalse;
+ error3 = KErrNone;
+ // Try sending synchronously with Csrc
+ error3 = iRtpAPI->SendRtpPacket(*headerinfo, fix->Array());
+ RTP_EUNIT_ASSERT_EQUALS ( error3, KErrNone );
+
+ User::WaitForRequest( rtpSession->iCommNet->iSender[ERTPPort]->iStatus );
+ rtpSession->iCommNet->iSender[ERTPPort]->RunL();
+ rtpSession->iCommNet->iSender[ERTPPort]->iStatus = TRequestStatus();
+ EUNIT_ASSERT(iIsCallBackReceived == EFalse);
+
+ delete fix;
+ delete headerinfo;
+ delete data;
+ }
+
// TEST TABLE
EUNIT_BEGIN_TEST_TABLE(
@@ -1799,8 +2075,30 @@
"Version",
"FUNCTIONALITY",
SetupL, UT_CRtpAPI_VersionL, Teardown)
+
+EUNIT_TEST(
+ "RegisterRtpPostProcessingObserver - test ",
+ "CRtpAPI",
+ "RegisterRtpPostProcessingObserver",
+ "FUNCTIONALITY",
+ SetupL, UT_CRtpAPI_RegisterRtpPostProcessingObserverL, Teardown)
+EUNIT_TEST(
+ "SendRtpPacketWithCSRC - test ",
+ "CRtpAPI",
+ "SendRtpPacket",
+ "FUNCTIONALITY",
+ SetupL, UT_CRtpAPI_SendRtpPacketWithCSRCL, Teardown)
+
+EUNIT_TEST(
+ "UnregisterRtpPostProcessingObserver - test ",
+ "CRtpAPI",
+ "UnregisterRtpPostProcessingObserver",
+ "FUNCTIONALITY",
+ SetupL, UT_CRtpAPI_UnregisterRtpPostProcessingObserverL, Teardown)
+
+
EUNIT_END_TEST_TABLE
// END OF FILE