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 void CancelTranscodeL ()
IMPORT_C TInt CurrentMediaElement ( TMceMediaType )
IMPORT_C void DisableL ()
IMPORT_C TTimeIntervalMicroSeconds DurationL ()
IMPORT_C void EnableL ()
TInt EventReceivedL ( TMceEvent &)
const TMceFileInfo & FileInfo ()
TInt HandleEvent ( TMceEvent &)
void InitializeL ( CMceManager *)
CMceManager * Manager ()
IMPORT_C TInt MediaElementCountL ( TMceMediaType )
IMPORT_C CMceFileSource * NewL ( CMceManager &, const TFileName &)
CMceFileSource * NewL ()
IMPORT_C CMceFileSource * NewLC ( CMceManager &, const TFileName &)
CMceFileSource * NewLC ()
IMPORT_C TTimeIntervalMicroSeconds PositionL ()
IMPORT_C void SetCurrentMediaElementL ( TMceMediaType , TInt )
IMPORT_C void SetFastForwardL ( TBool )
IMPORT_C void SetFastRewindL ( TBool )
IMPORT_C void SetPositionL (const TTimeIntervalMicroSeconds &)
void StreamAddedL ( CMceMediaStream &)
const TDesC8 & SupportedAudio ()
const TDesC8 & SupportedVideo ()
IMPORT_C void TranscodeL (const TFileName &)
IMPORT_C TInt TranscodingProgressL ()
IMPORT_C void UpdateL (const TFileName &)
void Updated ()
Private Member Functions
CMceFileSource ()
void ConstructL ( CMceManager *, const TFileName &)
void DoCancelTranscodeL ()
void GetFileInfoL ( TBool )
void SetFileInfoL ()
void SynchronizeWithStreamL ()
void TranscodingCompletedL ( TMceEvent &)
void UpdateState ( 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 void CancelTranscodeL ( )
Cancels transcoding of file.
Pre-condition
CMceMediaStream::State() == ETranscoding
Post-condition
CMceMediaStream::State() == ETranscodingRequired

ConstructL(CMceManager *, const TFileName &)

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

Second-phase constructor.

Parameters

CMceManager * aManager
const TFileName & aFileName

CurrentMediaElement(TMceMediaType)

IMPORT_C TInt CurrentMediaElement ( TMceMediaType aType )

Gets currently managed media element of the spesified media type.

Parameters

TMceMediaType aType the type of media

DisableL()

IMPORT_C void DisableL ( ) [virtual]

Disables the source explicitly.

DoCancelTranscodeL()

void DoCancelTranscodeL ( ) [private]

DurationL()

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

EnableL()

IMPORT_C void EnableL ( ) [virtual]

Enables the source explicitly.

EventReceivedL(TMceEvent &)

TInt EventReceivedL ( TMceEvent & aEvent ) [virtual]

Traversal event handler

Parameters

TMceEvent & aEvent the event

FileInfo()

const TMceFileInfo & FileInfo ( )

returns details of this file

GetFileInfoL(TBool)

void GetFileInfoL ( TBool aUseSession = ETrue ) [private]

Parameters

TBool aUseSession = ETrue

HandleEvent(TMceEvent &)

TInt HandleEvent ( TMceEvent & aEvent )

Handles event

Parameters

TMceEvent & aEvent the event

InitializeL(CMceManager *)

void InitializeL ( CMceManager * aManager ) [virtual]

Initializes

Parameters

CMceManager * aManager the manager. Ownership is NOT transferred

Manager()

CMceManager * Manager ( )

Gets manager

MediaElementCountL(TMceMediaType)

IMPORT_C TInt MediaElementCountL ( TMceMediaType aType ) 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 aType the type of media

NewL(CMceManager &, const TFileName &)

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

Two-phased constructor.

Parameters

CMceManager & aManager associated MCE manager
const TFileName & aFileName name 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 & aManager associated MCE manager
const TFileName & aFileName name of the file including full path info

NewLC()

CMceFileSource * NewLC ( ) [static]

Two-phased constructor.

PositionL()

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

SetCurrentMediaElementL(TMceMediaType, TInt)

IMPORT_C void SetCurrentMediaElementL ( TMceMediaType aType,
TInt aIndex
)
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 aType the type of media
TInt aIndex new index of the current media element

SetFastForwardL(TBool)

IMPORT_C void SetFastForwardL ( TBool aUseFFWD )
Sets fast forward on/off.
Pre-condition
contains video

Parameters

TBool aUseFFWD ETrue if fast forward is enabled; otherwise EFalse

SetFastRewindL(TBool)

IMPORT_C void SetFastRewindL ( TBool aUseFRWD )
Sets fast rewind on/off.
Pre-condition
contains video

Parameters

TBool aUseFRWD ETrue if fast rewind is enabled; otherwise EFalse

SetFileInfoL()

void SetFileInfoL ( ) [private]

SetPositionL(const TTimeIntervalMicroSeconds &)

IMPORT_C void SetPositionL ( 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 & aPosition from start of the file in microseconds

StreamAddedL(CMceMediaStream &)

void StreamAddedL ( CMceMediaStream & aParent ) [virtual]

Stream has been added to session

Parameters

CMceMediaStream & aParent the 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()

void SynchronizeWithStreamL ( ) [private]

TranscodeL(const TFileName &)

IMPORT_C void TranscodeL ( 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 & aFileName Name of the transcoding output file.

TranscodingCompletedL(TMceEvent &)

void TranscodingCompletedL ( TMceEvent & aEvent ) [private]

Parameters

TMceEvent & aEvent

TranscodingProgressL()

IMPORT_C TInt TranscodingProgressL ( ) 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 void UpdateL ( const TFileName & aFileName )

Updates file for the source.

Parameters

const TFileName & aFileName name of the file including full path info

UpdateState(CMceMediaStream::TState)

void UpdateState ( CMceMediaStream::TState aState ) [private]

Parameters

CMceMediaStream::TState aState

Updated()

void Updated ( ) [virtual]

Called after update

Member Data Documentation

CMceManager * iManager

CMceManager * iManager [private]

TAny * iReserved

TAny * iReserved [private]