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 voidCancelSend(TRtpId)
IMPORT_C voidCancelStart()
IMPORT_C voidClose()
IMPORT_C voidCloseSession(TRtpId)
IMPORT_C voidCloseStream(TRtpId)
IMPORT_C TRtpIdCreateReceiveStreamL(TRtpId, const TRcvStreamParams &)
IMPORT_C TRtpIdCreateSessionL(const TCreateSessionParams &, TUint &, TBool, const TRtcpParams *)
IMPORT_C TRtpIdCreateSessionL(const TCreateSessionParams &, TUint &, TBool, const TRtcpParams *, CSRTPSession &)
IMPORT_C TRtpIdCreateTransmitStreamExtL(TRtpId, const TTranStreamParams &, const TRtpSSRC)
IMPORT_C TRtpIdCreateTransmitStreamL(TRtpId, const TTranStreamParams &, TRtpSSRC &)
IMPORT_C TIntCustomCommandAsync(TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C TIntCustomCommandSync(TInt, const TDesC8 &, const TDesC8 &, TDes8 &)
IMPORT_C TInetAddr &GetLocalIPAddressL()
IMPORT_C RSocket *GetRtcpSocket(TRtpId)
IMPORT_C RSocket *GetRtpSocket(TRtpId)
IMPORT_C TUint32GetSamplingRate(TUint8)
IMPORT_C TRtpIdGetSessionId(TRtpId)
IMPORT_C TIntGetStreamStatistics(TRtpId, TRtpPeerStat &)
IMPORT_C TIntIsRtcpSendingSuspended(TRtpId, TBool &)
IMPORT_C CRtpAPI *NewL(MRtpErrNotify &)
IMPORT_C TIntNotInUseSetNonRTPDataObserver()
IMPORT_C TIntOpenL(const TRtpSdesParams &, const TDesC *, const RSocketServ *, const RConnection *)
IMPORT_C TIntRegisterRtcpObserver(TRtpId, MRtcpObserver &)
IMPORT_C TIntRegisterRtpObserver(TRtpId, MRtpObserver &)
IMPORT_C voidSendDataL(TRtpId, TBool, const TDesC8 &, TRequestStatus &)
IMPORT_C TIntSendRtcpAppPacket(TRtpId, const TRtcpApp &)
IMPORT_C TIntSendRtcpByePacket(TRtpId, const TDesC8 &)
IMPORT_C TIntSendRtcpRrPacket(TRtpId)
IMPORT_C TIntSendRtcpSrPacket(TRtpId)
IMPORT_C TIntSendRtpPacket(TRtpId, const TRtpSendHeader &, const TDesC8 &)
IMPORT_C TIntSendRtpPacket(TRtpId, const TRtpSendHeader &, const TDesC8 &, TRequestStatus &)
IMPORT_C TIntSendRtpPacket(TRtpId, TRtpSequence, const TRtpSendHeader &, const TDesC8 &, TRequestStatus &)
IMPORT_C voidSetLocalSdes(const TRtpSdesParams &)
IMPORT_C TIntSetNonRTPDataObserver(TRtpId, MNonRTPDataObserver *)
IMPORT_C TIntSetRemoteAddress(TRtpId, const TInetAddr &)
IMPORT_C TIntSetRemoteRtcpAddress(TRtpId, const TInetAddr &)
IMPORT_C TIntSetRtcpParameters(TRtpId, const TRtcpParams &)
IMPORT_C TIntSetSamplingRate(TUint8, TUint32)
IMPORT_C TIntStartConnection(TInt)
IMPORT_C TIntStartConnection(TRequestStatus &, TInt)
IMPORT_C TIntStartSession(TRtpId)
IMPORT_C TIntSuspendRtcpSending(TRtpId, TBool)
IMPORT_C voidUnregisterRtcpObserver(TRtpId)
IMPORT_C voidUnregisterRtpObserver(TRtpId)
IMPORT_C TVersionVersion()
Private Member Functions
CRtpAPI()
voidConstructL(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 voidCancelSend(TRtpIdaSessionId)

Cancel an outstanding SendRtpPacket() operation.

Parameters

TRtpId aSessionId

CancelStart()

IMPORT_C voidCancelStart()

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

Close()

IMPORT_C voidClose()

Close the CRtpAPI object.

CloseSession(TRtpId)

IMPORT_C voidCloseSession(TRtpIdaSessionId)

Close an RTP Session.

Parameters

TRtpId aSessionId- [input] Session ID

CloseStream(TRtpId)

IMPORT_C voidCloseStream(TRtpIdaStreamId)

Close a Transmit or Receive stream.

Parameters

TRtpId aStreamId

ConstructL(MRtpErrNotify &)

voidConstructL(MRtpErrNotify &aErrNotify)[private]

By default Symbian 2nd phase constructor is private.

Parameters

MRtpErrNotify & aErrNotify

CreateReceiveStreamL(TRtpId, const TRcvStreamParams &)

IMPORT_C TRtpIdCreateReceiveStreamL(TRtpIdaSessionId,
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 TRtpIdCreateSessionL(const TCreateSessionParams &aSessionParams,
TUint &aPort,
TBoolaEnableRtcp,
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 TRtpIdCreateSessionL(const TCreateSessionParams &aSessionParams,
TUint &aPort,
TBoolaEnableRtcp,
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 TRtpIdCreateTransmitStreamExtL(TRtpIdaSessionId,
const TTranStreamParams &aParams,
const TRtpSSRCaSSRC
)

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 TRtpIdCreateTransmitStreamL(TRtpIdaSessionId,
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 TIntCustomCommandAsync(TIntaFunction,
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 TIntCustomCommandSync(TIntaFunction,
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(TRtpIdaSessionId)

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(TRtpIdaSessionId)

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 TUint32GetSamplingRate(TUint8aPayloadType)

Get sampling rate setting for a payload type.

Parameters

TUint8 aPayloadType- [input] Payload type

GetSessionId(TRtpId)

IMPORT_C TRtpIdGetSessionId(TRtpIdaStreamId)

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 TIntGetStreamStatistics(TRtpIdaStreamId,
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 TIntIsRtcpSendingSuspended(TRtpIdaSessionId,
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 TIntNotInUseSetNonRTPDataObserver()

Dummy function to fix Raptor error

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

IMPORT_C TIntOpenL(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 TIntRegisterRtcpObserver(TRtpIdaSessionId,
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 TIntRegisterRtpObserver(TRtpIdaSessionId,
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 voidSendDataL(TRtpIdaSessionId,
TBoolaUseRTPSocket,
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 TIntSendRtcpAppPacket(TRtpIdaTranStreamId,
const TRtcpApp &aApp
)

Send an RTCP APP packet for a Transmit stream.

Parameters

TRtpId aTranStreamId
const TRtcpApp & aApp

SendRtcpByePacket(TRtpId, const TDesC8 &)

IMPORT_C TIntSendRtcpByePacket(TRtpIdaTranStreamId,
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 TIntSendRtcpRrPacket(TRtpIdaRcvStreamId)

Send an RTCP RR packet for a Reception stream.

Parameters

TRtpId aRcvStreamId

SendRtcpSrPacket(TRtpId)

IMPORT_C TIntSendRtcpSrPacket(TRtpIdaTranStreamId)

Send an RTCP SR packet for a Transmit stream.

Parameters

TRtpId aTranStreamId

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

IMPORT_C TIntSendRtpPacket(TRtpIdaTranStreamId,
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 TIntSendRtpPacket(TRtpIdaTranStreamId,
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 TIntSendRtpPacket(TRtpIdaTranStreamId,
TRtpSequenceaSequenceNum,
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 voidSetLocalSdes(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 TIntSetNonRTPDataObserver(TRtpIdaSessionId,
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 * aNonRTPDataObserveran observer, 0-pointer resets the observer

SetRemoteAddress(TRtpId, const TInetAddr &)

IMPORT_C TIntSetRemoteAddress(TRtpIdaSessionId,
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 TIntSetRemoteRtcpAddress(TRtpIdaSessionId,
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 TIntSetRtcpParameters(TRtpIdaSessionId,
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 TIntSetSamplingRate(TUint8aPayloadType,
TUint32aSamplingRate
)

Set sampling rate for a payload type.

Parameters

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

StartConnection(TInt)

IMPORT_C TIntStartConnection(TIntaIapId = -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 TIntStartConnection(TRequestStatus &aStatus,
TIntaIapId = -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 TIntStartSession(TRtpIdaSessionId)

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 TIntSuspendRtcpSending(TRtpIdaSessionId,
TBoolaAutoSending
)

Suspend RTCP sending on/off, calculations will continue.

Parameters

TRtpId aSessionId
TBool aAutoSending

UnregisterRtcpObserver(TRtpId)

IMPORT_C voidUnregisterRtcpObserver(TRtpIdaSessionId)

Unregister RTCP observer callback object associated with an RTP session.

Parameters

TRtpId aSessionId- [input] RTP Session ID

UnregisterRtpObserver(TRtpId)

IMPORT_C voidUnregisterRtpObserver(TRtpIdaSessionId)

Unregister RTP observer callback object associated with an RTP session.

Parameters

TRtpId aSessionId- [input] RTP Session ID

Version()

IMPORT_C TVersionVersion()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]