»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
Multimedia Protocols SIP_COM »
CSdpMediaField
Location:
SdpMediaField.h
Link against: sdpcodec.lib
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
CBase
- Base class for all classes to be instantiated on the heap
CSdpMediaField
- This class encapsulates the media description field and related media specific subfields of the Session Description Protocol
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
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
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
IMPORT_C ~CSdpMediaField();
Description
Deletes the resources held by the instance.
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
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
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).
|
|
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
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
Return value
TBool
|
ETrue if equal, EFalse if not.
|
|
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.
|
|
IMPORT_C RStringF Media() const;
Description
Gets the media type.
Return value
IMPORT_C void SetMediaL(RStringF aMedia);
Description
Sets the media type.
Parameters
Leave codes
KErrSdpCodecMediaField |
if aMedia is not valid character
|
|
IMPORT_C RStringF Protocol() const;
Description
Gets the media protocol.
Return value
IMPORT_C void SetProtocolL(RStringF aProtocol);
Description
Sets the media protocol.
Parameters
Leave codes
KErrSdpCodecMediaField |
if aProtocol containing two elements divided by slash are not valid tokens.
|
|
IMPORT_C TUint Port() const;
Description
Gets the port number.
Return value
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
|
|
IMPORT_C TUint PortCount() const;
Description
Gets the port count.
Return value
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.
|
|
IMPORT_C const TDesC8 &FormatList() const;
Description
Gets the format list.
Return value
const TDesC8 & |
The format list.
|
|
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
|
|
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.
|
|
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 (´´, ´ ´, ´´).
|
|
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
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.
|
|
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.
|
|
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
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
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
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
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.
|
|
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.
|
|
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.