CRtpAPI Class Reference

class CRtpAPI : public CBase

API (Application Programming Interface) class for RTP (Real-time Transport Protocol) library.

RtpService.dll

Inherits from

Public Member Functions
~CRtpAPI ()
IMPORT_C void CancelSend ( TRtpId )
IMPORT_C void CancelStart ()
IMPORT_C void Close ()
IMPORT_C void CloseSession ( TRtpId )
IMPORT_C void CloseStream ( TRtpId )
IMPORT_C TRtpId CreateReceiveStreamL ( TRtpId , const TRcvStreamParams &)
IMPORT_C TRtpId CreateSessionL (const TCreateSessionParams &, TUint &, TBool , const TRtcpParams *)
IMPORT_C TRtpId CreateSessionL (const TCreateSessionParams &, TUint &, TBool , const TRtcpParams *, CSRTPSession &)
IMPORT_C TRtpId CreateTransmitStreamExtL ( TRtpId , const TTranStreamParams &, const TRtpSSRC )
IMPORT_C TRtpId CreateTransmitStreamL ( TRtpId , const TTranStreamParams &, TRtpSSRC &)
IMPORT_C TInt CustomCommandAsync ( TInt , const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C TInt CustomCommandSync ( TInt , const TDesC8 &, const TDesC8 &, TDes8 &)
IMPORT_C TInetAddr & GetLocalIPAddressL ()
IMPORT_C RSocket * GetRtcpSocket ( TRtpId )
IMPORT_C RSocket * GetRtpSocket ( TRtpId )
IMPORT_C TUint32 GetSamplingRate ( TUint8 )
IMPORT_C TRtpId GetSessionId ( TRtpId )
IMPORT_C TInt GetStreamStatistics ( TRtpId , TRtpPeerStat &)
IMPORT_C TInt IsRtcpSendingSuspended ( TRtpId , TBool &)
IMPORT_C CRtpAPI * NewL ( MRtpErrNotify &)
IMPORT_C TInt NotInUseSetNonRTPDataObserver ()
IMPORT_C TInt OpenL (const TRtpSdesParams &, const TDesC *, const RSocketServ *, const RConnection *)
IMPORT_C TInt RegisterRtcpObserver ( TRtpId , MRtcpObserver &)
IMPORT_C TInt RegisterRtpObserver ( TRtpId , MRtpObserver &)
IMPORT_C void SendDataL ( TRtpId , TBool , const TDesC8 &, TRequestStatus &)
IMPORT_C TInt SendRtcpAppPacket ( TRtpId , const TRtcpApp &)
IMPORT_C TInt SendRtcpByePacket ( TRtpId , const TDesC8 &)
IMPORT_C TInt SendRtcpRrPacket ( TRtpId )
IMPORT_C TInt SendRtcpSrPacket ( TRtpId )
IMPORT_C TInt SendRtpPacket ( TRtpId , const TRtpSendHeader &, const TDesC8 &)
IMPORT_C TInt SendRtpPacket ( TRtpId , const TRtpSendHeader &, const TDesC8 &, TRequestStatus &)
IMPORT_C TInt SendRtpPacket ( TRtpId , TRtpSequence , const TRtpSendHeader &, const TDesC8 &, TRequestStatus &)
IMPORT_C void SetLocalSdes (const TRtpSdesParams &)
IMPORT_C TInt SetNonRTPDataObserver ( TRtpId , MNonRTPDataObserver *)
IMPORT_C TInt SetRemoteAddress ( TRtpId , const TInetAddr &)
IMPORT_C TInt SetRemoteRtcpAddress ( TRtpId , const TInetAddr &)
IMPORT_C TInt SetRtcpParameters ( TRtpId , const TRtcpParams &)
IMPORT_C TInt SetSamplingRate ( TUint8 , TUint32 )
IMPORT_C TInt StartConnection ( TInt )
IMPORT_C TInt StartConnection ( TRequestStatus &, TInt )
IMPORT_C TInt StartSession ( TRtpId )
IMPORT_C TInt SuspendRtcpSending ( TRtpId , TBool )
IMPORT_C void UnregisterRtcpObserver ( TRtpId )
IMPORT_C void UnregisterRtpObserver ( TRtpId )
IMPORT_C TVersion Version ()
Private Member Functions
CRtpAPI ()
void ConstructL ( MRtpErrNotify &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CRtpManager * iManager
TAny * iReserved1
TAny * iReserved2
TInt iReserved3
TInt iReserved4

Constructor & Destructor Documentation

CRtpAPI()

CRtpAPI ( ) [private]

C++ default constructor.

~CRtpAPI()

~CRtpAPI ( ) [virtual]

Destructor.

Member Functions Documentation

CancelSend(TRtpId)

IMPORT_C void CancelSend ( TRtpId aSessionId )

Cancel an outstanding SendRtpPacket() operation.

Parameters

TRtpId aSessionId

CancelStart()

IMPORT_C void CancelStart ( )

Cancels asynchoronous start of connection. Any open requests will be completed with KErrCancel.

Close()

IMPORT_C void Close ( )

Close the CRtpAPI object.

CloseSession(TRtpId)

IMPORT_C void CloseSession ( TRtpId aSessionId )

Close an RTP Session.

Parameters

TRtpId aSessionId - [input] Session ID

CloseStream(TRtpId)

IMPORT_C void CloseStream ( TRtpId aStreamId )

Close a Transmit or Receive stream.

Parameters

TRtpId aStreamId

ConstructL(MRtpErrNotify &)

void ConstructL ( MRtpErrNotify & aErrNotify ) [private]

By default Symbian 2nd phase constructor is private.

Parameters

MRtpErrNotify & aErrNotify

CreateReceiveStreamL(TRtpId, const TRcvStreamParams &)

IMPORT_C TRtpId CreateReceiveStreamL ( TRtpId aSessionId,
const TRcvStreamParams & aParams
)

Create a Receive stream for an RTP Session and return the stream ID which is unique for all RTP Sessions.

Parameters

TRtpId aSessionId - [input] RTP Session ID
const TRcvStreamParams & aParams - [input] Receive stream parameters

CreateSessionL(const TCreateSessionParams &, TUint &, TBool, const TRtcpParams *)

IMPORT_C TRtpId CreateSessionL ( const TCreateSessionParams & aSessionParams,
TUint & aPort,
TBool aEnableRtcp,
const TRtcpParams * aRtcpParams
)

Create a new RTP Session and return the Session ID as well as the local port number assigned for RTP. RTP uses an even port number and RTCP, if enabled, uses the next higher (odd) port number.

Parameters

const TCreateSessionParams & aSessionParams - [input] Session parameters
TUint & aPort - [input] Local port number to use for RTP; 0 to use default port number[output] port number assigned for RTP
TBool aEnableRtcp - [input] ETrue to enable RTCP; EFalse to disable
const TRtcpParams * aRtcpParams - [input] RTCP parameters to use; NULL to use default RTCP parameters

CreateSessionL(const TCreateSessionParams &, TUint &, TBool, const TRtcpParams *, CSRTPSession &)

IMPORT_C TRtpId CreateSessionL ( const TCreateSessionParams & aSessionParams,
TUint & aPort,
TBool aEnableRtcp,
const TRtcpParams * aRtcpParams,
CSRTPSession & aSession
)

Create a new, secure RTP Session and return the Session ID as well as the local port number assigned for RTP. RTP uses an even port number and RTCP, if enabled, uses the next higher (odd) port number. User is expected to create corresponding SRTP session prior to calling this function.

Parameters

const TCreateSessionParams & aSessionParams - [input] Session parameters
TUint & aPort - [input] Local port number to use for RTP; 0 to use default port number[output] port number assigned for RTP
TBool aEnableRtcp - [input] ETrue to enable RTCP; EFalse to disable
const TRtcpParams * aRtcpParams - [input] RTCP parameters to use; NULL to use default RTCP parameters
CSRTPSession & aSession - [input] SRTP session to be used by this RTP session.

CreateTransmitStreamExtL(TRtpId, const TTranStreamParams &, const TRtpSSRC)

IMPORT_C TRtpId CreateTransmitStreamExtL ( TRtpId aSessionId,
const TTranStreamParams & aParams,
const TRtpSSRC aSSRC
)

Create a Transmit stream, with a given SSRC value, for an RTP Session and return the stream ID which is unique for all RTP Sessions. This extended function is used for a special case where a specific SSRC value needs to be associated with the transmit stream being created, e.g. for retransmission purpose.

Parameters

TRtpId aSessionId - [input] RTP Session ID
const TTranStreamParams & aParams - [input] Transmit stream parameters
const TRtpSSRC aSSRC

CreateTransmitStreamL(TRtpId, const TTranStreamParams &, TRtpSSRC &)

IMPORT_C TRtpId CreateTransmitStreamL ( TRtpId aSessionId,
const TTranStreamParams & aParams,
TRtpSSRC & aSSRC
)

Create a Transmit stream for an RTP Session and return the stream ID which is unique for all RTP Sessions. SSRC value assigned for the very first Transmit stream will be the same as the default SSRC value reserved internally by CreateSession function. This function is normally used to create a transmit stream where SSRC value is randomly generated.

Parameters

TRtpId aSessionId - [input] RTP Session ID
const TTranStreamParams & aParams - [input] Transmit stream parameters
TRtpSSRC & aSSRC - [output] SSRC value assigned

CustomCommandAsync(TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)

IMPORT_C TInt CustomCommandAsync ( TInt aFunction,
const TDesC8 & aInputData1,
const TDesC8 & aInputData2,
TDes8 & aOutputData,
TRequestStatus & aStatus
)

ASynchronous custom command interface for future extensions. Input/output data and return value are defined by each custom command

Parameters

TInt aFunction - [input] Function ID
const TDesC8 & aInputData1 - [input] Input data #1; NULL if not used
const TDesC8 & aInputData2 - [input] Input data #2; NULL if not used
TDes8 & aOutputData - [output] Output data; NULL if not used
TRequestStatus & aStatus - [output] On completion, will contain a status code: KErrNone if successful; system wide error code otherwise

CustomCommandSync(TInt, const TDesC8 &, const TDesC8 &, TDes8 &)

IMPORT_C TInt CustomCommandSync ( TInt aFunction,
const TDesC8 & aInputData1,
const TDesC8 & aInputData2,
TDes8 & aOutputData
)

Synchronous custom command interface for future extensions. Input/output data and return value are defined by each custom command

Parameters

TInt aFunction - [input] Function ID
const TDesC8 & aInputData1 - [input] Input data #1; NULL if not used
const TDesC8 & aInputData2 - [input] Input data #2; NULL if not used
TDes8 & aOutputData - [output] Output data; NULL if not used

GetLocalIPAddressL()

IMPORT_C TInetAddr & GetLocalIPAddressL ( )

Get the local IP address

GetRtcpSocket(TRtpId)

IMPORT_C RSocket * GetRtcpSocket ( TRtpId aSessionId )

Get address of Socket object used by a given RTP Session to send/receive RTCP control packets.

Parameters

TRtpId aSessionId - [input] RTP Session ID

GetRtpSocket(TRtpId)

IMPORT_C RSocket * GetRtpSocket ( TRtpId aSessionId )

Get address of Socket object used by a given RTP Session to send/receive RTP data packets.

Parameters

TRtpId aSessionId - [input] RTP Session ID

GetSamplingRate(TUint8)

IMPORT_C TUint32 GetSamplingRate ( TUint8 aPayloadType )

Get sampling rate setting for a payload type.

Parameters

TUint8 aPayloadType - [input] Payload type

GetSessionId(TRtpId)

IMPORT_C TRtpId GetSessionId ( TRtpId aStreamId )

Get the session ID of a stream, which belongs to that session.

Parameters

TRtpId aStreamId - [input] ID of a stream

GetStreamStatistics(TRtpId, TRtpPeerStat &)

IMPORT_C TInt GetStreamStatistics ( TRtpId aStreamId,
TRtpPeerStat & aStat
)

Retrieve statistical information for a stream based on the reports from RTCP SR & RR packets.

Parameters

TRtpId aStreamId - [input] ID of stream
TRtpPeerStat & aStat - [output] Statistical information

IsRtcpSendingSuspended(TRtpId, TBool &)

IMPORT_C TInt IsRtcpSendingSuspended ( TRtpId aSessionId,
TBool & aAutoSending
)

Gets the status of automatic RTCP sending.

Parameters

TRtpId aSessionId
TBool & aAutoSending

NewL(MRtpErrNotify &)

IMPORT_C CRtpAPI * NewL ( MRtpErrNotify & aErrNotify ) [static]

Two-phased constructor.

Parameters

MRtpErrNotify & aErrNotify

NotInUseSetNonRTPDataObserver()

IMPORT_C TInt NotInUseSetNonRTPDataObserver ( )

Dummy function to fix Raptor error

OpenL(const TRtpSdesParams &, const TDesC *, const RSocketServ *, const RConnection *)

IMPORT_C TInt OpenL ( const TRtpSdesParams & aSdesInfo,
const TDesC * aRtpPacketDll,
const RSocketServ * aSocketServPtr,
const RConnection * aConnPtr
)

Open and initialize the CRtpAPI object.

Parameters

const TRtpSdesParams & aSdesInfo - [input] SDES (Source Description) of the local participant (CName, Username, etc.)
const TDesC * aRtpPacketDll - [input] Path+file name of RTP packet formatting DLL to use; NULL to use standard RTP packet format Ownership is transfered.
const RSocketServ * aSocketServPtr
const RConnection * aConnPtr

RegisterRtcpObserver(TRtpId, MRtcpObserver &)

IMPORT_C TInt RegisterRtcpObserver ( TRtpId aSessionId,
MRtcpObserver & aRtcpObserver
)

Register a callback object for receiving RTCP packets associated with a given RTP Session. Only one observer callback object is allowed to be registered. One of aRtcpObserver object's callback functions is called when an RTCP packet of that type is received.

Parameters

TRtpId aSessionId - [input] RTP Session ID
MRtcpObserver & aRtcpObserver

RegisterRtpObserver(TRtpId, MRtpObserver &)

IMPORT_C TInt RegisterRtpObserver ( TRtpId aSessionId,
MRtpObserver & aRtpObserver
)

Register a callback object for receiving RTP data packets from an RTP Session. Only one receiver callback object is allowed to be registered for one Session. MRtpObserver::RtpPacketReceived function from aRtpObserver object is called when an RTP data packet is received.

Parameters

TRtpId aSessionId - [input] RTP Session ID
MRtpObserver & aRtpObserver - [input] Callback object to receive RTP packets

SendDataL(TRtpId, TBool, const TDesC8 &, TRequestStatus &)

IMPORT_C void SendDataL ( TRtpId aSessionId,
TBool aUseRTPSocket,
const TDesC8 & aData,
TRequestStatus & aStatus
)

Send a non-RTP (control) data packet asynchronously

Parameters

TRtpId aSessionId - [input] RTP Session ID
TBool aUseRTPSocket - [input] use RTP/RTCP socket
const TDesC8 & aData - [input] non-RTP data packet to send
TRequestStatus & aStatus - [output] On completion, will contain a status code: KErrNone if successful; system wide error code otherwise

SendRtcpAppPacket(TRtpId, const TRtcpApp &)

IMPORT_C TInt SendRtcpAppPacket ( TRtpId aTranStreamId,
const TRtcpApp & aApp
)

Send an RTCP APP packet for a Transmit stream.

Parameters

TRtpId aTranStreamId
const TRtcpApp & aApp

SendRtcpByePacket(TRtpId, const TDesC8 &)

IMPORT_C TInt SendRtcpByePacket ( TRtpId aTranStreamId,
const TDesC8 & aReason
)

Send an RTCP BYE packet for a Transmit stream.

Parameters

TRtpId aTranStreamId - [input] Transmit stream ID
const TDesC8 & aReason - [input] Reason for leaving

SendRtcpRrPacket(TRtpId)

IMPORT_C TInt SendRtcpRrPacket ( TRtpId aRcvStreamId )

Send an RTCP RR packet for a Reception stream.

Parameters

TRtpId aRcvStreamId

SendRtcpSrPacket(TRtpId)

IMPORT_C TInt SendRtcpSrPacket ( TRtpId aTranStreamId )

Send an RTCP SR packet for a Transmit stream.

Parameters

TRtpId aTranStreamId

SendRtpPacket(TRtpId, const TRtpSendHeader &, const TDesC8 &)

IMPORT_C TInt SendRtpPacket ( TRtpId aTranStreamId,
const TRtpSendHeader & aHeaderInfo,
const TDesC8 & aPayloadData
)

Send an RTP data packet in a Transmit stream synchronously.

Parameters

TRtpId aTranStreamId - [input] ID of Transmit stream
const TRtpSendHeader & aHeaderInfo - [input] Header information of RTP data packet
const TDesC8 & aPayloadData - [input] Payload data of RTP data packet

SendRtpPacket(TRtpId, const TRtpSendHeader &, const TDesC8 &, TRequestStatus &)

IMPORT_C TInt SendRtpPacket ( TRtpId aTranStreamId,
const TRtpSendHeader & aHeaderInfo,
const TDesC8 & aPayloadData,
TRequestStatus & aStatus
)

Send an RTP data packet in a Transmit stream asynchronously.

Parameters

TRtpId aTranStreamId
const TRtpSendHeader & aHeaderInfo - [input] Header information of RTP data packet to send
const TDesC8 & aPayloadData - [input] Payload data of RTP data packet to send
TRequestStatus & aStatus - [output] On completion, will contain a status code: KErrNone if successful; system wide error code otherwise

SendRtpPacket(TRtpId, TRtpSequence, const TRtpSendHeader &, const TDesC8 &, TRequestStatus &)

IMPORT_C TInt SendRtpPacket ( TRtpId aTranStreamId,
TRtpSequence aSequenceNum,
const TRtpSendHeader & aHeaderInfo,
const TDesC8 & aPayloadData,
TRequestStatus & aStatus
)

Send an RTP data packet asynchronously, with a given sequence number, in a Transmit stream mainly for retransmission purpose.

Parameters

TRtpId aTranStreamId - [input] ID of Transmit stream
TRtpSequence aSequenceNum - [input] Sequence number to use
const TRtpSendHeader & aHeaderInfo - [input] Header information of RTP data packet
const TDesC8 & aPayloadData - [input] Payload data of RTP data packet to send
TRequestStatus & aStatus - [output] On completion, will contain a status code: KErrNone if successful; system wide error code otherwise

SetLocalSdes(const TRtpSdesParams &)

IMPORT_C void SetLocalSdes ( const TRtpSdesParams & aSdesInfo )

Set SDES (Source Description) information of the local participant. Participant is defined as an application program and only one local participant is allowed.

Parameters

const TRtpSdesParams & aSdesInfo - [input] SDES of the local participant (CName, Username, etc.).

SetNonRTPDataObserver(TRtpId, MNonRTPDataObserver *)

IMPORT_C TInt SetNonRTPDataObserver ( TRtpId aSessionId,
MNonRTPDataObserver * aNonRTPDataObserver
)

Sets/resets the observer for the non-RTP data. Only one receiver callback object is allowed to be registered for one Session. MNonRTPDataObserver::NonRTPDataReceived or MNonRTPDataObserver::NonRTCPDataReceived from aNonRTPDataObserver object is called when a non-RTP data packet is received.

Parameters

TRtpId aSessionId
MNonRTPDataObserver * aNonRTPDataObserver an observer, 0-pointer resets the observer

SetRemoteAddress(TRtpId, const TInetAddr &)

IMPORT_C TInt SetRemoteAddress ( TRtpId aSessionId,
const TInetAddr & aRemoteAddr
)

Set remote IP address and port number to RTP Session. Port number for RTP must be an even number and the corresponding RTCP, if enabled, will be set to use the next higher (odd) port.

Parameters

TRtpId aSessionId - [input] RTP Session ID
const TInetAddr & aRemoteAddr - [input] Remote IP address & port number for RTP

SetRemoteRtcpAddress(TRtpId, const TInetAddr &)

IMPORT_C TInt SetRemoteRtcpAddress ( TRtpId aSessionId,
const TInetAddr & aRemoteRtcpAddr
)

Set remote RTCP IP address and port number to RTP Session accoring to RFC 3605 i.e. this should be used if RTCP port is different than RTP port + 1

Parameters

TRtpId aSessionId
const TInetAddr & aRemoteRtcpAddr

SetRtcpParameters(TRtpId, const TRtcpParams &)

IMPORT_C TInt SetRtcpParameters ( TRtpId aSessionId,
const TRtcpParams & aRtcpParams
)

Set RTCP parameters for a given RTP Session. This function does nothing if RTCP was not enabled previously.

Parameters

TRtpId aSessionId - [input] RTP Session ID
const TRtcpParams & aRtcpParams - [input] RTCP parameters to use

SetSamplingRate(TUint8, TUint32)

IMPORT_C TInt SetSamplingRate ( TUint8 aPayloadType,
TUint32 aSamplingRate
)

Set sampling rate for a payload type.

Parameters

TUint8 aPayloadType - [input] Payload type
TUint32 aSamplingRate - [input] Sampling rate in Hz

StartConnection(TInt)

IMPORT_C TInt StartConnection ( TInt aIapId = -1 )

Open and initialize the CRtpAPI object.

Parameters

TInt aIapId = -1 - [input] IAP ID. If -1, no IAP selection dialog will pop up. Instead, the default IAP will be used.

StartConnection(TRequestStatus &, TInt)

IMPORT_C TInt StartConnection ( TRequestStatus & aStatus,
TInt aIapId = -1
)

Open and initialize the CRtpAPI object in asynchronous mode

Parameters

TRequestStatus & aStatus - [output] On completion, will contain a status code: KErrNone if successful; system wide error code otherwise.
TInt aIapId = -1 - [input] IAP ID. If -1, no IAP selection dialog will pop up. Instead, the default IAP will be used.

StartSession(TRtpId)

IMPORT_C TInt StartSession ( TRtpId aSessionId )

Start an RTP Session. If enabled, RTCP associated with the given session is also started.

Parameters

TRtpId aSessionId - [input] Session ID

SuspendRtcpSending(TRtpId, TBool)

IMPORT_C TInt SuspendRtcpSending ( TRtpId aSessionId,
TBool aAutoSending
)

Suspend RTCP sending on/off, calculations will continue.

Parameters

TRtpId aSessionId
TBool aAutoSending

UnregisterRtcpObserver(TRtpId)

IMPORT_C void UnregisterRtcpObserver ( TRtpId aSessionId )

Unregister RTCP observer callback object associated with an RTP session.

Parameters

TRtpId aSessionId - [input] RTP Session ID

UnregisterRtpObserver(TRtpId)

IMPORT_C void UnregisterRtpObserver ( TRtpId aSessionId )

Unregister RTP observer callback object associated with an RTP session.

Parameters

TRtpId aSessionId - [input] RTP Session ID

Version()

IMPORT_C TVersion Version ( ) const

Version of RtpService.dll

Member Data Documentation

CRtpManager * iManager

CRtpManager * iManager [private]

TAny * iReserved1

TAny * iReserved1 [private]

TAny * iReserved2

TAny * iReserved2 [private]

TInt iReserved3

TInt iReserved3 [private]

TInt iReserved4

TInt iReserved4 [private]