CMceFileSource Class Reference

class CMceFileSource : public CMceMediaSource

Class representing file source in MCE.

CMceFileSource can be used for streaming file contents. The file may contain both audio and video data. If the user wants to stream both media types, the same file source should be attached to audio stream and video stream.

The file may contain also several elements of the same media type (e.g. 3 audio channels) and the user might want to use only some of those. This can be handled by defining index of the file's current media element:

  • Get number of audio media elements within the file (e.g. returns 3)

  • Set current audio element index to be 0

  • Attach the file source to the audioStreamOne (audio element 0 is attached)

  • Set current audio element index to be 2

  • Attach the file source to the audioStreamTwo (audio element 2 is attached)

  • Consequently, file's audio channel 0 would be streamed over the audioStreamOne and channel 2 over the audioStreamTwo. Channel 1 would be ignored.

Enable (continue) and Disable (pause) operations to it are considered to be local, so they are not signalled to remote terminal.

mceclient.lib

Inherits from

Public Member Functions
~CMceFileSource()
IMPORT_C voidCancelTranscodeL()
IMPORT_C TIntCurrentMediaElement(TMceMediaType)
IMPORT_C voidDisableL()
IMPORT_C TTimeIntervalMicroSecondsDurationL()
IMPORT_C voidEnableL()
TInt EventReceivedL(TMceEvent &)
const TMceFileInfo &FileInfo()
TInt HandleEvent(TMceEvent &)
voidInitializeL(CMceManager *)
CMceManager *Manager()
IMPORT_C TIntMediaElementCountL(TMceMediaType)
IMPORT_C CMceFileSource *NewL(CMceManager &, const TFileName &)
CMceFileSource *NewL()
IMPORT_C CMceFileSource *NewLC(CMceManager &, const TFileName &)
CMceFileSource *NewLC()
IMPORT_C TTimeIntervalMicroSecondsPositionL()
IMPORT_C voidSetCurrentMediaElementL(TMceMediaType, TInt)
IMPORT_C voidSetFastForwardL(TBool)
IMPORT_C voidSetFastRewindL(TBool)
IMPORT_C voidSetPositionL(const TTimeIntervalMicroSeconds &)
voidStreamAddedL(CMceMediaStream &)
const TDesC8 &SupportedAudio()
const TDesC8 &SupportedVideo()
IMPORT_C voidTranscodeL(const TFileName &)
IMPORT_C TIntTranscodingProgressL()
IMPORT_C voidUpdateL(const TFileName &)
voidUpdated()
Private Member Functions
CMceFileSource()
voidConstructL(CMceManager *, const TFileName &)
voidDoCancelTranscodeL()
voidGetFileInfoL(TBool)
voidSetFileInfoL()
voidSynchronizeWithStreamL()
voidTranscodingCompletedL(TMceEvent &)
voidUpdateState(CMceMediaStream::TState)
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()
CMceMediaSource::CMceMediaSource()
CMceMediaSource::CancelDtmfToneSequenceL()
CMceMediaSource::ConstructL(CMceComMediaSource *)
CMceMediaSource::DoDisableL()
CMceMediaSource::DoEnableL()
CMceMediaSource::DtmfActive()
CMceMediaSource::DtmfAvailable()
CMceMediaSource::Enabled(TBool)
CMceMediaSource::ExternalizeFlatL(RWriteStream &)
CMceMediaSource::ExternalizeL(MMceComSerializationContext &)
CMceMediaSource::Factory()
CMceMediaSource::Id()const
CMceMediaSource::InitializeL(CMceMediaStream &)
CMceMediaSource::InternalizeFlatL(RReadStream &)
CMceMediaSource::InternalizeL(MMceComSerializationContext &)
CMceMediaSource::IsEnabled()const
CMceMediaSource::ReferenceCount()
CMceMediaSource::SendDtmfToneL(const TChar &,TTimeIntervalMicroSeconds32)
CMceMediaSource::SendDtmfToneSequenceL(const TDesC &)
CMceMediaSource::SerializationId()const
CMceMediaSource::StartDtmfToneL(const TChar &)
CMceMediaSource::StopDtmfToneL()
CMceMediaSource::Type()const
CMceMediaSource::UnInitialize(CMceMediaStream &)
CMceMediaSource::UpdateL(CMceMediaSource &)
CMceMediaSource::~CMceMediaSource()
Private Attributes
CMceManager *iManager
TAny *iReserved
Inherited Attributes
CMceMediaSource::iFlatData
CMceMediaSource::iParents
CMceMediaSource::iStream

Constructor & Destructor Documentation

CMceFileSource()

CMceFileSource()[private]

C++ default constructor.

~CMceFileSource()

IMPORT_C~CMceFileSource()

Destructor.

Member Functions Documentation

CancelTranscodeL()

IMPORT_C voidCancelTranscodeL()
Cancels transcoding of file.
Pre-condition
CMceMediaStream::State() == ETranscoding
Post-condition
CMceMediaStream::State() == ETranscodingRequired

ConstructL(CMceManager *, const TFileName &)

voidConstructL(CMceManager *aManager,
const TFileName &aFileName
)[private]

Second-phase constructor.

Parameters

CMceManager * aManager
const TFileName & aFileName

CurrentMediaElement(TMceMediaType)

IMPORT_C TIntCurrentMediaElement(TMceMediaTypeaType)

Gets currently managed media element of the spesified media type.

Parameters

TMceMediaType aTypethe type of media

DisableL()

IMPORT_C voidDisableL()[virtual]

Disables the source explicitly.

DoCancelTranscodeL()

voidDoCancelTranscodeL()[private]

DurationL()

IMPORT_C TTimeIntervalMicroSecondsDurationL()const
Returns the duration of the file in microseconds.
Pre-condition
contains audio/video

EnableL()

IMPORT_C voidEnableL()[virtual]

Enables the source explicitly.

EventReceivedL(TMceEvent &)

TInt EventReceivedL(TMceEvent &aEvent)[virtual]

Traversal event handler

Parameters

TMceEvent & aEventthe event

FileInfo()

const TMceFileInfo &FileInfo()

returns details of this file

GetFileInfoL(TBool)

voidGetFileInfoL(TBoolaUseSession = ETrue)[private]

Parameters

TBool aUseSession = ETrue

HandleEvent(TMceEvent &)

TInt HandleEvent(TMceEvent &aEvent)

Handles event

Parameters

TMceEvent & aEventthe event

InitializeL(CMceManager *)

voidInitializeL(CMceManager *aManager)[virtual]

Initializes

Parameters

CMceManager * aManagerthe manager. Ownership is NOT transferred

Manager()

CMceManager *Manager()

Gets manager

MediaElementCountL(TMceMediaType)

IMPORT_C TIntMediaElementCountL(TMceMediaTypeaType)const

Determines how many media elements of the spesified type the file source contains. E.g. audio file may contain N number of audio channels which has to be streamed over N number of audio streams.

Parameters

TMceMediaType aTypethe type of media

NewL(CMceManager &, const TFileName &)

IMPORT_C CMceFileSource *NewL(CMceManager &aManager,
const TFileName &aFileName
)[static]

Two-phased constructor.

Parameters

CMceManager & aManagerassociated MCE manager
const TFileName & aFileNamename of the file including full path info

NewL()

CMceFileSource *NewL()[static]

Two-phased constructor.

NewLC(CMceManager &, const TFileName &)

IMPORT_C CMceFileSource *NewLC(CMceManager &aManager,
const TFileName &aFileName
)[static]

Two-phased constructor.

Parameters

CMceManager & aManagerassociated MCE manager
const TFileName & aFileNamename of the file including full path info

NewLC()

CMceFileSource *NewLC()[static]

Two-phased constructor.

PositionL()

IMPORT_C TTimeIntervalMicroSecondsPositionL()const
Gets the current playback position in microseconds from the start of the file.
Pre-condition
contains audio/video

SetCurrentMediaElementL(TMceMediaType, TInt)

IMPORT_C voidSetCurrentMediaElementL(TMceMediaTypeaType,
TIntaIndex
)
Sets currently managed media element of the spesified media type. The setting is effective when the file source is attached to media stream of the spesified type. Current media element can be defined for each media type the file contains. By default, media element 0 of each media type is used.
leave
KErrArgument if media element spesified by input parameters does not exist

Parameters

TMceMediaType aTypethe type of media
TInt aIndexnew index of the current media element

SetFastForwardL(TBool)

IMPORT_C voidSetFastForwardL(TBoolaUseFFWD)
Sets fast forward on/off.
Pre-condition
contains video

Parameters

TBool aUseFFWDETrue if fast forward is enabled; otherwise EFalse

SetFastRewindL(TBool)

IMPORT_C voidSetFastRewindL(TBoolaUseFRWD)
Sets fast rewind on/off.
Pre-condition
contains video

Parameters

TBool aUseFRWDETrue if fast rewind is enabled; otherwise EFalse

SetFileInfoL()

voidSetFileInfoL()[private]

SetPositionL(const TTimeIntervalMicroSeconds &)

IMPORT_C voidSetPositionL(const TTimeIntervalMicroSeconds &aPosition)
Sets the position within the file from where to start playback.
Pre-condition
IsEnabled() == EFalse and contains audio/video

Parameters

const TTimeIntervalMicroSeconds & aPositionfrom start of the file in microseconds

StreamAddedL(CMceMediaStream &)

voidStreamAddedL(CMceMediaStream &aParent)[virtual]

Stream has been added to session

Parameters

CMceMediaStream & aParentthe parent stream

SupportedAudio()

const TDesC8 &SupportedAudio()

returns supported audio codec of this file

SupportedVideo()

const TDesC8 &SupportedVideo()

returns supported video codec of this file

SynchronizeWithStreamL()

voidSynchronizeWithStreamL()[private]

TranscodeL(const TFileName &)

IMPORT_C voidTranscodeL(const TFileName &aFileName)
Starts transcoding of file. After the transcoding is complete, file of this source is changed into the transcoded file.
Pre-condition
CMceMediaStream::State() == ETranscodingRequired
Post-condition
CMceMediaStream::State() == ETranscoding

Parameters

const TFileName & aFileNameName of the transcoding output file.

TranscodingCompletedL(TMceEvent &)

voidTranscodingCompletedL(TMceEvent &aEvent)[private]

Parameters

TMceEvent & aEvent

TranscodingProgressL()

IMPORT_C TIntTranscodingProgressL()const
Gets the current transcoding progress in percentage. Value is updated with MMceStreamObserver::StreamStateChanged() event.
Pre-condition
CMceMediaStream::State() == ETranscoding

UpdateL(const TFileName &)

IMPORT_C voidUpdateL(const TFileName &aFileName)

Updates file for the source.

Parameters

const TFileName & aFileNamename of the file including full path info

UpdateState(CMceMediaStream::TState)

voidUpdateState(CMceMediaStream::TStateaState)[private]

Parameters

CMceMediaStream::TState aState

Updated()

voidUpdated()[virtual]

Called after update

Member Data Documentation

CMceManager * iManager

CMceManager *iManager[private]

TAny * iReserved

TAny *iReserved[private]