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 ()
void BufferFilledL ( 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 &)
void Pause ()
void PlayL ()
TTimeIntervalMicroSeconds Position ()
IMPORT_C void PreEmptionPause ()
void PrimeL ()
void ResetL ()
IMPORT_C void RetainRepeatInfo ()
void RunL ()
IMPORT_C void SetDrmProperties ( MDataSource *, TBool *)
void SetPositionL (const TTimeIntervalMicroSeconds &)
IMPORT_C void SetRepeats ( TInt , const TTimeIntervalMicroSeconds &)
void Stop ()
Protected Member Functions
CMMFDataPath2 ( TMediaId , MAsyncEventHandler &)
TTimeIntervalMicroSeconds CalculateAudioOutputPosition ()
void ConstructL ( TUid )
void DoCancel ()
void DoFillSourceBufferL ()
void DoPauseL ()
void DoPreEmptionPauseL ()
TInt DoRepeatTrailingSilenceTimerCompleteL ()
void DoStopL ()
void FillSourceBufferL ()
TTimeIntervalMicroSeconds OutputPosition ()
void PlaySilence ()
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 ( TMediaId aMediaId,
MAsyncEventHandler & aEventHandler
) [protected]

Parameters

TMediaId aMediaId
MAsyncEventHandler & aEventHandler

~CMMFDataPath2()

~CMMFDataPath2 ( ) [virtual]

Standard destructor.

Member Functions Documentation

BufferFilledL(CMMFBuffer *)

void BufferFilledL ( 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 * aBuffer A pointer to the filled buffer.

CalculateAudioOutputPosition()

TTimeIntervalMicroSeconds CalculateAudioOutputPosition ( ) const [protected]

ConstructL(TUid)

void ConstructL ( TUid aCodecUid = KNullUid ) [protected]

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

Parameters

TUid aCodecUid = KNullUid The UID of the codec.

DoCancel()

void DoCancel ( ) [protected, virtual]

Cancels the silence timer.

DoFillSourceBufferL()

void DoFillSourceBufferL ( ) [protected]

DoPauseL()

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

void DoPreEmptionPauseL ( ) [protected]

Pauses playing.

Sends KMMFErrorCategoryDataPathGeneralError to the client if an error occurs.

DoRepeatTrailingSilenceTimerCompleteL()

TInt DoRepeatTrailingSilenceTimerCompleteL ( ) [protected]

DoStopL()

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

void FillSourceBufferL ( ) [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 & aEventHandler Installs an event handler to provide message passing between clients and sources/sinks.

NewL(TMediaId, MAsyncEventHandler &)

IMPORT_C CMMFDataPath2 * NewL ( TMediaId aMediaId,
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 aMediaId Optional media ID parameter when there are multiple media types.
MAsyncEventHandler & aEventHandler Installs an event handler to provide message passing between clients and sources/sinks.

NewL(TUid, MAsyncEventHandler &)

IMPORT_C CMMFDataPath2 * NewL ( TUid aCodecUid,
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 aCodecUid Optional mediaID parameter when there are multiple media types
MAsyncEventHandler & aEventHandler Installs an event handler to provide message passing between clients and sources/sinks.

NewL(TUid, TMediaId, MAsyncEventHandler &)

IMPORT_C CMMFDataPath2 * NewL ( TUid aCodecUid,
TMediaId aMediaId,
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 aCodecUid The codec UID.
TMediaId aMediaId Optional mediaID parameter when there are multiple media types.
MAsyncEventHandler & aEventHandler Installs an event handler to provide message passing between clients and sources/sinks.

OutputPosition()

TTimeIntervalMicroSeconds OutputPosition ( ) const [protected]

Pause()

void Pause ( ) [virtual]

Pauses playing.

Sends KMMFErrorCategoryDataPathGeneralError to the client if an error occurs.

PlayL()

void PlayL ( ) [virtual]

Starts an active scheduler 'play' loop.

Can only play from the primed state.

PlaySilence()

void PlaySilence ( ) [protected]

Position()

TTimeIntervalMicroSeconds Position ( ) const [virtual]

Gets the data path position.

PreEmptionPause()

IMPORT_C void PreEmptionPause ( )

PrimeL()

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

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

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()

void RunL ( ) [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 void SetDrmProperties ( 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 * iDrmSource Data Source on which the play intent needs to be executed. This is usually the CMMFFile source
TBool * aDisableAutoIntent Boolean variable which states whether the controller plugin or the datapath needs to execute play intent automatically or not.

SetPositionL(const TTimeIntervalMicroSeconds &)

void SetPositionL ( const TTimeIntervalMicroSeconds & aPosition ) [virtual]

Sets the data path position.

Parameters

const TTimeIntervalMicroSeconds & aPosition The data path position.

SetRepeats(TInt, const TTimeIntervalMicroSeconds &)

IMPORT_C void SetRepeats ( TInt aRepeatNumberOfTimes,
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 aRepeatNumberOfTimes The 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 & aTrailingSilence The time interval of the trailing silence in microseconds.

Stop()

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