CSdpMediaField Class Reference

class CSdpMediaField : public CBase

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

Inherits from

Public Member Functions
~CSdpMediaField()
IMPORT_C RPointerArray< CSdpAttributeField > &AttributeFields()
IMPORT_C RPointerArray< CSdpBandwidthField > &BandwidthFields()
IMPORT_C CSdpMediaField *CloneL(TBool)
IMPORT_C RPointerArray< CSdpConnectionField > &ConnectionFields()
IMPORT_C CSdpMediaField *DecodeL(const TDesC8 &, TBool)
IMPORT_C CSdpMediaField *DecodeLC(const TDesC8 &, TBool)
IMPORT_C voidEncodeL(RWriteStream &, TBool)
voidExternalizeL(RWriteStream &)
IMPORT_C RPointerArray< CSdpFmtAttributeField > &FormatAttributeFields()
IMPORT_C const TDesC8 &FormatList()
IMPORT_C const TDesC8 &Info()
CSdpMediaField *InternalizeL(RReadStream &)
TBool IsContactPresent()
IMPORT_C TBoolIsValid()
IMPORT_C voidKeepFormatL(const TDesC8 &)
IMPORT_C CSdpKeyField *Key()
IMPORT_C const CSdpKeyField *Key()
IMPORT_C RStringFMedia()
IMPORT_C CSdpMediaField *NewL(RStringF, TUint, RStringF, const TDesC8 &)
IMPORT_C CSdpMediaField *NewLC(RStringF, TUint, RStringF, const TDesC8 &)
IMPORT_C TUintPort()
IMPORT_C TUintPortCount()
IMPORT_C RStringFProtocol()
IMPORT_C voidRejectMedia()
IMPORT_C voidRemoveFormatL(const TDesC8 &)
IMPORT_C voidSetFormatListL(const TDesC8 &)
IMPORT_C voidSetInfoL(const TDesC8 &)
IMPORT_C voidSetKey(CSdpKeyField *)
IMPORT_C voidSetMediaL(RStringF)
IMPORT_C voidSetPortCountL(TUint)
IMPORT_C voidSetPortL(TUint)
IMPORT_C voidSetProtocolL(RStringF)
IMPORT_C TBooloperator==(const CSdpMediaField &)
Private Member Functions
CSdpMediaField()
CSdpMediaField(const CSdpMediaField &)
voidConstructL()
voidConstructL(TBool)
voidConstructL(RStringF, TUint, RStringF, const TDesC8 &)
voidConstructL(const CSdpMediaField &)
voidDoInternalizeL(RReadStream &)
TDesC8 &GetTokenFromStreamL(RReadStream &)
voidParseAttributeFieldsL()
voidParseBandwithL()
voidParseConnectionL()
voidParseEncryptionKeyL()
voidParseInformationL()
voidParseL(const TDesC8 &)
voidParseMediaL()
CSdpMediaField &operator=(const CSdpMediaField &)
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
RPointerArray< CSdpAttributeField > *iAttributeFields
RPointerArray< CSdpBandwidthField > *iBandwidthFields
RPointerArray< CSdpConnectionField > *iConnectionFields
RArray< TPtrC8 >iElementArray
RPointerArray< CSdpFmtAttributeField > *iFmtAttrFields
HBufC8 *iFormatList
HBufC8 *iInfo
RStringF iMedia
RStringPool iPool
TUint iPort
TUint iPortCount
RStringF iProtocol
TBool iRecurse
CSdpCodecParseUtil *iSdpCodecParseUtil
CSdpKeyField *iSdpKeyField
HBufC8 *iToken

Constructor & Destructor Documentation

CSdpMediaField()

CSdpMediaField()[private]

CSdpMediaField(const CSdpMediaField &)

CSdpMediaField(const CSdpMediaField &)[private]

Parameters

const CSdpMediaField &

~CSdpMediaField()

IMPORT_C~CSdpMediaField()

Deletes the resources held by the instance.

Member Functions Documentation

AttributeFields()

IMPORT_C RPointerArray< CSdpAttributeField > &AttributeFields()

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.

BandwidthFields()

IMPORT_C RPointerArray< CSdpBandwidthField > &BandwidthFields()

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.

CloneL(TBool)

IMPORT_C CSdpMediaField *CloneL(TBoolaRecurse = ETrue)const

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

Parameters

TBool aRecurse = ETrueFlag to specify whether to clone subfields also (ETrue) or only the media field (EFalse).

ConnectionFields()

IMPORT_C RPointerArray< CSdpConnectionField > &ConnectionFields()

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.

ConstructL()

voidConstructL()[private]

ConstructL(TBool)

voidConstructL(TBoolaRecurse)[private]

Parameters

TBool aRecurse

ConstructL(RStringF, TUint, RStringF, const TDesC8 &)

voidConstructL(RStringFaMedia,
TUintaPort,
RStringFaProtocol,
const TDesC8 &aFormatList
)[private]

Parameters

RStringF aMedia
TUint aPort
RStringF aProtocol
const TDesC8 & aFormatList

ConstructL(const CSdpMediaField &)

voidConstructL(const CSdpMediaField &aSdpMediaField)[private]

Parameters

const CSdpMediaField & aSdpMediaField

DecodeL(const TDesC8 &, TBool)

IMPORT_C CSdpMediaField *DecodeL(const TDesC8 &aText,
TBoolaRecurse = ETrue
)[static]

Constructs a new media description field.

Parameters

const TDesC8 & aTextA correctly formatted media field terminated by a CRLF followed by zero or more media attribute fields separated by a CRLF.
TBool aRecurse = ETrueIf ETrue, attempts to construct also media attributes following the CRLF terminating the media field.

DecodeLC(const TDesC8 &, TBool)

IMPORT_C CSdpMediaField *DecodeLC(const TDesC8 &aText,
TBoolaRecurse = ETrue
)[static]

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

Parameters

const TDesC8 & aTextA correctly formatted media field terminated by a CRLF followed by zero or more media attribute fields separated by a CRLF.
TBool aRecurse = ETrueIf ETrue, attempts to construct also media attributes following the CRLF terminating the media field.

DoInternalizeL(RReadStream &)

voidDoInternalizeL(RReadStream &aStream)[private]

Parameters

RReadStream & aStream

EncodeL(RWriteStream &, TBool)

IMPORT_C voidEncodeL(RWriteStream &aStream,
TBoolaRecurse = ETrue
)const

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

Parameters

RWriteStream & aStreamStream used for output. On return the stream includes correctly formatted media field with media part fields if aRecurse is defined to ETrue.
TBool aRecurse = ETrueFlag to specify whether to output media attributes also (ETrue) or only the media field (EFalse).

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const

Externalizes the object to stream

Parameters

RWriteStream & aStreamStream where the object's state will be stored

FormatAttributeFields()

IMPORT_C RPointerArray< CSdpFmtAttributeField > &FormatAttributeFields()

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.

FormatList()

IMPORT_C const TDesC8 &FormatList()const

Gets the format list.

GetTokenFromStreamL(RReadStream &)

TDesC8 &GetTokenFromStreamL(RReadStream &aStream)[private]

Parameters

RReadStream & aStream

Info()

IMPORT_C const TDesC8 &Info()const

Return the media level info field value.

InternalizeL(RReadStream &)

CSdpMediaField *InternalizeL(RReadStream &aStream)[static]

Creates object from the stream data

Parameters

RReadStream & aStreamStream where the object's state will be read

IsContactPresent()

TBool IsContactPresent()const

Shows if contact is present

IsValid()

IMPORT_C TBoolIsValid()const

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.

KeepFormatL(const TDesC8 &)

IMPORT_C voidKeepFormatL(const TDesC8 &aFormat)

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 & aFormatThe name of the format to keep after removing all others.

Key()

IMPORT_C CSdpKeyField *Key()

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

Key()

IMPORT_C const CSdpKeyField *Key()const

Gets the media level encryption key field.

Media()

IMPORT_C RStringFMedia()const

Gets the media type.

NewL(RStringF, TUint, RStringF, const TDesC8 &)

IMPORT_C CSdpMediaField *NewL(RStringFaMedia,
TUintaPort,
RStringFaProtocol,
const TDesC8 &aFormatList
)[static]

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

Parameters

RStringF aMediaA valid media type name.
TUint aPortPort number.
RStringF aProtocolA valid media protocol name.
const TDesC8 & aFormatListA valid format list.

NewLC(RStringF, TUint, RStringF, const TDesC8 &)

IMPORT_C CSdpMediaField *NewLC(RStringFaMedia,
TUintaPort,
RStringFaProtocol,
const TDesC8 &aFormatList
)[static]

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 aMediaA valid media type name.
TUint aPortPort number.
RStringF aProtocolA valid media protocol name.
const TDesC8 & aFormatListA valid format list.

ParseAttributeFieldsL()

voidParseAttributeFieldsL()[private]

ParseBandwithL()

voidParseBandwithL()[private]

ParseConnectionL()

voidParseConnectionL()[private]

ParseEncryptionKeyL()

voidParseEncryptionKeyL()[private]

ParseInformationL()

voidParseInformationL()[private]

ParseL(const TDesC8 &)

voidParseL(const TDesC8 &aText)[private]

Parameters

const TDesC8 & aText

ParseMediaL()

voidParseMediaL()[private]

Port()

IMPORT_C TUintPort()const

Gets the port number.

PortCount()

IMPORT_C TUintPortCount()const

Gets the port count.

Protocol()

IMPORT_C RStringFProtocol()const

Gets the media protocol.

RejectMedia()

IMPORT_C voidRejectMedia()

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.

RemoveFormatL(const TDesC8 &)

IMPORT_C voidRemoveFormatL(const TDesC8 &aFormat)

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 & aFormatThe name of the format to remove.

SetFormatListL(const TDesC8 &)

IMPORT_C voidSetFormatListL(const TDesC8 &aValue)

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

leave
KErrSdpCodecMediaField if aValue contains invalid tokens

Parameters

const TDesC8 & aValueA valid format list.

SetInfoL(const TDesC8 &)

IMPORT_C voidSetInfoL(const TDesC8 &aValue)

Sets the media level info field value.

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

Parameters

const TDesC8 & aValueA valid info field value.

SetKey(CSdpKeyField *)

IMPORT_C voidSetKey(CSdpKeyField *aObj)

Sets or removes the media level encryption key field.

Parameters

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

SetMediaL(RStringF)

IMPORT_C voidSetMediaL(RStringFaMedia)

Sets the media type.

leave
KErrSdpCodecMediaField if aMedia is not valid character

Parameters

RStringF aMediaThe media type.

SetPortCountL(TUint)

IMPORT_C voidSetPortCountL(TUintaCount)

Sets the port count.

leave
KErrSdpCodecMediaField if aCount equals to zero.

Parameters

TUint aCountThe port count that must be greater than zero.

SetPortL(TUint)

IMPORT_C voidSetPortL(TUintaPort)

Sets the port number.

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

Parameters

TUint aPortThe port number.

SetProtocolL(RStringF)

IMPORT_C voidSetProtocolL(RStringFaProtocol)

Sets the media protocol.

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

Parameters

RStringF aProtocolThe media protocol.

operator=(const CSdpMediaField &)

CSdpMediaField &operator=(const CSdpMediaField &)[private]

Parameters

const CSdpMediaField &

operator==(const CSdpMediaField &)

IMPORT_C TBooloperator==(const CSdpMediaField &aObj)const

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

Parameters

const CSdpMediaField & aObjThe instance to compare to.

Member Data Documentation

RPointerArray< CSdpAttributeField > * iAttributeFields

RPointerArray< CSdpAttributeField > *iAttributeFields[private]

RPointerArray< CSdpBandwidthField > * iBandwidthFields

RPointerArray< CSdpBandwidthField > *iBandwidthFields[private]

RPointerArray< CSdpConnectionField > * iConnectionFields

RPointerArray< CSdpConnectionField > *iConnectionFields[private]

RArray< TPtrC8 > iElementArray

RArray< TPtrC8 >iElementArray[private]

RPointerArray< CSdpFmtAttributeField > * iFmtAttrFields

RPointerArray< CSdpFmtAttributeField > *iFmtAttrFields[private]

HBufC8 * iFormatList

HBufC8 *iFormatList[private]

HBufC8 * iInfo

HBufC8 *iInfo[private]

RStringF iMedia

RStringF iMedia[private]

RStringPool iPool

RStringPool iPool[private]

TUint iPort

TUint iPort[private]

TUint iPortCount

TUint iPortCount[private]

RStringF iProtocol

RStringF iProtocol[private]

TBool iRecurse

TBool iRecurse[private]

CSdpCodecParseUtil * iSdpCodecParseUtil

CSdpCodecParseUtil *iSdpCodecParseUtil[private]

CSdpKeyField * iSdpKeyField

CSdpKeyField *iSdpKeyField[private]

HBufC8 * iToken

HBufC8 *iToken[private]