CMMFDataPath2 Class Reference

#include <mmf/server/mmfdatapath2.h>

Link against: mmfserverbaseclasses.lib

class CMMFDataPath2 : public CMMFDataPath, public CMMFDataPath
Protected Attributes
TTimeIntervalMicroSeconds iDevSoundRepositionTime
TBool *iDisableAutoIntent
MDataSource *iDrmSource
TBool iGetTimePlayedSupported
TBool iIsResumeSupported
TBool iIsUsingResumeSupport
TInt iNumberOfTimesPlayed
TInt iNumberOfTimesToRepeat
TBool iPauseCalledInsilence
CPeriodic *iRepeatTrailingSilenceTimer
TBool iRetainRepeatInfo
TTimeIntervalMicroSeconds iTimeLeftToPlayComplete
TTimeIntervalMicroSeconds iTrailingSilence
TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay
TBool iVerifyPlayComplete
Public Member Functions
virtual ~CMMFDataPath2()
virtual voidBufferFilledL(CMMFBuffer *)
IMPORT_C CMMFDataPath2 *NewL(MAsyncEventHandler &)
IMPORT_C CMMFDataPath2 *NewL(TMediaId, MAsyncEventHandler &)
IMPORT_C CMMFDataPath2 *NewL(TUid, MAsyncEventHandler &)
IMPORT_C CMMFDataPath2 *NewL(TUid, TMediaId, MAsyncEventHandler &)
virtual voidPause()
virtual voidPlayL()
virtual TTimeIntervalMicroSeconds Position()
IMPORT_C voidPreEmptionPause()
virtual voidPrimeL()
virtual voidResetL()
IMPORT_C voidRetainRepeatInfo()
virtual voidRunL()
IMPORT_C voidSetDrmProperties(MDataSource *, TBool *)
virtual voidSetPositionL(const TTimeIntervalMicroSeconds &)
IMPORT_C voidSetRepeats(TInt, const TTimeIntervalMicroSeconds &)
virtual voidStop()
Protected Member Functions
CMMFDataPath2(TMediaId, MAsyncEventHandler &)
TTimeIntervalMicroSeconds CalculateAudioOutputPosition()
voidConstructL(TUid)
virtual voidDoCancel()
voidDoFillSourceBufferL()
voidDoPauseL()
voidDoPreEmptionPauseL()
TInt DoRepeatTrailingSilenceTimerCompleteL()
voidDoStopL()
voidFillSourceBufferL()
TTimeIntervalMicroSeconds OutputPosition()
voidPlaySilence()
TInt RepeatTrailingSilenceTimerComplete(TAny *)
Inherited Attributes
CActive::iStatus
CMMFDataPath::iAllDataSentToSink
CMMFDataPath::iBuffersToUse
CMMFDataPath::iCachedSourceDuration
CMMFDataPath::iCodec
CMMFDataPath::iCodecProcessResult
CMMFDataPath::iCompleteCallback
CMMFDataPath::iCurrentSinkFrameNumber
CMMFDataPath::iCurrentSourceFrameNumber
CMMFDataPath::iDataPathCompletedErrorCode
CMMFDataPath::iDataPathCreated
CMMFDataPath::iDataSink
CMMFDataPath::iDataSource
CMMFDataPath::iEventHandler
CMMFDataPath::iMediaId
CMMFDataPath::iNoMoreSourceData
CMMFDataPath::iObtainingAsyncSinkBuffer
CMMFDataPath::iObtainingAsyncSourceBuffer
CMMFDataPath::iPauseCalled
CMMFDataPath::iPlayWindowEndPosition
CMMFDataPath::iPlayWindowStartPosition
CMMFDataPath::iReferenceAudioSamplesPlayed
CMMFDataPath::iReferenceAudioSamplesRecorded
CMMFDataPath::iSinkBuffer
CMMFDataPath::iSinkBufferWithSink
CMMFDataPath::iSinkCanReceive
CMMFDataPath::iSinkFourCC
CMMFDataPath::iSnkBufRef
CMMFDataPath::iSourceBuffer
CMMFDataPath::iSourceBufferWithSource
CMMFDataPath::iSourceFourCC
CMMFDataPath::iSrcBufRef
CMMFDataPath::iStartPosition
CMMFDataPath::iState
CMMFDataPath::iTransferState
CMMFDataPath::iUseSuppliedCodecUid
Inherited Enumerations
CActive:TPriority
CMMFDataPath:TDataPathState
CMMFDataPath:TNeedBuffer
CMMFDataPath:TTransferState
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
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()
CMMFDataPath::AddDataSinkL(MDataSink *)
CMMFDataPath::AddDataSourceL(MDataSource *)
CMMFDataPath::AudioSamplesPlayed()const
CMMFDataPath::AudioSamplesRecorded()const
CMMFDataPath::BufferEmptiedL(CMMFBuffer *)
CMMFDataPath::CMMFDataPath(TMediaId,MAsyncEventHandler &)
CMMFDataPath::CalculateAudioInputPosition()const
CMMFDataPath::CanCreateSinkBuffer()
CMMFDataPath::CanCreateSourceBuffer()
CMMFDataPath::ClearPlayWindowL()
CMMFDataPath::ConstructSinkL(const TDesC8 &)
CMMFDataPath::ConstructSourceL(const TDesC8 &)
CMMFDataPath::CreateSinkBufferL(TMediaId)
CMMFDataPath::CreateSinkBufferL(TMediaId,TBool &)
CMMFDataPath::CreateSourceBufferL(TMediaId)
CMMFDataPath::CreateSourceBufferL(TMediaId,TBool &)
CMMFDataPath::DetermineBuffersToUseL(void)const
CMMFDataPath::DoSendEventToClient(TUid,TInt)
CMMFDataPath::EmptyBufferL(CMMFBuffer *,MDataSource *,TMediaId)
CMMFDataPath::EndOfData()
CMMFDataPath::FillBufferL(CMMFBuffer *,MDataSink *,TMediaId)
CMMFDataPath::InputPosition()const
CMMFDataPath::RunError(TInt)
CMMFDataPath::SetBlockLength(TUint)
CMMFDataPath::SetPlayWindowL(const TTimeIntervalMicroSeconds &,const TTimeIntervalMicroSeconds &)
CMMFDataPath::SinkDataTypeCode(TMediaId)
CMMFDataPath::SourceDataTypeCode(TMediaId)
CMMFDataPath::State()
CMMFDataPath::~CMMFDataPath()
MDataSink::DataSinkType()const
MDataSink::MDataSink(TUid)
MDataSink::NegotiateL(MDataSource &)
MDataSink::NewSinkL(TUid,const TDesC8 &)
MDataSink::NewSinkLC(TUid,const TDesC8 &)
MDataSink::SetSinkDataTypeCode(TFourCC,TMediaId)
MDataSink::SetSinkPrioritySettings(const TMMFPrioritySettings &)
MDataSink::SinkCustomCommand(TMMFMessage &)
MDataSink::SinkPauseL()
MDataSink::SinkPlayL()
MDataSink::SinkPrimeL()
MDataSink::SinkStopL()
MDataSink::SinkThreadLogoff()
MDataSink::SinkThreadLogon(MAsyncEventHandler &)
MDataSink::~MDataSink()
MDataSource::CreateSourceBufferL(TMediaId,CMMFBuffer &,TBool &)
MDataSource::DataSourceType()const
MDataSource::MDataSource(TUid)
MDataSource::NegotiateSourceL(MDataSink &)
MDataSource::NewSourceL(TUid,const TDesC8 &)
MDataSource::NewSourceLC(TUid,const TDesC8 &)
MDataSource::SetSourceDataTypeCode(TFourCC,TMediaId)
MDataSource::SetSourcePrioritySettings(const TMMFPrioritySettings &)
MDataSource::SourceCustomCommand(TMMFMessage &)
MDataSource::SourcePauseL()
MDataSource::SourcePlayL()
MDataSource::SourcePrimeL()
MDataSource::SourceSampleConvert()
MDataSource::SourceStopL()
MDataSource::SourceThreadLogoff()
MDataSource::SourceThreadLogon(MAsyncEventHandler &)
MDataSource::~MDataSource()

Detailed Description

This class is an extended version of CMMFDataPath. CMMFDataPath is extended to implement the loop play

functionality in the controller. This class overrides some of the virual functions of CMMFDataPath in order to

implement the loop play functionality. All the controller plugins that require loop play functionality should

use CMMFDataPath2 in place of CMMFDataPath.

See also: CMMFDataPath

Member Attribute Documentation

iDevSoundRepositionTime

TTimeIntervalMicroSeconds iDevSoundRepositionTime[protected]

iDisableAutoIntent

TBool *iDisableAutoIntent[protected]

iDrmSource

MDataSource *iDrmSource[protected]

iGetTimePlayedSupported

TBool iGetTimePlayedSupported[protected]

iIsResumeSupported

TBool iIsResumeSupported[protected]

iIsUsingResumeSupport

TBool iIsUsingResumeSupport[protected]

iNumberOfTimesPlayed

TInt iNumberOfTimesPlayed[protected]

The number of times played.

iNumberOfTimesToRepeat

TInt iNumberOfTimesToRepeat[protected]

The number of times to repeat the audio sample.

iPauseCalledInsilence

TBool iPauseCalledInsilence[protected]

iRepeatTrailingSilenceTimer

CPeriodic *iRepeatTrailingSilenceTimer[protected]

Timer used for trailing silences when repeating

iRetainRepeatInfo

TBool iRetainRepeatInfo[protected]

iTimeLeftToPlayComplete

TTimeIntervalMicroSeconds iTimeLeftToPlayComplete[protected]

The time left for the play will be completed in a particular repeat

iTrailingSilence

TTimeIntervalMicroSeconds iTrailingSilence[protected]

The time interval of the trailing silence in microseconds.

iTrailingSilenceLeftToPlay

TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay[protected]

The time interval of the trailing silence left to play in microseconds.

iVerifyPlayComplete

TBool iVerifyPlayComplete[protected]

Constructor & Destructor Documentation

CMMFDataPath2 ( TMediaId, MAsyncEventHandler & )

CMMFDataPath2(TMediaIdaMediaId,
MAsyncEventHandler &aEventHandler
)[protected]

~CMMFDataPath2 ( )

~CMMFDataPath2()[virtual]

Standard destructor.

Member Function Documentation

BufferFilledL ( CMMFBuffer * )

voidBufferFilledL(CMMFBuffer *aBuffer)[virtual]

Indicates the data source has filled the specified buffer.

Called by the CMMFDataPath2's MDataSource when it has filled the buffer.

Parameters
aBufferA pointer to the filled buffer.

CalculateAudioOutputPosition ( )

TTimeIntervalMicroSeconds CalculateAudioOutputPosition()const [protected]

ConstructL ( TUid )

voidConstructL(TUidaCodecUid = KNullUid)[protected]

Takes UID of codec on construction, and if not an NULL codec sets the datapath up for codec instantiation.

Parameters
aCodecUidThe UID of the codec.

DoCancel ( )

voidDoCancel()[protected, virtual]

Reimplemented from CMMFDataPath::DoCancel()

Cancels the silence timer.

DoFillSourceBufferL ( )

voidDoFillSourceBufferL()[protected]

DoPauseL ( )

voidDoPauseL()[protected]

Reimplemented from CMMFDataPath::DoPauseL()

This is a virtual function datapath (or derivations off) that can be implemented but may be left blank for default behaviour.

Additional Pause method specific to this datapath.

The DataPath implements pause by recording the current position and stopping the source and sink.

When Play is called the DataPath uses the stored position as the starting point and resumes

playing. The reason for this (rather than using the PauseL() API on sources and sinks) is that

some implementations do not support a suitable pause, therefore the DataPath is implemented to

support the lowest common denominator.

Note:

A suitable pause implementation will retain any buffers in use. There will be no

need to call PrimeL() prior to PlayL().

DoPreEmptionPauseL ( )

voidDoPreEmptionPauseL()[protected]

Pauses playing.

Sends KMMFErrorCategoryDataPathGeneralError to the client if an error occurs.

DoRepeatTrailingSilenceTimerCompleteL ( )

TInt DoRepeatTrailingSilenceTimerCompleteL()[protected]

DoStopL ( )

voidDoStopL()[protected]

Reimplemented from CMMFDataPath::DoStopL()

This is a virtual function datapath (or derivations off) that can be implemented but may be left blank for default behaviour.

Additional Stop() method specific to this datapath.

FillSourceBufferL ( )

voidFillSourceBufferL()[protected]

NewL ( MAsyncEventHandler & )

IMPORT_C CMMFDataPath2 *NewL(MAsyncEventHandler &aEventHandler)[static]

Allocates and constructs a data path.

Use this function if the codec UID is not already known by CMMFController

and there is no data path ambiguity - ie only one data path is possible.

Will create codec via fourCC.

Parameters
aEventHandlerInstalls an event handler to provide message passing between clients and sources/sinks.
Return Value
Newly constructed data path object.

NewL ( TMediaId, MAsyncEventHandler & )

IMPORT_C CMMFDataPath2 *NewL(TMediaIdaMediaId,
MAsyncEventHandler &aEventHandler
)[static]

Allocates and constructs a data path according to the specified media ID.

Use this function if the codec UID is not already known by CMMFController

and there is ambiguity with the data path ie. there is more than one possible data path.

Parameters
aMediaIdOptional media ID parameter when there are multiple media types.
aEventHandlerInstalls an event handler to provide message passing between clients and sources/sinks.
Return Value
A newly constructed data path object.

NewL ( TUid, MAsyncEventHandler & )

IMPORT_C CMMFDataPath2 *NewL(TUidaCodecUid,
MAsyncEventHandler &aEventHandler
)[static]

Allocates and constructs a data path according to the specified codec UID.

Use this function if the codec UID is already known by CMMFController

and there is no data path ambiguity ie. only one data path is possible

will create codec explicitly using the supplied codec Uid

Parameters
aCodecUidOptional mediaID parameter when there are multiple media types
aEventHandlerInstalls an event handler to provide message passing between clients and sources/sinks.
Return Value
A newly constructed data path object.

NewL ( TUid, TMediaId, MAsyncEventHandler & )

IMPORT_C CMMFDataPath2 *NewL(TUidaCodecUid,
TMediaIdaMediaId,
MAsyncEventHandler &aEventHandler
)[static]

Allocates and constructs a data path according to the specified codec UID.

Use this function if the codec UID is already known by CMMFController

and there is ambiguity ie. more than one possible data path.

TMediaId used to select the path.

Parameters
aCodecUidThe codec UID.
aMediaIdOptional mediaID parameter when there are multiple media types.
aEventHandlerInstalls an event handler to provide message passing between clients and sources/sinks.
Return Value
A newly constructed data path object.

OutputPosition ( )

TTimeIntervalMicroSeconds OutputPosition()const [protected]

Pause ( )

voidPause()[virtual]

Reimplemented from CMMFDataPath::Pause()

Pauses playing.

Sends KMMFErrorCategoryDataPathGeneralError to the client if an error occurs.

PlayL ( )

voidPlayL()[virtual]

Reimplemented from CMMFDataPath::PlayL()

Starts an active scheduler 'play' loop.

Can only play from the primed state.

PlaySilence ( )

voidPlaySilence()[protected]

Position ( )

TTimeIntervalMicroSeconds Position()const [virtual]

Gets the data path position.

Return Value
The data path position.

PreEmptionPause ( )

IMPORT_C voidPreEmptionPause()

PrimeL ( )

voidPrimeL()[virtual]

Reimplemented from CMMFDataPath::PrimeL()

Allocates buffers in preparation to play.

Must be called before calling PlayL().

iSnkBufRef and iSrcBufRef contain ETrue if these buffers are created and owned by a MDataSource or MDataSink

For clean-up purposes, datapath only cleans up buffers allocated directly by PrimeL().

RepeatTrailingSilenceTimerComplete ( TAny * )

TInt RepeatTrailingSilenceTimerComplete(TAny *aDataPath)[protected, static]

ResetL ( )

voidResetL()[virtual]

Reimplemented from CMMFDataPath::ResetL()

Deletes buffers if this datapath's sources and sinks own the buffers returned by PrimeL().

Typically if buffers are created asychronously, the datapath doesn't own the buffer

so leaves cleanup handling to the owner sources/sinks.

Called when source and sink needs to be de-referenced. Sets iDataPathCreated, iSinkCanReceive,

iSnkBufRef and iSrcBufRef to EFalse; sets iState to EStopped.

RetainRepeatInfo ( )

IMPORT_C voidRetainRepeatInfo()

This call indicates PlayL not to reset the iNumberOfTimesPlayed property. This method is used by the controller plugin

during repositioning. PlayL call during seeking should not reset the iNumberOfTimesPlayed property.

RunL ( )

voidRunL()[virtual]

Reimplemented from CMMFDataPath::RunL()

Runs the clip depending on the current data path and transfer state.

For example, fills the sink buffer if TDataPathState is EPlaying and TTransferState is ENeedSinkData.

SetDrmProperties ( MDataSource *, TBool * )

IMPORT_C voidSetDrmProperties(MDataSource *iDrmSource,
TBool *aDisableAutoIntent
)

Sets the Drm file source and the automatic execute intent flag. This method is used by the controller plugin

to pass these to the datapath in order to execute the play intent during loop play.

automatically or not.

Parameters
iDrmSourceData Source on which the play intent needs to be executed. This is usually the CMMFFile source
aDisableAutoIntentBoolean variable which states whether the controller plugin or the datapath needs to execute play intent

SetPositionL ( const TTimeIntervalMicroSeconds & )

voidSetPositionL(const TTimeIntervalMicroSeconds &aPosition)[virtual]

Sets the data path position.

Parameters
aPositionThe data path position.

SetRepeats ( TInt, const TTimeIntervalMicroSeconds & )

IMPORT_C voidSetRepeats(TIntaRepeatNumberOfTimes,
const TTimeIntervalMicroSeconds &aTrailingSilence
)

Sets the number of times the audio sample is to be repeated during the

playback operation.

A period of silence can follow each playing of the sample. The audio

sample can be repeated indefinitely.

the trailing silence, is to be repeated. If this is

set to KMdaRepeatForever, then the audio

sample, together with the trailing silence, is

repeated indefinitely or until Stop() is

called. If this is set to zero, then the audio sample

is not repeated.

Parameters
aRepeatNumberOfTimesThe number of times the audio sample, together with
aTrailingSilenceThe time interval of the trailing silence in microseconds.

Stop ( )

voidStop()[virtual]

Reimplemented from CMMFDataPath::Stop()

Stops playing.

Resets datapath position - currently does not clean up buffers. Sends KMMFErrorCategoryDataPathGeneralError

to the client if an error occurs.