CMceCodec Class Reference

class CMceCodec : public CBase

Base class for codecs.

It defines setters and getters for generic codec attributes.

In some systems certain device resources cannot be shared. For example speaker of the device might not be able to play simultaneously several differently encoded audio streams. Or only one client at the time could use the camera of the device. Codec states can be used to overcome situations where single codec would occupy some resource for excessive period of time or permanently.

Codec can be in one of the three states:

When codec is in state EEnabled, resources, associated with the codec, are reserved for the codec and in some cases cannot be used by other software components. Precondition for reserving resources for the codec is that associated device resource (e.g. speaker sink of downlink or camera source of uplink) is also enabled.

When codec is in state EStandby, resources are not reserved for the codec and therefore can be used by other software components. If the stream (uplink or downlink), into which this codec is attached, encounters data encoded with the codec, codec in state EStandby is tried to be enabled. If enabling succeeds, codec state changes to EEnabled and associated resources are reserved.

When codec is in state EDisabled, resources are not reserved for the codec and are not even tried to be reserved.

mceclient.lib

Inherits from

Public Member Functions
~CMceCodec ()
IMPORT_C TUint AllowedBitrates ()
void Attach ( CMceMediaStream &)
TMceFactory BaseFactory ()
IMPORT_C TUint Bitrate ()
IMPORT_C TUint CodecMode ()
TInt EventReceivedL ( TMceEvent &)
void ExternalizeFlatL ( RWriteStream &)
void ExternalizeL ( MMceComSerializationContext &)
CMceComCodec * FlatData ()
IMPORT_C TUint32 FourCC ()
IMPORT_C TUint FrameSize ()
TMceMediaId Id ()
void InitializeL ( CMceMediaStream &)
void InternalizeFlatL ( RReadStream &)
void InternalizeL ( MMceComSerializationContext &)
IMPORT_C const TDesC8 & KeepAliveData ()
IMPORT_C TUint8 KeepAlivePayloadType ()
IMPORT_C TUint8 KeepAliveTimer ()
IMPORT_C TInt MMFPriority ()
IMPORT_C TInt MMFPriorityPreference ()
IMPORT_C TUint8 PayloadType ()
IMPORT_C TInt Preference ()
IMPORT_C const TDesC8 & SdpName ()
TUint64 SerializationId ()
TInt SetAllowedBitrates ( TUint )
TInt SetBitrate ( TUint )
TInt SetCodecMode ( TUint )
IMPORT_C void SetKeepAliveDataL (const TDesC8 &)
IMPORT_C void SetKeepAlivePayloadTypeL ( TUint8 )
IMPORT_C void SetKeepAliveTimerL ( TUint8 )
IMPORT_C void SetMMFPriorityL ( TInt )
IMPORT_C void SetMMFPriorityPreferenceL ( TInt )
TInt SetPayloadType ( TUint8 )
IMPORT_C void SetPreferenceL ( TInt )
IMPORT_C void SetStandByTimerL ( TUint32 )
IMPORT_C void SetStateL ( CMceCodec::TState )
IMPORT_C CMceCodec::TState State ()
IMPORT_C TMceCodecType Type ()
void Updated ()
Protected Member Functions
CMceCodec ()
void ConstructL ( CMceComCodec *)
void SetSdpNameL (const TDesC8 &)
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()
Public Member Enumerations
enum TState { EDisabled , EStandby , EEnabled }
Protected Attributes
CMceComCodec * iFlatData
CMceMediaStream * iStream
TMceCodecType iType
Private Attributes
TAny * iReserved

Constructor & Destructor Documentation

CMceCodec()

CMceCodec ( ) [protected]

C++ default constructor.

~CMceCodec()

~CMceCodec ( ) [virtual]

Destructor.

Member Functions Documentation

AllowedBitrates()

IMPORT_C TUint AllowedBitrates ( ) const

Gets allowed bitrate values.

Attach(CMceMediaStream &)

void Attach ( CMceMediaStream & aParent )

Attaches stream to codec, preliminary intialization.

Parameters

CMceMediaStream & aParent

BaseFactory()

TMceFactory BaseFactory ( )

Gets the base factory.

Bitrate()

IMPORT_C TUint Bitrate ( ) const

Gets current bitrate.

CodecMode()

IMPORT_C TUint CodecMode ( ) const

Gets the codec mode.

ConstructL(CMceComCodec *)

void ConstructL ( CMceComCodec * aFlatData ) [protected]

Second-phase constructor.

Parameters

CMceComCodec * aFlatData flat data container

EventReceivedL(TMceEvent &)

TInt EventReceivedL ( TMceEvent & aEvent ) [virtual]

Traversal event handler.

Parameters

TMceEvent & aEvent the event

ExternalizeFlatL(RWriteStream &)

void ExternalizeFlatL ( RWriteStream & aWriteStream )

Externalizes flat data

Parameters

RWriteStream & aWriteStream write stream

ExternalizeL(MMceComSerializationContext &)

void ExternalizeL ( MMceComSerializationContext & aSerCtx ) [virtual]

Externalizes

Parameters

MMceComSerializationContext & aSerCtx context for serialization

FlatData()

CMceComCodec * FlatData ( )

Gets the flat data

FourCC()

IMPORT_C TUint32 FourCC ( ) const

Gets codec fourCC.

FrameSize()

IMPORT_C TUint FrameSize ( ) const

Gets current frame size of the codec.

Id()

TMceMediaId Id ( ) const

Media id of the codec.

InitializeL(CMceMediaStream &)

void InitializeL ( CMceMediaStream & aParent ) [virtual]

Initializes the codec.

Parameters

CMceMediaStream & aParent the parent

InternalizeFlatL(RReadStream &)

void InternalizeFlatL ( RReadStream & aReadStream )

Internalizes flat data

Parameters

RReadStream & aReadStream read stream

InternalizeL(MMceComSerializationContext &)

void InternalizeL ( MMceComSerializationContext & aSerCtx ) [virtual]

Internalizes

Parameters

MMceComSerializationContext & aSerCtx context for serialization

KeepAliveData()

IMPORT_C const TDesC8 & KeepAliveData ( ) const

Gets keep alive packets payload data.

KeepAlivePayloadType()

IMPORT_C TUint8 KeepAlivePayloadType ( ) const

Gets keep alive packets payload type.

KeepAliveTimer()

IMPORT_C TUint8 KeepAliveTimer ( ) const

Gets keep alive packets send timer value.

MMFPriority()

IMPORT_C TInt MMFPriority ( ) const

Gets MMF priority

MMFPriorityPreference()

IMPORT_C TInt MMFPriorityPreference ( ) const

Gets MMF priority preference

PayloadType()

IMPORT_C TUint8 PayloadType ( ) const

Gets the payload type identifier.

Preference()

IMPORT_C TInt Preference ( ) const

Gets the preference value.

SdpName()

IMPORT_C const TDesC8 & SdpName ( ) const

Gets the sdp name.

SerializationId()

TUint64 SerializationId ( ) const

Returns serialization id

SetAllowedBitrates(TUint)

TInt SetAllowedBitrates ( TUint aBitrates ) [pure virtual]

Sets bitrates allowed with codec. Allowed bitrates are copied automatically to same codec of opposite direction stream if streams are bound.

Parameters

TUint aBitrates allowed bitrate values

SetBitrate(TUint)

TInt SetBitrate ( TUint aBitrate ) [pure virtual]

Sets bitrate used with codec for encoding.

Parameters

TUint aBitrate bitrate value for encoding

SetCodecMode(TUint)

TInt SetCodecMode ( TUint aCodecMode ) [pure virtual]

Sets the codec specific mode. Codec mode is copied automatically to same codec of opposite direction stream if streams are bound.

Parameters

TUint aCodecMode mode of the codec

SetKeepAliveDataL(const TDesC8 &)

IMPORT_C void SetKeepAliveDataL ( const TDesC8 & aData )

Set keep alive packets payload data.

Parameters

const TDesC8 & aData payload data for keep alive packets

SetKeepAlivePayloadTypeL(TUint8)

IMPORT_C void SetKeepAlivePayloadTypeL ( TUint8 aKeepAlivePT )

Set keep alive packets payload type.

Parameters

TUint8 aKeepAlivePT payload type for keep alive packets

SetKeepAliveTimerL(TUint8)

IMPORT_C void SetKeepAliveTimerL ( TUint8 aTimerValue )

Set keep alive packets send timer value.

Parameters

TUint8 aTimerValue timer value in ms for keep alive packets

SetMMFPriorityL(TInt)

IMPORT_C void SetMMFPriorityL ( TInt aPriority )

Sets MMF priority value for the codec.

Parameters

TInt aPriority priority of the codec

SetMMFPriorityPreferenceL(TInt)

IMPORT_C void SetMMFPriorityPreferenceL ( TInt aPriorityPreference )

Sets MMF priority preference value for the codec.

Parameters

TInt aPriorityPreference priority preference of the codec

SetPayloadType(TUint8)

TInt SetPayloadType ( TUint8 aPayloadType ) [pure virtual]

Sets the payload type.

Parameters

TUint8 aPayloadType type identifier of the payload

SetPreferenceL(TInt)

IMPORT_C void SetPreferenceL ( TInt aPeference )

Sets the preference value used in media negotiation. Codec with preference value 0 is considered as the most preferenced codec. Preference of codecs with the same preference value is determined by order they were added to the stream.

Parameters

TInt aPeference

SetSdpNameL(const TDesC8 &)

void SetSdpNameL ( const TDesC8 & aSdpName ) [protected, pure virtual]

Sets the sdp name.

Parameters

const TDesC8 & aSdpName sdp name for the codec

SetStandByTimerL(TUint32)

IMPORT_C void SetStandByTimerL ( TUint32 aTimerValue )

Sets the timer period in seconds from starting of inactivity to automatically changing to state CMceCodec::EStandby .

Parameters

TUint32 aTimerValue timer period in seconds

SetStateL(CMceCodec::TState)

IMPORT_C void SetStateL ( CMceCodec::TState aState )

Sets the state of the codec.

Parameters

CMceCodec::TState aState desired codec state

State()

IMPORT_C CMceCodec::TState State ( ) const

Gets the state of the codec

Type()

IMPORT_C TMceCodecType Type ( ) const

Type of the codec

Updated()

void Updated ( ) [virtual]

Called after update.

Member Enumerations Documentation

Enum TState

Enumerators

EDisabled
EStandby
EEnabled

Member Data Documentation

CMceComCodec * iFlatData

CMceComCodec * iFlatData [protected]

Flat data container.

TAny * iReserved

TAny * iReserved [private]

CMceMediaStream * iStream

CMceMediaStream * iStream [protected]

Parent stream, not owned.

TMceCodecType iType

TMceCodecType iType [protected]

Codec type.