#include "mmfdatapath2.h"
class CMMFDataPath2 : public CMMFDataPath |
Public Member Functions | |
---|---|
virtual | ~CMMFDataPath2() |
virtual 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 &) |
virtual void | Pause() |
virtual void | PlayL() |
virtual TTimeIntervalMicroSeconds | Position() |
IMPORT_C void | PreEmptionPause() |
virtual void | PrimeL() |
virtual void | ResetL() |
IMPORT_C void | RetainRepeatInfo() |
virtual void | RunL() |
IMPORT_C void | SetDrmProperties(MDataSource *, TBool *) |
virtual void | SetPositionL(const TTimeIntervalMicroSeconds &) |
IMPORT_C void | SetRepeats(TInt, const TTimeIntervalMicroSeconds &) |
virtual void | Stop() |
Protected Member Functions | |
---|---|
CMMFDataPath2(TMediaId, MAsyncEventHandler &) | |
TTimeIntervalMicroSeconds | CalculateAudioOutputPosition() |
void | ConstructL(TUid) |
virtual void | DoCancel() |
void | DoFillSourceBufferL() |
void | DoPauseL() |
void | DoPreEmptionPauseL() |
TInt | DoRepeatTrailingSilenceTimerCompleteL() |
void | DoStopL() |
void | FillSourceBufferL() |
TTimeIntervalMicroSeconds | OutputPosition() |
void | PlaySilence() |
TInt | RepeatTrailingSilenceTimerComplete(TAny *) |
Inherited Enumerations | |
---|---|
CActive:TPriority | |
CMMFDataPath:TDataPathState | |
CMMFDataPath:TNeedBuffer | |
CMMFDataPath:TTransferState |
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
TInt | iNumberOfTimesToRepeat | [protected] |
The number of times to repeat the audio sample.
CPeriodic * | iRepeatTrailingSilenceTimer | [protected] |
Timer used for trailing silences when repeating
TTimeIntervalMicroSeconds | iTimeLeftToPlayComplete | [protected] |
The time left for the play to be completed in a particular repeat
TTimeIntervalMicroSeconds | iTrailingSilence | [protected] |
The time interval of the trailing silence in microseconds.
TTimeIntervalMicroSeconds | iTrailingSilenceLeftToPlay | [protected] |
The time interval of the trailing silence left to play in microseconds.
CMMFDataPath2 | ( | TMediaId | aMediaId, |
MAsyncEventHandler & | aEventHandler | ||
) | [protected] |
void | BufferFilledL | ( | CMMFBuffer * | aBuffer | ) | [virtual] |
Reimplemented from CMMFDataPath::BufferFilledL(CMMFBuffer *)
Indicates the data source has filled the specified buffer.
Called by the CMMFDataPath2's MDataSource when it has filled the buffer.
Parameter | Description |
---|---|
aBuffer | A pointer to the filled buffer. |
TTimeIntervalMicroSeconds | CalculateAudioOutputPosition | ( | ) | const [protected] |
Reimplemented from CMMFDataPath::CalculateAudioOutputPosition()const
void | ConstructL | ( | TUid | aCodecUid = KNullUid | ) | [protected] |
Reimplemented from CMMFDataPath::ConstructL(TUid)
Takes UID of codec on construction, and if not an NULL codec sets the datapath up for codec instantiation.
Parameter | Description |
---|---|
aCodecUid | The UID of the codec. |
void | DoCancel | ( | ) | [protected, virtual] |
Reimplemented from CMMFDataPath::DoCancel()
Cancels the silence timer.
void | DoPauseL | ( | ) | [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().
void | DoPreEmptionPauseL | ( | ) | [protected] |
Pauses playing.
Sends KMMFErrorCategoryDataPathGeneralError to the client if an error occurs.
void | DoStopL | ( | ) | [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.
void | FillSourceBufferL | ( | ) | [protected] |
Reimplemented from CMMFDataPath::FillSourceBufferL()
IMPORT_C CMMFDataPath2 * | NewL | ( | MAsyncEventHandler & | aEventHandler | ) | [static] |
Reimplemented from CMMFDataPath::NewL(MAsyncEventHandler &)
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.
Parameter | Description |
---|---|
aEventHandler | Installs an event handler to provide message passing between clients and sources/sinks. |
Returns: Newly constructed data path object.
IMPORT_C CMMFDataPath2 * | NewL | ( | TMediaId | aMediaId, |
MAsyncEventHandler & | aEventHandler | |||
) | [static] |
Reimplemented from CMMFDataPath::NewL(TMediaId,MAsyncEventHandler &)
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.
Parameter | Description |
---|---|
aMediaId | Optional media ID parameter when there are multiple media types. |
aEventHandler | Installs an event handler to provide message passing between clients and sources/sinks. |
Returns: A newly constructed data path object.
IMPORT_C CMMFDataPath2 * | NewL | ( | TUid | aCodecUid, |
MAsyncEventHandler & | aEventHandler | |||
) | [static] |
Reimplemented from CMMFDataPath::NewL(TUid,MAsyncEventHandler &)
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
Parameter | Description |
---|---|
aCodecUid | Optional mediaID parameter when there are multiple media types |
aEventHandler | Installs an event handler to provide message passing between clients and sources/sinks. |
Returns: A newly constructed data path object.
IMPORT_C CMMFDataPath2 * | NewL | ( | TUid | aCodecUid, |
TMediaId | aMediaId, | |||
MAsyncEventHandler & | aEventHandler | |||
) | [static] |
Reimplemented from CMMFDataPath::NewL(TUid,TMediaId,MAsyncEventHandler &)
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.
Parameter | Description |
---|---|
aCodecUid | The codec UID. |
aMediaId | Optional mediaID parameter when there are multiple media types. |
aEventHandler | Installs an event handler to provide message passing between clients and sources/sinks. |
Returns: A newly constructed data path object.
TTimeIntervalMicroSeconds | OutputPosition | ( | ) | const [protected] |
Reimplemented from CMMFDataPath::OutputPosition()const
void | Pause | ( | ) | [virtual] |
Reimplemented from CMMFDataPath::Pause()
Pauses playing.
Sends KMMFErrorCategoryDataPathGeneralError to the client if an error occurs.
void | PlayL | ( | ) | [virtual] |
Reimplemented from CMMFDataPath::PlayL()
Starts an active scheduler 'play' loop.
Can only play from the primed state.
TTimeIntervalMicroSeconds | Position | ( | ) | const [virtual] |
Reimplemented from CMMFDataPath::Position()const
Gets the data path position.
Returns: The data path position.
void | PrimeL | ( | ) | [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().
void | ResetL | ( | ) | [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.
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.
void | RunL | ( | ) | [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.
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.
Parameter | Description |
---|---|
iDrmSource | Data Source on which the play intent needs to be executed. This is usually the CMMFFile source |
aDisableAutoIntent | Boolean variable which states whether the controller plugin or the datapath needs to execute play intent automatically or not. |
void | SetPositionL | ( | const TTimeIntervalMicroSeconds & | aPosition | ) | [virtual] |
Reimplemented from CMMFDataPath::SetPositionL(const TTimeIntervalMicroSeconds &)
Sets the data path position.
Parameter | Description |
---|---|
aPosition | The data path position. |
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.
Parameter | Description |
---|---|
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. |
aTrailingSilence | The time interval of the trailing silence in microseconds. |
void | Stop | ( | ) | [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.