CMMFDataPath2 Class Reference

class CMMFDataPath2 : public CMMFDataPath

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.

CMMFDataPath

Inherits from

Public Member Functions
~CMMFDataPath2()
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 &)
voidPause()
voidPlayL()
TTimeIntervalMicroSeconds Position()
IMPORT_C voidPreEmptionPause()
voidPrimeL()
voidResetL()
IMPORT_C voidRetainRepeatInfo()
voidRunL()
IMPORT_C voidSetDrmProperties(MDataSource *, TBool *)
voidSetPositionL(const TTimeIntervalMicroSeconds &)
IMPORT_C voidSetRepeats(TInt, const TTimeIntervalMicroSeconds &)
voidStop()
Protected Member Functions
CMMFDataPath2(TMediaId, MAsyncEventHandler &)
TTimeIntervalMicroSeconds CalculateAudioOutputPosition()
voidConstructL(TUid)
voidDoCancel()
voidDoFillSourceBufferL()
voidDoPauseL()
voidDoPreEmptionPauseL()
TInt DoRepeatTrailingSilenceTimerCompleteL()
voidDoStopL()
voidFillSourceBufferL()
TTimeIntervalMicroSeconds OutputPosition()
voidPlaySilence()
TInt RepeatTrailingSilenceTimerComplete(TAny *)
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()
Inherited Enumerations
CActive:TPriority
CMMFDataPath:TDataPathState
CMMFDataPath:TNeedBuffer
CMMFDataPath:TTransferState
Protected Attributes
TTimeIntervalMicroSeconds iDevSoundRepositionTime
TBool *iDisableAutoIntent
MDataSource *iDrmSource
TBool iGetTimePlayedSupported
TBool iIsResumeSupported
TBool iIsUsingResumeSupport
TInt iNumberOfTimesPlayed
TInt iNumberOfTimesToRepeat
CPeriodic *iRepeatTrailingSilenceTimer
TBool iRetainRepeatInfo
TTimeIntervalMicroSeconds iTimeLeftToPlayComplete
TTimeIntervalMicroSeconds iTrailingSilence
TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay
TBool iVerifyPlayComplete
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

Constructor & Destructor Documentation

CMMFDataPath2(TMediaId, MAsyncEventHandler &)

CMMFDataPath2(TMediaIdaMediaId,
MAsyncEventHandler &aEventHandler
)[protected]

Parameters

TMediaId aMediaId
MAsyncEventHandler & aEventHandler

~CMMFDataPath2()

~CMMFDataPath2()[virtual]

Standard destructor.

Member Functions 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

CMMFBuffer * 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

TUid aCodecUid = KNullUidThe UID of the codec.

DoCancel()

voidDoCancel()[protected, virtual]

Cancels the silence timer.

DoFillSourceBufferL()

voidDoFillSourceBufferL()[protected]

DoPauseL()

voidDoPauseL()[protected]

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]

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

MAsyncEventHandler & aEventHandlerInstalls an event handler to provide message passing between clients and sources/sinks.

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

TMediaId aMediaIdOptional media ID parameter when there are multiple media types.
MAsyncEventHandler & aEventHandlerInstalls an event handler to provide message passing between clients and sources/sinks.

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

TUid aCodecUidOptional mediaID parameter when there are multiple media types
MAsyncEventHandler & aEventHandlerInstalls an event handler to provide message passing between clients and sources/sinks.

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

TUid aCodecUidThe codec UID.
TMediaId aMediaIdOptional mediaID parameter when there are multiple media types.
MAsyncEventHandler & aEventHandlerInstalls an event handler to provide message passing between clients and sources/sinks.

OutputPosition()

TTimeIntervalMicroSeconds OutputPosition()const [protected]

Pause()

voidPause()[virtual]

Pauses playing.

Sends KMMFErrorCategoryDataPathGeneralError to the client if an error occurs.

PlayL()

voidPlayL()[virtual]

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.

PreEmptionPause()

IMPORT_C voidPreEmptionPause()

PrimeL()

voidPrimeL()[virtual]

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]

Parameters

TAny * aDataPath

ResetL()

voidResetL()[virtual]

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]

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.

Parameters

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

SetPositionL(const TTimeIntervalMicroSeconds &)

voidSetPositionL(const TTimeIntervalMicroSeconds &aPosition)[virtual]

Sets the data path position.

Parameters

const TTimeIntervalMicroSeconds & 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.

Parameters

TInt aRepeatNumberOfTimesThe number of times the audio sample, together with 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.
const TTimeIntervalMicroSeconds & aTrailingSilenceThe time interval of the trailing silence in microseconds.

Stop()

voidStop()[virtual]

Stops playing.

Resets datapath position - currently does not clean up buffers. Sends KMMFErrorCategoryDataPathGeneralError to the client if an error occurs.

Member Data Documentation

TTimeIntervalMicroSeconds iDevSoundRepositionTime

TTimeIntervalMicroSeconds iDevSoundRepositionTime[protected]

TBool * iDisableAutoIntent

TBool *iDisableAutoIntent[protected]

MDataSource * iDrmSource

MDataSource *iDrmSource[protected]

TBool iGetTimePlayedSupported

TBool iGetTimePlayedSupported[protected]

TBool iIsResumeSupported

TBool iIsResumeSupported[protected]

TBool iIsUsingResumeSupport

TBool iIsUsingResumeSupport[protected]

TInt iNumberOfTimesPlayed

TInt iNumberOfTimesPlayed[protected]

The number of times played.

TInt iNumberOfTimesToRepeat

TInt iNumberOfTimesToRepeat[protected]

The number of times to repeat the audio sample.

CPeriodic * iRepeatTrailingSilenceTimer

CPeriodic *iRepeatTrailingSilenceTimer[protected]

Timer used for trailing silences when repeating

TBool iRetainRepeatInfo

TBool iRetainRepeatInfo[protected]

TTimeIntervalMicroSeconds iTimeLeftToPlayComplete

TTimeIntervalMicroSeconds iTimeLeftToPlayComplete[protected]

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

TTimeIntervalMicroSeconds iTrailingSilence

TTimeIntervalMicroSeconds iTrailingSilence[protected]

The time interval of the trailing silence in microseconds.

TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay

TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay[protected]

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

TBool iVerifyPlayComplete

TBool iVerifyPlayComplete[protected]