S60 3rd Edition API Reference: CSdpMediaField Class Reference

CSdpMediaField Class Reference

API published in: S60 2nd Ed

Link against: sdpcodec.lib

Capability Information

Required Capabilities

None

Exceptions


#include <sdpmediafield.h>

Detailed Description

PublishedAll
Released
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.


Public Member Functions

IMPORT_C ~CSdpMediaField ()
 Deletes the resources held by the instance.
IMPORT_C void EncodeL (RWriteStream &aStream, TBool aRecurse=ETrue) const
 Outputs the field formatted according to SDP syntax and including the terminating CRLF.
IMPORT_C CSdpMediaFieldCloneL (TBool aRecurse=ETrue) const
 Creates a new instance that is equal to the target.
IMPORT_C TBool operator== (const CSdpMediaField &aObj) const
 Compares this instance to another for equality.
IMPORT_C TBool IsValid () const
 Checks the consistency between the media field and it's subfields.
IMPORT_C RStringF Media () const
 Gets the media type.
IMPORT_C void SetMediaL (RStringF aMedia)
 Sets the media type.
IMPORT_C RStringF Protocol () const
 Gets the media protocol.
IMPORT_C void SetProtocolL (RStringF aProtocol)
 Sets the media protocol.
IMPORT_C TUint Port () const
 Gets the port number.
IMPORT_C void SetPortL (TUint aPort)
 Sets the port number.
IMPORT_C TUint PortCount () const
 Gets the port count.
IMPORT_C void SetPortCountL (TUint aCount)
 Sets the port count.
IMPORT_C const TDesC8 & FormatList () const
 Gets the format list.
IMPORT_C void SetFormatListL (const TDesC8 &aValue)
 Sets the format list.
IMPORT_C const TDesC8 & Info () const
 Return the media level info field value.
IMPORT_C void SetInfoL (const TDesC8 &aValue)
 Sets the media level info field value.
IMPORT_C CSdpKeyFieldKey ()
 Gets the media level encryption key field.
IMPORT_C const CSdpKeyFieldKey () const
 Gets the media level encryption key field.
IMPORT_C void SetKey (CSdpKeyField *aObj)
 Sets or removes the media level encryption key field.
IMPORT_C RPointerArray< CSdpFmtAttributeField > & FormatAttributeFields ()
 Gets the set of media format level attributes.
IMPORT_C RPointerArray< CSdpAttributeField > & AttributeFields ()
 Gets the set of media level, format independent attributes.
IMPORT_C RPointerArray< CSdpBandwidthField > & BandwidthFields ()
 Gets the set of media level bandwidth fields.
IMPORT_C RPointerArray< CSdpConnectionField > & ConnectionFields ()
 Gets the set of media level connection fields.
IMPORT_C void RemoveFormatL (const TDesC8 &aFormat)
 Removes a specific format from the media description.
IMPORT_C void KeepFormatL (const TDesC8 &aFormat)
 Removes all formats except one from the media description.
IMPORT_C void RejectMedia ()
 Sets this media description into rejected state.
TBool IsContactPresent () const
 Shows if contact is present.
void ExternalizeL (RWriteStream &aStream) const
 Externalizes the object to stream.

Static Public Member Functions

static IMPORT_C CSdpMediaFieldDecodeL (const TDesC8 &aText, TBool aRecurse=ETrue)
 Constructs a new media description field.
static IMPORT_C CSdpMediaFieldDecodeLC (const TDesC8 &aText, TBool aRecurse=ETrue)
 Constructs a new media description field and adds the pointer to the cleanup stack.
static IMPORT_C CSdpMediaFieldNewL (RStringF aMedia, TUint aPort, RStringF aProtocol, const TDesC8 &aFormatList)
 Constructs a new media description field.
static IMPORT_C CSdpMediaFieldNewLC (RStringF aMedia, TUint aPort, RStringF aProtocol, const TDesC8 &aFormatList)
 Constructs a new media description field and adds the pointer to the cleanup stack.
static CSdpMediaFieldInternalizeL (RReadStream &aStream)
 Creates object from the stream data.

Constructor & Destructor Documentation

IMPORT_C CSdpMediaField::~CSdpMediaField  ) 
 

Deletes the resources held by the instance.


Member Function Documentation

IMPORT_C RPointerArray<CSdpAttributeField>& CSdpMediaField::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.

Returns:
The set of media level attributes.
IMPORT_C RPointerArray<CSdpBandwidthField>& CSdpMediaField::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.

Returns:
The set of media level bandwidth fields.
IMPORT_C CSdpMediaField* CSdpMediaField::CloneL TBool  aRecurse = ETrue  )  const
 

Creates a new instance that is equal to the target.

Optionally also related subfields are cloned.

Parameters:
aRecurse Flag to specify whether to clone subfields also (ETrue) or only the media field (EFalse).
Returns:
a new instance.
IMPORT_C RPointerArray<CSdpConnectionField>& CSdpMediaField::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.

Returns:
The set of media level connection fields.
static IMPORT_C CSdpMediaField* CSdpMediaField::DecodeL const TDesC8 &  aText,
TBool  aRecurse = ETrue
[static]
 

Constructs a new media description field.

Parameters:
aText A correctly formatted media field terminated by a CRLF followed by zero or more media attribute fields separated by a CRLF.
aRecurse If ETrue, attempts to construct also media attributes following the CRLF terminating the media field.
Returns:
a new instance.
static IMPORT_C CSdpMediaField* CSdpMediaField::DecodeLC const TDesC8 &  aText,
TBool  aRecurse = ETrue
[static]
 

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

Parameters:
aText A correctly formatted media field terminated by a CRLF followed by zero or more media attribute fields separated by a CRLF.
aRecurse If ETrue, attempts to construct also media attributes following the CRLF terminating the media field.
Returns:
a new instance.
IMPORT_C void CSdpMediaField::EncodeL RWriteStream &  aStream,
TBool  aRecurse = ETrue
const
 

Outputs the field formatted according to SDP syntax and including the terminating CRLF.

Optionally output also the related media level fields.

Parameters:
aStream Stream used for output. On return the stream includes correctly formatted media field with media part fields if aRecurse is defined to ETrue.
aRecurse Flag to specify whether to output media attributes also (ETrue) or only the media field (EFalse).
void CSdpMediaField::ExternalizeL RWriteStream &  aStream  )  const
 

Externalizes the object to stream.

Parameters:
aStream Stream where the object's state will be stored
IMPORT_C RPointerArray<CSdpFmtAttributeField>& CSdpMediaField::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.

Returns:
The set of media format level attributes.
IMPORT_C const TDesC8& CSdpMediaField::FormatList  )  const
 

Gets the format list.

Returns:
The format list.
IMPORT_C const TDesC8& CSdpMediaField::Info  )  const
 

Return the media level info field value.

Returns:
The value or an empty descriptor if not present.
static CSdpMediaField* CSdpMediaField::InternalizeL RReadStream &  aStream  )  [static]
 

Creates object from the stream data.

Parameters:
aStream Stream where the object's state will be read
Returns:
Initialized object
TBool CSdpMediaField::IsContactPresent  )  const
 

Shows if contact is present.

Returns:
ETrue if contact present, otherwise EFalse
IMPORT_C TBool CSdpMediaField::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.

Returns:
ETrue if media description is consistent and EFalse if not.
IMPORT_C void CSdpMediaField::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:
aFormat The name of the format to keep after removing all others.
IMPORT_C const CSdpKeyField* CSdpMediaField::Key  )  const
 

Gets the media level encryption key field.

Returns:
Encryption key field or null if not present.
IMPORT_C CSdpKeyField* CSdpMediaField::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.

Returns:
Encryption key field or null if not present.
IMPORT_C RStringF CSdpMediaField::Media  )  const
 

Gets the media type.

Returns:
The media type.
static IMPORT_C CSdpMediaField* CSdpMediaField::NewL RStringF  aMedia,
TUint  aPort,
RStringF  aProtocol,
const TDesC8 &  aFormatList
[static]
 

Constructs a new media description field.

The optional portcount component of the field is initialized to 1.

Parameters:
aMedia A valid media type name.
aPort Port number.
aProtocol A valid media protocol name.
aFormatList A valid format list.
Returns:
a new instance.
static IMPORT_C CSdpMediaField* CSdpMediaField::NewLC RStringF  aMedia,
TUint  aPort,
RStringF  aProtocol,
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:
aMedia A valid media type name.
aPort Port number.
aProtocol A valid media protocol name.
aFormatList A valid format list.
Returns:
a new instance.
IMPORT_C TBool CSdpMediaField::operator== const CSdpMediaField aObj  )  const
 

Compares this instance to another for equality.

Subfields are included in the comparison if present.

Parameters:
aObj The instance to compare to.
Returns:
ETrue if equal, EFalse if not.
IMPORT_C TUint CSdpMediaField::Port  )  const
 

Gets the port number.

Returns:
The port number.
IMPORT_C TUint CSdpMediaField::PortCount  )  const
 

Gets the port count.

Returns:
The port count.
IMPORT_C RStringF CSdpMediaField::Protocol  )  const
 

Gets the media protocol.

Returns:
The media protocol.
IMPORT_C void CSdpMediaField::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.

IMPORT_C void CSdpMediaField::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:
aFormat The name of the format to remove.
IMPORT_C void CSdpMediaField::SetFormatListL const TDesC8 &  aValue  ) 
 

Sets the format list.

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

Parameters:
aValue A valid format list.
Leave:
KErrSdpCodecMediaField if aValue contains invalid tokens
IMPORT_C void CSdpMediaField::SetInfoL const TDesC8 &  aValue  ) 
 

Sets the media level info field value.

Parameters:
aValue A valid info field value.
Leave:
KErrSdpCodecMediaInfoField if aValue is not KNullDesC8 or aValue includes invalid byte strings (´´, ´
´, ´´).
IMPORT_C void CSdpMediaField::SetKey CSdpKeyField aObj  ) 
 

Sets or removes the media level encryption key field.

Parameters:
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 void CSdpMediaField::SetMediaL RStringF  aMedia  ) 
 

Sets the media type.

Parameters:
aMedia The media type.
Leave:
KErrSdpCodecMediaField if aMedia is not valid character
IMPORT_C void CSdpMediaField::SetPortCountL TUint  aCount  ) 
 

Sets the port count.

Parameters:
aCount The port count that must be greater than zero.
Leave:
KErrSdpCodecMediaField if aCount equals to zero.
IMPORT_C void CSdpMediaField::SetPortL TUint  aPort  ) 
 

Sets the port number.

Parameters:
aPort The port number.
Leave:
KErrSdpCodecMediaField if port is not valid number as defined in draft-ietf-mmusic-sdp-new-14
IMPORT_C void CSdpMediaField::SetProtocolL RStringF  aProtocol  ) 
 

Sets the media protocol.

Parameters:
aProtocol The media protocol.
Leave:
KErrSdpCodecMediaField if aProtocol containing two elements divided by slash are not valid tokens.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2007
Back to top