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
Constructor & Destructor Documentation
CSdpMediaField()
CSdpMediaField
|
(
|
)
|
[private]
|
CSdpMediaField(const CSdpMediaField &)
~CSdpMediaField()
IMPORT_C
|
~CSdpMediaField
|
(
|
)
|
|
Deletes the resources held by the instance.
Member Functions Documentation
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)
Creates a new instance that is equal to the target. Optionally also related subfields are cloned.
Parameters
TBool
aRecurse = ETrue
|
Flag to specify whether to clone subfields also (ETrue) or only the media field (EFalse).
|
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()
void
|
ConstructL
|
(
|
)
|
[private]
|
ConstructL(TBool)
void
|
ConstructL
|
(
|
TBool
|
aRecurse
|
)
|
[private]
|
ConstructL(RStringF, TUint, RStringF, const TDesC8 &)
ConstructL(const CSdpMediaField &)
DecodeL(const TDesC8 &, TBool)
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 = ETrue
|
If ETrue, attempts to construct also media attributes following the CRLF terminating the media field.
|
DecodeLC(const TDesC8 &, TBool)
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 = ETrue
|
If ETrue, attempts to construct also media attributes following the CRLF terminating the media field.
|
DoInternalizeL(RReadStream &)
void
|
DoInternalizeL
|
(
|
RReadStream
&
|
aStream
|
)
|
[private]
|
EncodeL(RWriteStream &, TBool)
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 = ETrue
|
Flag to specify whether to output media attributes also (ETrue) or only the media field (EFalse).
|
ExternalizeL(RWriteStream &)
Externalizes the object to stream
Parameters
RWriteStream
& aStream
|
Stream where the object's state will be stored
|
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
|
GetTokenFromStreamL(RReadStream &)
Info()
IMPORT_C const
TDesC8
&
|
Info
|
(
|
)
|
const
|
Return the media level info field value.
InternalizeL(RReadStream &)
Creates object from the stream data
Parameters
RReadStream
& aStream
|
Stream where the object's state will be read
|
IsContactPresent()
TBool
|
IsContactPresent
|
(
|
)
|
const
|
Shows if contact is present
IsValid()
IMPORT_C
TBool
|
IsValid
|
(
|
)
|
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 void
|
KeepFormatL
|
(
|
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
& aFormat
|
The name of the format to keep after removing all others.
|
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()
Gets the media level encryption key field.
NewL(RStringF, TUint, RStringF, const TDesC8 &)
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.
|
NewLC(RStringF, TUint, RStringF, const TDesC8 &)
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.
|
ParseAttributeFieldsL()
void
|
ParseAttributeFieldsL
|
(
|
)
|
[private]
|
ParseBandwithL()
void
|
ParseBandwithL
|
(
|
)
|
[private]
|
ParseConnectionL()
void
|
ParseConnectionL
|
(
|
)
|
[private]
|
ParseEncryptionKeyL()
void
|
ParseEncryptionKeyL
|
(
|
)
|
[private]
|
ParseInformationL()
void
|
ParseInformationL
|
(
|
)
|
[private]
|
ParseL(const TDesC8 &)
void
|
ParseL
|
(
|
const
TDesC8
&
|
aText
|
)
|
[private]
|
ParseMediaL()
void
|
ParseMediaL
|
(
|
)
|
[private]
|
Port()
IMPORT_C
TUint
|
Port
|
(
|
)
|
const
|
PortCount()
IMPORT_C
TUint
|
PortCount
|
(
|
)
|
const
|
RejectMedia()
IMPORT_C void
|
RejectMedia
|
(
|
)
|
|
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 void
|
RemoveFormatL
|
(
|
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
& aFormat
|
The name of the format to remove.
|
SetFormatListL(const TDesC8 &)
IMPORT_C void
|
SetFormatListL
|
(
|
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
& aValue
|
A valid format list.
|
SetInfoL(const TDesC8 &)
IMPORT_C void
|
SetInfoL
|
(
|
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
& aValue
|
A valid info field value.
|
SetKey(CSdpKeyField *)
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.
|
SetMediaL(RStringF)
IMPORT_C void
|
SetMediaL
|
(
|
RStringF
|
aMedia
|
)
|
|
Sets the media type.
-
leave
-
KErrSdpCodecMediaField if aMedia is not valid character
SetPortCountL(TUint)
IMPORT_C void
|
SetPortCountL
|
(
|
TUint
|
aCount
|
)
|
|
Sets the port count.
-
leave
-
KErrSdpCodecMediaField if aCount equals to zero.
Parameters
TUint
aCount
|
The port count that must be greater than zero.
|
SetPortL(TUint)
IMPORT_C void
|
SetPortL
|
(
|
TUint
|
aPort
|
)
|
|
Sets the port number.
-
leave
-
KErrSdpCodecMediaField if port is not valid number as defined in draft-ietf-mmusic-sdp-new-14
Parameters
TUint
aPort
|
The port number.
|
SetProtocolL(RStringF)
IMPORT_C void
|
SetProtocolL
|
(
|
RStringF
|
aProtocol
|
)
|
|
Sets the media protocol.
-
leave
-
KErrSdpCodecMediaField if aProtocol containing two elements divided by slash are not valid tokens.
operator=(const CSdpMediaField &)
operator==(const CSdpMediaField &)
Compares this instance to another for equality. Subfields are included in the comparison if present.
Member Data Documentation
RPointerArray< CSdpAttributeField > * iAttributeFields
RPointerArray< CSdpBandwidthField > * iBandwidthFields
RPointerArray
<
CSdpBandwidthField
> *
|
iBandwidthFields
|
[private]
|
RPointerArray< CSdpConnectionField > * iConnectionFields
RArray< TPtrC8 > iElementArray
RPointerArray< CSdpFmtAttributeField > * iFmtAttrFields
HBufC8 * iFormatList
HBufC8
*
|
iFormatList
|
[private]
|
TUint
iPortCount
TUint
|
iPortCount
|
[private]
|
CSdpCodecParseUtil * iSdpCodecParseUtil
CSdpKeyField * iSdpKeyField
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.