Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: SdpMediaField.h
Link against: sdpcodec.lib

Class CSdpMediaField

class CSdpMediaField : public CBase;

Description

This class encapsulates the media description field and related media specific subfields of the Session Description Protocol.

The normative reference for correct formatting and values is draft-ietf-mmusic-sdp-new-14 unless specified otherwise in member documentation. The implementation supports this normative reference, but does not enforce it fully.

sdpcodec.lib

Derivation

Members

Defined in CSdpMediaField:
AttributeFields(), BandwidthFields(), CloneL(), ConnectionFields(), DecodeL(), DecodeLC(), EncodeL(), FormatAttributeFields(), FormatList(), Info(), IsValid(), KeepFormatL(), Key(), Key(), Media(), NewL(), NewLC(), Port(), PortCount(), Protocol(), RejectMedia(), RemoveFormatL(), SetFormatListL(), SetInfoL(), SetKey(), SetMediaL(), SetPortCountL(), SetPortL(), SetProtocolL(), operator==(), ~CSdpMediaField()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CSdpMediaField *NewL(RStringF aMedia, TUint aPort, RStringF aProtocol, const TDesC8 &aFormatList);

Description

Constructs a new media description field. The optional portcount component of the field is initialized to 1.

Parameters

RStringF aMedia

A valid media type name.

TUint aPort

Port number.

RStringF aProtocol

A valid media protocol name.

const TDesC8 &aFormatList

A valid format list.

Return value

CSdpMediaField *

a new instance.


NewLC()

static IMPORT_C CSdpMediaField *NewLC(RStringF aMedia, TUint aPort, RStringF aProtocol, const TDesC8 &aFormatList);

Description

Constructs a new media description field and adds the pointer to the cleanup stack. The optional portcount component of the field is initialized to 1.

Parameters

RStringF aMedia

A valid media type name.

TUint aPort

Port number.

RStringF aProtocol

A valid media protocol name.

const TDesC8 &aFormatList

A valid format list.

Return value

CSdpMediaField *

a new instance.


~CSdpMediaField()

IMPORT_C ~CSdpMediaField();

Description

Deletes the resources held by the instance.

[Top]


Member functions


DecodeL()

static IMPORT_C CSdpMediaField *DecodeL(const TDesC8 &aText, TBool aRecurse=ETrue);

Description

Constructs a new media description field.

Parameters

const TDesC8 &aText

A correctly formatted media field terminated by a CRLF followed by zero or more media attribute fields separated by a CRLF.

TBool aRecurse

If ETrue, attempts to construct also media attributes following the CRLF terminating the media field.

Return value

CSdpMediaField *

a new instance.


DecodeLC()

static IMPORT_C CSdpMediaField *DecodeLC(const TDesC8 &aText, TBool aRecurse=ETrue);

Description

Constructs a new media description field and adds the pointer to the cleanup stack.

Parameters

const TDesC8 &aText

A correctly formatted media field terminated by a CRLF followed by zero or more media attribute fields separated by a CRLF.

TBool aRecurse

If ETrue, attempts to construct also media attributes following the CRLF terminating the media field.

Return value

CSdpMediaField *

a new instance.


EncodeL()

IMPORT_C void EncodeL(RWriteStream &aStream, TBool aRecurse=ETrue) const;

Description

Outputs the field formatted according to SDP syntax and including the terminating CRLF. Optionally output also the related media level fields.

Parameters

RWriteStream &aStream

Stream used for output. On return the stream includes correctly formatted media field with media part fields if aRecurse is defined to ETrue.

TBool aRecurse

Flag to specify whether to output media attributes also (ETrue) or only the media field (EFalse).


CloneL()

IMPORT_C CSdpMediaField *CloneL(TBool aRecurse=ETrue) const;

Description

Creates a new instance that is equal to the target. Optionally also related subfields are cloned.

Parameters

TBool aRecurse

Flag to specify whether to clone subfields also (ETrue) or only the media field (EFalse).

Return value

CSdpMediaField *

a new instance.


operator==()

IMPORT_C TBool operator==(const CSdpMediaField &aObj) const;

Description

Compares this instance to another for equality. Subfields are included in the comparison if present.

Parameters

const CSdpMediaField &aObj

The instance to compare to.

Return value

TBool

ETrue if equal, EFalse if not.


IsValid()

IMPORT_C TBool IsValid() const;

Description

Checks the consistency between the media field and it's subfields. In particular, this function checks that each format specific attribute is related to a format in the format list of the media field.

Return value

TBool

ETrue if media description is consistent and EFalse if not.


Media()

IMPORT_C RStringF Media() const;

Description

Gets the media type.

Return value

RStringF

The media type.


SetMediaL()

IMPORT_C void SetMediaL(RStringF aMedia);

Description

Sets the media type.

Parameters

RStringF aMedia

The media type.

Leave codes

KErrSdpCodecMediaField

if aMedia is not valid character


Protocol()

IMPORT_C RStringF Protocol() const;

Description

Gets the media protocol.

Return value

RStringF

The media protocol.


SetProtocolL()

IMPORT_C void SetProtocolL(RStringF aProtocol);

Description

Sets the media protocol.

Parameters

RStringF aProtocol

The media protocol.

Leave codes

KErrSdpCodecMediaField

if aProtocol containing two elements divided by slash are not valid tokens.


Port()

IMPORT_C TUint Port() const;

Description

Gets the port number.

Return value

TUint

The port number.


SetPortL()

IMPORT_C void SetPortL(TUint aPort);

Description

Sets the port number.

Parameters

TUint aPort

The port number.

Leave codes

KErrSdpCodecMediaField

if port is not valid number as defined in draft-ietf-mmusic-sdp-new-14


PortCount()

IMPORT_C TUint PortCount() const;

Description

Gets the port count.

Return value

TUint

The port count.


SetPortCountL()

IMPORT_C void SetPortCountL(TUint aCount);

Description

Sets the port count.

Parameters

TUint aCount

The port count that must be greater than zero.

Leave codes

KErrSdpCodecMediaField

if aCount equals to zero.


FormatList()

IMPORT_C const TDesC8 &FormatList() const;

Description

Gets the format list.

Return value

const TDesC8 &

The format list.


SetFormatListL()

IMPORT_C void SetFormatListL(const TDesC8 &aValue);

Description

Sets the format list. The format list should contain one or more format tokens separated by a single whitespace character.

Parameters

const TDesC8 &aValue

A valid format list.

Leave codes

KErrSdpCodecMediaField

if aValue contains invalid tokens


Info()

IMPORT_C const TDesC8 &Info() const;

Description

Return the media level info field value.

Return value

const TDesC8 &

The value or an empty descriptor if not present.


SetInfoL()

IMPORT_C void SetInfoL(const TDesC8 &aValue);

Description

Sets the media level info field value.

Parameters

const TDesC8 &aValue

A valid info field value.

Leave codes

KErrSdpCodecMediaInfoField

if aValue is not KNullDesC8 or aValue includes invalid byte strings (´´, ´ ´, ´´).


Key()

IMPORT_C CSdpKeyField *Key();

Description

Gets the media level encryption key field. Note, that the ownership is not transferred and the instance must not be deleted by the caller.

Return value

CSdpKeyField *

Encryption key field or null if not present.


Key()

IMPORT_C const CSdpKeyField *Key() const;

Description

Gets the media level encryption key field.

Return value

const CSdpKeyField *

Encryption key field or null if not present.


SetKey()

IMPORT_C void SetKey(CSdpKeyField *aObj);

Description

Sets or removes the media level encryption key field.

Parameters

CSdpKeyField *aObj

The new key field or null if field is to be removed. Ownership of the referenced object is transferred to the media field instance.


FormatAttributeFields()

IMPORT_C RPointerArray< CSdpFmtAttributeField > &FormatAttributeFields();

Description

Gets the set of media format level attributes. This array is used directly for element insertion and removal.

The objects referenced from the array are owned by the media field instance and must not be deleted. An object can be removed from the media description by setting the corresponding element to zero. By doing so, the calling party receives ownership of the removed object.

Return value

RPointerArray< CSdpFmtAttributeField > &

The set of media format level attributes.


AttributeFields()

IMPORT_C RPointerArray< CSdpAttributeField > &AttributeFields();

Description

Gets the set of media level, format independent attributes. This array is used directly for element insertion and removal.

The objects referenced from the array are owned by the media field instance and must not be deleted. An object can be removed from the media description by setting the corresponding element to zero. By doing so, the calling party receives ownership of the removed object.

Return value

RPointerArray< CSdpAttributeField > &

The set of media level attributes.


BandwidthFields()

IMPORT_C RPointerArray< CSdpBandwidthField > &BandwidthFields();

Description

Gets the set of media level bandwidth fields. This array is used directly for element insertion and removal.

The objects referenced from the array are owned by the media field instance and must not be deleted. An object can be removed from the media description by setting the corresponding element to zero. By doing so, the calling party receives ownership of the removed object.

Return value

RPointerArray< CSdpBandwidthField > &

The set of media level bandwidth fields.


ConnectionFields()

IMPORT_C RPointerArray< CSdpConnectionField > &ConnectionFields();

Description

Gets the set of media level connection fields. This array is used directly for element insertion and removal.

The objects referenced from the array are owned by the media field instance and must not be deleted. An object can be removed from the media description by setting the corresponding element to zero. By doing so, the calling party receives ownership of the removed object.

Return value

RPointerArray< CSdpConnectionField > &

The set of media level connection fields.


RemoveFormatL()

IMPORT_C void RemoveFormatL(const TDesC8 &aFormat);

Description

Removes a specific format from the media description. The function will remove the named format from the format list if found and then delete all format level attributes of type CSdpFmtAttributeField related to the removed format.

Parameters

const TDesC8 &aFormat

The name of the format to remove.


KeepFormatL()

IMPORT_C void KeepFormatL(const TDesC8 &aFormat);

Description

Removes all formats except one from the media description. The function will set the format list to only contain the one format to keep and then delete all format level attributes that are related to the removed formats. If the format is not found from the format list, it is added there. If there are no format level attributes for the specified format, the format level attribute set will be empty.

Parameters

const TDesC8 &aFormat

The name of the format to keep after removing all others.


RejectMedia()

IMPORT_C void RejectMedia();

Description

Sets this media description into rejected state. The rejected state is defined by the offer/answer model in RFC3264. The function sets the port number to 0 and removes all formats except one. The remaining format is determined by the implementation.