Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <rtp.h>

Class RRtpSendSource

class RRtpSendSource;

Description

A handle to a send stream.

Use this class to manage the creation and sending of packets. A session can have only one send stream.

Only one packet can be sent at any one time. Once a packet has been sent, the packet cannot be closed and no further packets can be sent until an event signalling the completion of the send operation has occurred. This will be one of the events defined by the enum values: ERtpSendSucceeded and ERtpSendFail.

A client must monitor these events so that it can schedule the sending of subsequent packets. It does this by implementing and registering callback functions that handle these events.

Members

Defined in RRtpSendSource:

Related Topics


Construction and destruction


RRtpSendSource()

inline RRtpSendSource();

Description

Default constructor

[Top]


Member functions


IsOpen()const

inline TBool IsOpen() const;

Description

Tests whether the send stream represented by this handle is open.

Return value

TBool

ETrue, if the send stream is open, false otherwise.


Close()

IMPORT_C void Close();

Description

Closes the send stream.

The send stream object cannot be closed if an event is currently being handled, i.e. a call back into client code is currently in progress.


Cancel()

IMPORT_C void Cancel();

Description

Cancels the outstanding send on the send Stream

The send object must be cancelled if a send request is outstanding


RegisterEventCallbackL(TRtpEventType,void(*)(T *, const TRtpEvent &),T *,TRtpOneShotness,TInt)

inline void RegisterEventCallbackL(TRtpEventType aType, void(*aCallback)(T *, const TRtpEvent &), T *aPtr, TRtpOneShotness aOneShot, TInt aParameter);

Description

Parameters

TRtpEventType aType

void(*)(T *, const TRtpEvent &) aCallback

T *aPtr

TRtpOneShotness aOneShot

TInt aParameter


RegisterEventCallbackL(TRtpEventType,void(*)(T *, const TRtpEvent &),T *,TRtpOneShotness)

inline void RegisterEventCallbackL(TRtpEventType aType, void(*aCallback)(T *, const TRtpEvent &), T *aPtr, TRtpOneShotness aOneShot=ERtpNotOneShot);

Description

Parameters

TRtpEventType aType

void(*)(T *, const TRtpEvent &) aCallback

T *aPtr

TRtpOneShotness aOneShot


NewSendPacketL(TInt,TInt)

IMPORT_C RRtpSendPacket NewSendPacketL(TInt aPayloadSize=0, TInt aHeaderExtensionSize=KRtpNoExtension);

Description

Creates a new RTP send packet, and returns the RTP send packet handle.

On return from this call, the packet is open but uninitialised, except for the payload type which is set to the default value set by a previous call to RRtpSendSource::SetPayloadType(TUint)

The returned packet is owned by the caller of this function; it is not owned by the send stream. It must be explicitly closed by a call to RRtpPacket::Close()

Parameters

TInt aPayloadSize

The size of the payload. If not explicitly specified, i.e. the default value of 0 is passed to the function, then the size actually used is the value set by a previous call to RRtpSendSource::SetDefaultPayloadSize(TInt).

TInt aHeaderExtensionSize

The size of the extension specified as the number of 4-byte words. This value must exclude the length of the extension header. Zero is a permissible value. If unspecified, i.e. the default value of KRtpNoExtension is passed to the function, then the packet will have no extension.

Return value

RRtpSendPacket

The new RTP send packet handle.

See also:


NewSendPacketLC(TInt,TInt)

IMPORT_C RRtpSendPacket NewSendPacketLC(TInt aPayloadSize=0, TInt aHeaderExtensionSize=KRtpNoExtension);

Description

Creates a new RTP send packet, puts a pointer to the RTP send packet object onto the cleanup stack, and returns the RTP send packet handle.

On return from this call, the packet is open but uninitialised, except for the payload type which is set to the default value set by a previous call to RRtpSendSource::SetPayloadType(TUint)

The returned packet is owned by the caller of this function; it is not owned by the send stream. It must be explicitly closed by a call to RRtpPacket::Close().

Note that the function does not put a pointer to the RRtpSendPacket object onto the cleanup stack as you might normally expect, but puts a pointer to the RTP send packet object for which the returned RRtpSendPacket is the handle.

Parameters

TInt aPayloadSize

The size of the payload. If unspecified, i.e. the default value of 0 is passed to the function, then the size actually used is the value set by a previous call to RRtpSendSource::SetDefaultPayloadSize(TInt).

TInt aHeaderExtensionSize

The size of the extension specified as the number of 4-byte words. This value must exclude the length of the extension header. Zero is a permissible value. If unspecified, i.e. the default value of KRtpNoExtension is passed to the function, then the packet will have no extension.

Return value

RRtpSendPacket

The new RTP send packet.

See also:


IsSending()

IMPORT_C TBool IsSending();

Description

Tests whether the send stream is currently sending an RTP packet.

Return value

TBool

ETrue, if a send operation is in progress, EFalse, otherwise.


SetPayloadType(TUint)

IMPORT_C void SetPayloadType(TUint aPayloadType);

Description

Sets the default payload type for packets that are to be sent.

This is the payload type used when a new RTP send packet is created in calls to: RRtpSendSource::NewSendPacketL(TInt,TInt) and RRtpSendSource::NewSendPacketLC(TInt,TInt).

Parameters

TUint aPayloadType

The payload type.

See also:


SetDefaultPayloadSize(TInt)

IMPORT_C void SetDefaultPayloadSize(TInt aPayloadSize);

Description

Sets the default payload size for packets that are to be sent.

This is the default payload size used when a new RTP send packet is created in calls to: RRtpSendSource::NewSendPacketL(TInt,TInt) and RRtpSendSource::NewSendPacketLC(TInt,TInt).

Parameters

TInt aPayloadSize

The payload size.

See also:


GetLocalSSRC()

IMPORT_C TUint32 GetLocalSSRC();

Description

Return value

TUint32


SetAlignment(TInt)

IMPORT_C void SetAlignment(TInt aAlignment);

Description

Sets the alignment required for padding.

After padding, all blocks will be a multiple of this length.

Parameters

TInt aAlignment

The padding value. This must be in the range: 1-255. A value of 1 means don't pad and is the default value.

See also:


Alignment()const

IMPORT_C TInt Alignment() const;

Description

Gets the alignment value.

Return value

TInt

The alignment value.

See also:


operator==(RRtpSendSource)const

inline TBool operator==(RRtpSendSource aThat) const;

Description

Tests whether this send stream handle represents the same send stream as the one represented by the specified handle.

Parameters

RRtpSendSource aThat

The handle of the send stream to be compared.

Return value

TBool

ETrue, if the represented send streams are the same, false otherwise.


operator!=(RRtpSendSource)const

inline TBool operator!=(RRtpSendSource aThat) const;

Description

Tests whether this send stream handle represents a different send stream to the one represented by the specified handle.

Parameters

RRtpSendSource aThat

The handle of the send stream to be compared.

Return value

TBool

ETrue, if the represented send streams are different, false otherwise.