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 void AddSinkL ( CMceMediaSink *)
void AddSinkL ( MMceComSerializationContext &)
void AddedL ()
const RPointerArray < CMceCodec > & BaseCodecs ()
TMceFactory BaseFactory ()
IMPORT_C void BindL ( CMceMediaStream *)
TBool Binder ()
CMceMediaStream * Bound ()
IMPORT_C TBool BoundStream ()
IMPORT_C CMceMediaStream & BoundStreamL ()
void DisableL ()
void EnableL ()
TInt EventReceivedL ( TMceEvent &)
void ExternalizeFlatL ( RWriteStream &)
void ExternalizeL ( MMceComSerializationContext &)
TMceMediaStreamFactory Factory ()
CMceCodec * FindCodec ( CMceCodec &)
CMceComMediaStream * FlatData ()
TBool HandleMediaError ( TState , TBool , TInt )
TMceMediaId Id ()
void InitializeL ( CMceSession &, TBool )
void InitializeL ( CMceManager *, CMceSession &)
void InternalizeFlatL ( RReadStream &)
void InternalizeL ( MMceComSerializationContext &)
IMPORT_C TBool IsEnabled ()
IMPORT_C TUint LocalMediaPort ()
IMPORT_C MDesC8Array * MediaAttributeLinesL ()
IMPORT_C void RemoveSinkL ( CMceMediaSink &)
void ReorderCodecsByPreferenceL ( TBool )
TUint64 SerializationId ()
IMPORT_C CMceSession * Session ()
IMPORT_C void SetLocalMediaPortL ( TUint )
IMPORT_C void SetMediaAttributeLinesL ( CDesC8Array *)
IMPORT_C void SetSourceL ( CMceMediaSource *)
void SetSourceL ( MMceComSerializationContext &)
TBool SetState ( TState )
IMPORT_C const RPointerArray < CMceMediaSink > & Sinks ()
IMPORT_C CMceMediaSource * Source ()
IMPORT_C CMceMediaStream::TState State ()
void SynchronizeWithFileL ( CMceFileSource &)
IMPORT_C TMceMediaType Type ()
void Updated ()
Protected Member Functions
CMceMediaStream ()
void ConstructL ( CMceComMediaStream *)
CMceCodec * FindCodec (const RPointerArray < CMceCodec > &, CMceCodec &)
Private Member Functions
void DeleteSink ( TInt )
void DeleteSource ()
void DoBindL ( 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
enum TState {
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 void AddSinkL ( 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 * aSink sink to be added to the stream; ownership is transferred

AddSinkL(MMceComSerializationContext &)

void AddSinkL ( MMceComSerializationContext & aSerCtx )

Adds sink, during serialization, to the stream.

Parameters

MMceComSerializationContext & aSerCtx serialization context

AddedL()

void AddedL ( ) [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 void BindL ( CMceMediaStream * aStream )

Binds opposite direction stream to this stream.

Parameters

CMceMediaStream * aStream another 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 TBool BoundStream ( ) const

Checks if opposite direction stream is set.

BoundStreamL()

IMPORT_C CMceMediaStream & BoundStreamL ( ) const

Gets opposite direction stream of this stream.

ConstructL(CMceComMediaStream *)

void ConstructL ( CMceComMediaStream * aFlatData ) [protected]

Second-phase constructor

Parameters

CMceComMediaStream * aFlatData flat data container

DeleteSink(TInt)

void DeleteSink ( TInt aIndex ) [private]

Deletes sink

Parameters

TInt aIndex index of sink in the array

DeleteSource()

void DeleteSource ( ) [private]

Deletes source

DisableL()

void DisableL ( ) [virtual]

Disables streaming explicitly.

DoBindL(CMceMediaStream *)

void DoBindL ( CMceMediaStream * aStream ) [private]

one-way bind

Parameters

CMceMediaStream * aStream another stream to be bind to the stream.

EnableL()

void EnableL ( ) [virtual]

Enables streaming explicitly.

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

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 & aCodec the 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 > & aCodecs array of codecs
CMceCodec & aCodec search term

FlatData()

CMceComMediaStream * FlatData ( )

Gets the flat data

HandleEvent(TMceEvent &)

TInt HandleEvent ( TMceEvent & aEvent ) [private]

Handles event

Parameters

TMceEvent & aEvent the event

HandleMediaError(TState, TBool, TInt)

TBool HandleMediaError ( TState aState,
TBool aIsEnabled,
TInt aError
)

Handles possible media errors.

Parameters

TState aState
TBool aIsEnabled
TInt aError

Id()

TMceMediaId Id ( ) const

ID

InitializeL(CMceSession &, TBool)

void InitializeL ( CMceSession & aParent,
TBool aDiscardUnusedCodecs
) [virtual]

Initializes

Parameters

CMceSession & aParent the parent
TBool aDiscardUnusedCodecs

InitializeL(CMceManager *, CMceSession &)

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

Initializes

Parameters

CMceManager * aManager the manager. Ownership is NOT transferred
CMceSession & aSession the Session.

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

IsEnabled()

IMPORT_C TBool IsEnabled ( ) const

Returns the state of the stream.

LocalMediaPort()

IMPORT_C TUint LocalMediaPort ( ) const

Gets the local media port.

MediaAttributeLinesL()

IMPORT_C MDesC8Array * MediaAttributeLinesL ( )

Gets attribute lines of the media.

RemoveSinkL(CMceMediaSink &)

IMPORT_C void RemoveSinkL ( 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 & aSink sink to be removed from the stream

ReorderCodecsByPreferenceL(TBool)

void ReorderCodecsByPreferenceL ( TBool aDiscardUnusedCodecs ) [pure virtual]

Arranges codec priority order based on codecs preference values.

Parameters

TBool aDiscardUnusedCodecs ETrue 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 void SetLocalMediaPortL ( TUint aLocalMediaPort )

Sets local media port

Parameters

TUint aLocalMediaPort

SetMediaAttributeLinesL(CDesC8Array *)

IMPORT_C void SetMediaAttributeLinesL ( 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 void SetSourceL ( 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 * aSource source to be added to the stream; ownership is transferred

SetSourceL(MMceComSerializationContext &)

void SetSourceL ( MMceComSerializationContext & aSerCtx )

Adds source, during serialization, to the stream.

Parameters

MMceComSerializationContext & aSerCtx serialization context

SetState(TState)

TBool SetState ( TState aState )

Sets state of stream

Parameters

TState aState the 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::TState State ( ) const

Gets the state of the stream.

SynchronizeWithFileL(CMceFileSource &)

void SynchronizeWithFileL ( CMceFileSource & aFile ) [pure virtual]

Called file source wants to synchronized with stream

Parameters

CMceFileSource & aFile the file source

Type()

IMPORT_C TMceMediaType Type ( ) const

Returns the type of the stream.

Updated()

void Updated ( ) [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