CMceMediaStream Class Reference

class CMceMediaStream : public CBase

Base class for MCE media streams.

MCE Media stream represents stream of data negotiated between two terminals. Streams may transfer any data.

Enabling or disabling of a stream is not a local operation, but it requires always signalling. Thus, these operation require always to be completed by calling CMceSession::UpdateL() function.

mceclient.lib

Inherits from

Public Member Functions
~CMceMediaStream()
IMPORT_C voidAddSinkL(CMceMediaSink *)
voidAddSinkL(MMceComSerializationContext &)
voidAddedL()
const RPointerArray< CMceCodec > &BaseCodecs()
TMceFactory BaseFactory()
IMPORT_C voidBindL(CMceMediaStream *)
TBool Binder()
CMceMediaStream *Bound()
IMPORT_C TBoolBoundStream()
IMPORT_C CMceMediaStream &BoundStreamL()
voidDisableL()
voidEnableL()
TInt EventReceivedL(TMceEvent &)
voidExternalizeFlatL(RWriteStream &)
voidExternalizeL(MMceComSerializationContext &)
TMceMediaStreamFactory Factory()
CMceCodec *FindCodec(CMceCodec &)
CMceComMediaStream *FlatData()
TBool HandleMediaError(TState, TBool, TInt)
TMceMediaId Id()
voidInitializeL(CMceSession &, TBool)
voidInitializeL(CMceManager *, CMceSession &)
voidInternalizeFlatL(RReadStream &)
voidInternalizeL(MMceComSerializationContext &)
IMPORT_C TBoolIsEnabled()
IMPORT_C TUintLocalMediaPort()
IMPORT_C MDesC8Array *MediaAttributeLinesL()
IMPORT_C voidRemoveSinkL(CMceMediaSink &)
voidReorderCodecsByPreferenceL(TBool)
TUint64 SerializationId()
IMPORT_C CMceSession *Session()
IMPORT_C voidSetLocalMediaPortL(TUint)
IMPORT_C voidSetMediaAttributeLinesL(CDesC8Array *)
IMPORT_C voidSetSourceL(CMceMediaSource *)
voidSetSourceL(MMceComSerializationContext &)
TBool SetState(TState)
IMPORT_C const RPointerArray< CMceMediaSink > &Sinks()
IMPORT_C CMceMediaSource *Source()
IMPORT_C CMceMediaStream::TStateState()
voidSynchronizeWithFileL(CMceFileSource &)
IMPORT_C TMceMediaTypeType()
voidUpdated()
Protected Member Functions
CMceMediaStream()
voidConstructL(CMceComMediaStream *)
CMceCodec *FindCodec(const RPointerArray< CMceCodec > &, CMceCodec &)
Private Member Functions
voidDeleteSink(TInt)
voidDeleteSource()
voidDoBindL(CMceMediaStream *)
TInt HandleEvent(TMceEvent &)
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
enumTState {
EUninitialized, EInitialized, EBuffering, EIdle, EStreaming, EDisabled, ENoResources, ETranscodingRequired, ETranscoding
}
Protected Attributes
CMceComMediaStream *iFlatData
CMceMediaStream *iLinkedStream
CMceSession *iSession
RPointerArray< CMceMediaSink >iSinks
CMceMediaSource *iSource
Private Attributes
TAny *iReserved

Constructor & Destructor Documentation

CMceMediaStream()

CMceMediaStream()[protected]

C++ default constructor.

~CMceMediaStream()

IMPORT_C~CMceMediaStream()

Destructor.

Member Functions Documentation

AddSinkL(CMceMediaSink *)

IMPORT_C voidAddSinkL(CMceMediaSink *aSink)

Adds sink to the stream. CMceMediaStream can have many sinks at a time. Ownership of passed sink is transferred. However, the same sink can be also passed to other streams resulting that streams share ownership of the sink.

Parameters

CMceMediaSink * aSinksink to be added to the stream; ownership is transferred

AddSinkL(MMceComSerializationContext &)

voidAddSinkL(MMceComSerializationContext &aSerCtx)

Adds sink, during serialization, to the stream.

Parameters

MMceComSerializationContext & aSerCtxserialization context

AddedL()

voidAddedL()[virtual]

Called when stream is added to session

BaseCodecs()

const RPointerArray< CMceCodec > &BaseCodecs()[pure virtual]

Return codecs of stream.

BaseFactory()

TMceFactory BaseFactory()const

Factory

BindL(CMceMediaStream *)

IMPORT_C voidBindL(CMceMediaStream *aStream)

Binds opposite direction stream to this stream.

Parameters

CMceMediaStream * aStreamanother stream to be bind to the stream; ownership is transferred

Binder()

TBool Binder()const

Checks if this is binder (biding owner)

Bound()

CMceMediaStream *Bound()const

Returns pointer to the bound stream and NULL if no bound stream exists.

BoundStream()

IMPORT_C TBoolBoundStream()const

Checks if opposite direction stream is set.

BoundStreamL()

IMPORT_C CMceMediaStream &BoundStreamL()const

Gets opposite direction stream of this stream.

ConstructL(CMceComMediaStream *)

voidConstructL(CMceComMediaStream *aFlatData)[protected]

Second-phase constructor

Parameters

CMceComMediaStream * aFlatDataflat data container

DeleteSink(TInt)

voidDeleteSink(TIntaIndex)[private]

Deletes sink

Parameters

TInt aIndexindex of sink in the array

DeleteSource()

voidDeleteSource()[private]

Deletes source

DisableL()

voidDisableL()[virtual]

Disables streaming explicitly.

DoBindL(CMceMediaStream *)

voidDoBindL(CMceMediaStream *aStream)[private]

one-way bind

Parameters

CMceMediaStream * aStreamanother stream to be bind to the stream.

EnableL()

voidEnableL()[virtual]

Enables streaming explicitly.

EventReceivedL(TMceEvent &)

TInt EventReceivedL(TMceEvent &aEvent)[virtual]

Traversal event handler

Parameters

TMceEvent & aEventthe event

ExternalizeFlatL(RWriteStream &)

voidExternalizeFlatL(RWriteStream &aWriteStream)

Externalizes flat data

Parameters

RWriteStream & aWriteStreamwrite stream

ExternalizeL(MMceComSerializationContext &)

voidExternalizeL(MMceComSerializationContext &aSerCtx)[virtual]

Externalizes

Parameters

MMceComSerializationContext & aSerCtxcontext for serialization

Factory()

TMceMediaStreamFactory Factory()[static]

Factory

FindCodec(CMceCodec &)

CMceCodec *FindCodec(CMceCodec &aCodec)[pure virtual]

Searches for codec matching with input codec instance or sdp name

Parameters

CMceCodec & aCodecthe search term

FindCodec(const RPointerArray< CMceCodec > &, CMceCodec &)

CMceCodec *FindCodec(const RPointerArray< CMceCodec > &aCodecs,
CMceCodec &aCodec
)[protected]

Search for codec inside given codec array

Parameters

const RPointerArray< CMceCodec > & aCodecsarray of codecs
CMceCodec & aCodecsearch term

FlatData()

CMceComMediaStream *FlatData()

Gets the flat data

HandleEvent(TMceEvent &)

TInt HandleEvent(TMceEvent &aEvent)[private]

Handles event

Parameters

TMceEvent & aEventthe event

HandleMediaError(TState, TBool, TInt)

TBool HandleMediaError(TStateaState,
TBoolaIsEnabled,
TIntaError
)

Handles possible media errors.

Parameters

TState aState
TBool aIsEnabled
TInt aError

Id()

TMceMediaId Id()const

ID

InitializeL(CMceSession &, TBool)

voidInitializeL(CMceSession &aParent,
TBoolaDiscardUnusedCodecs
)[virtual]

Initializes

Parameters

CMceSession & aParentthe parent
TBool aDiscardUnusedCodecs

InitializeL(CMceManager *, CMceSession &)

voidInitializeL(CMceManager *aManager,
CMceSession &aSession
)[virtual]

Initializes

Parameters

CMceManager * aManagerthe manager. Ownership is NOT transferred
CMceSession & aSessionthe Session.

InternalizeFlatL(RReadStream &)

voidInternalizeFlatL(RReadStream &aReadStream)

Internalizes flat data

Parameters

RReadStream & aReadStreamread stream

InternalizeL(MMceComSerializationContext &)

voidInternalizeL(MMceComSerializationContext &aSerCtx)[virtual]

Internalizes

Parameters

MMceComSerializationContext & aSerCtxcontext for serialization

IsEnabled()

IMPORT_C TBoolIsEnabled()const

Returns the state of the stream.

LocalMediaPort()

IMPORT_C TUintLocalMediaPort()const

Gets the local media port.

MediaAttributeLinesL()

IMPORT_C MDesC8Array *MediaAttributeLinesL()

Gets attribute lines of the media.

RemoveSinkL(CMceMediaSink &)

IMPORT_C voidRemoveSinkL(CMceMediaSink &aSink)
Removes sink from the stream.
Post-condition
aSink cannot be used anymore and contents of previously returned sink array (CMceMediaStream::Sinks()) are not anymore valid

Parameters

CMceMediaSink & aSinksink to be removed from the stream

ReorderCodecsByPreferenceL(TBool)

voidReorderCodecsByPreferenceL(TBoolaDiscardUnusedCodecs)[pure virtual]

Arranges codec priority order based on codecs preference values.

Parameters

TBool aDiscardUnusedCodecsETrue if all disabled codecs should be removed from the stream

SerializationId()

TUint64 SerializationId()const

Returns serialization id

Session()

IMPORT_C CMceSession *Session()const

Gets the session this stream belongs to, if exists. The ownership is not transfered.

SetLocalMediaPortL(TUint)

IMPORT_C voidSetLocalMediaPortL(TUintaLocalMediaPort)

Sets local media port

Parameters

TUint aLocalMediaPort

SetMediaAttributeLinesL(CDesC8Array *)

IMPORT_C voidSetMediaAttributeLinesL(CDesC8Array *aMediaSDPLines)

Configures media stream by updating SDP media lines. In order to get complete update, whole session must be updated causing sending of re-invite.

Parameters

CDesC8Array * aMediaSDPLines

SetSourceL(CMceMediaSource *)

IMPORT_C voidSetSourceL(CMceMediaSource *aSource)

Adds source to the stream. CMceMediaStream can only have one source at a time. Ownership of passed source is transferred. However, the same source can be also passed to other streams resulting that streams share ownership of the source. Passing NULL source will remove source from stream. In some cases the source might contain a codec. The codec is derived to the stream when such source is added to the stream. Derived codec will get automatically highest preference.

Parameters

CMceMediaSource * aSourcesource to be added to the stream; ownership is transferred

SetSourceL(MMceComSerializationContext &)

voidSetSourceL(MMceComSerializationContext &aSerCtx)

Adds source, during serialization, to the stream.

Parameters

MMceComSerializationContext & aSerCtxserialization context

SetState(TState)

TBool SetState(TStateaState)

Sets state of stream

Parameters

TState aStatethe state

Sinks()

IMPORT_C const RPointerArray< CMceMediaSink > &Sinks()const

Gets array of sinks of the stream.

Source()

IMPORT_C CMceMediaSource *Source()const

Gets source of the stream. Returns NULL if source is not set.

State()

IMPORT_C CMceMediaStream::TStateState()const

Gets the state of the stream.

SynchronizeWithFileL(CMceFileSource &)

voidSynchronizeWithFileL(CMceFileSource &aFile)[pure virtual]

Called file source wants to synchronized with stream

Parameters

CMceFileSource & aFilethe file source

Type()

IMPORT_C TMceMediaTypeType()const

Returns the type of the stream.

Updated()

voidUpdated()[virtual]

Called after update

Member Enumerations Documentation

Enum TState

Enumerators

EUninitialized
EInitialized
EBuffering
EIdle
EStreaming
EDisabled
ENoResources
ETranscodingRequired
ETranscoding

Member Data Documentation

CMceComMediaStream * iFlatData

CMceComMediaStream *iFlatData[protected]

flat data container

CMceMediaStream * iLinkedStream

CMceMediaStream *iLinkedStream[protected]

linked stream. Owned if iLinkOwner is ETrue

TAny * iReserved

TAny *iReserved[private]

CMceSession * iSession

CMceSession *iSession[protected]

session

RPointerArray< CMceMediaSink > iSinks

RPointerArray< CMceMediaSink >iSinks[protected]

sinks

CMceMediaSource * iSource

CMceMediaSource *iSource[protected]

source