CMMFController Class Reference

class CMMFController : public CBase

Base class for controller plugins.

A controller plugin for the multimedia framework must derive from this class and implement all the pure virtual functions.

Controller plugins control the flow of multimedia data from one or more sources to one or more sinks. For example, an audio controller plugin might take data from a file source and output it to a speaker sink, or take data from a microphone source and save it to a file sink. A controller plugin typically supports one or more multimedia formats, for example WAV or MPEG4.

Since
7.0s

Inherits from

Public Member Functions
~CMMFController()
IMPORT_C voidHandleRequestL(TMMFMessage &)
CMMFController *NewL(TUid, MAsyncEventHandler &, TThreadId)
Protected Member Functions
CMMFController()
IMPORT_C voidAddCustomCommandParserL(CMMFCustomCommandParserBase &)
voidAddDataSinkL(MDataSink &)
voidAddDataSourceL(MDataSource &)
IMPORT_C TThreadIdClientThreadIdL()
voidCustomCommand(TMMFMessage &)
IMPORT_C TIntDoSendEventToClient(const TMMFEvent &)
TTimeIntervalMicroSeconds DurationL()
CMMFMetaDataEntry *GetMetaDataEntryL(TInt)
voidGetNumberOfMetaDataEntriesL(TInt &)
IMPORT_C TBoolIsSecureDrmModeL()
IMPORT_C CMMFObjectContainer &MMFObjectContainerL()
voidPauseL()
IMPORT_C voidPauseL(TMMFMessage &)
voidPlayL()
IMPORT_C voidPlayL(TMMFMessage &)
TTimeIntervalMicroSeconds PositionL()
voidPrimeL()
IMPORT_C voidPrimeL(TMMFMessage &)
voidRemoveDataSinkL(MDataSink &)
voidRemoveDataSourceL(MDataSource &)
voidResetL()
voidSetPositionL(const TTimeIntervalMicroSeconds &)
voidSetPrioritySettings(const TMMFPrioritySettings &)
voidStopL()
IMPORT_C voidStopL(TMMFMessage &)
Private Member Functions
voidAddMDataSinkAndRepondClientL(MDataSink *, TMMFMessage &)
voidAddMDataSourceAndRepondClientL(MDataSource *, TMMFMessage &)
voidConstructL(MAsyncEventHandler &, TThreadId)
CMMFControllerExtendedData *CreateExtendedDataL(TThreadId)
TBool DoAddDataSinkL(TMMFMessage &)
TBool DoAddDataSourceL(TMMFMessage &)
TBool DoAddFileHandleDataSinkL(TMMFMessage &)
TBool DoAddFileHandleDataSinkWithInitDataL(TMMFMessage &)
TBool DoAddFileHandleDataSourceL(TMMFMessage &)
TBool DoAddFileHandleDataSourceWithInitDataL(TMMFMessage &)
voidDoCustomCommand(TMMFMessage &)
TBool DoGetDurationL(TMMFMessage &)
TBool DoGetMetaDataEntryL(TMMFMessage &)
TBool DoGetNumberOfMetaDataEntriesL(TMMFMessage &)
TBool DoGetPositionL(TMMFMessage &)
TBool DoGetSizeOfMetaDataEntryL(TMMFMessage &)
TBool DoPauseL(TMMFMessage &)
TBool DoPlayL(TMMFMessage &)
TBool DoPreloadSourceSinkInitDataL(TMMFMessage &)
TBool DoPrimeL(TMMFMessage &)
TBool DoRemoveDataSinkL(TMMFMessage &)
TBool DoRemoveDataSourceL(TMMFMessage &)
TBool DoResetL(TMMFMessage &)
TBool DoSetPositionL(TMMFMessage &)
TBool DoSetPrioritySettingsL(TMMFMessage &)
TBool DoStopL(TMMFMessage &)
CMMFControllerExtendedData *GetExtendedDataL()
voidReplaceFileHandleInInitDataL(RFile *, TDes8 &)
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()
Private Attributes
MAsyncEventHandler *iAsyncEventHandler
CMMFCustomCommandParserManager *iCustomCommandParserManager
TUid iDtor_ID_Key
CMMFObjectContainer *iMMFObjectContainer
CBufFlat *iMetaDataBuffer

Constructor & Destructor Documentation

CMMFController()

CMMFController()[protected, inline]

Constructor.

~CMMFController()

IMPORT_C~CMMFController()[virtual]

Default destructor.

Member Functions Documentation

AddCustomCommandParserL(CMMFCustomCommandParserBase &)

IMPORT_C voidAddCustomCommandParserL(CMMFCustomCommandParserBase &aParser)[protected]

Adds a custom command parser to the controller framework.

If the controller framework receives a request it does not understand, it will search through its list of custom command parsers before passing the request on to the controller plugin as a custom command.

By using the custom command parsers, the controller plugin can implement a concrete API rather than having to decode the common custom commands itself.

Since
7.0s

Parameters

CMMFCustomCommandParserBase & aParserThe parser to be added to the controller framework. The controller framework takes ownership of the parser if the call does not leave.

AddDataSinkL(MDataSink &)

voidAddDataSinkL(MDataSink &aDataSink)[protected, pure virtual]

Adds a data sink to the controller plugin.

NOTE: The data sink is owned by the controller framework, NOT by the controller plugin. Under no circumstances should the controller plugin delete the data sink.

leave
KErrNotSupported If the controller plugin does not support the data sink, it should leave with this.
Since
7.0s

Parameters

MDataSink & aDataSinkA reference to the data sink to be added. The controller plugin may call aDatasink.DatasinkType() to find out exactly what type of sink it is.

AddDataSourceL(MDataSource &)

voidAddDataSourceL(MDataSource &aDataSource)[protected, pure virtual]

Add a data source to the controller plugin.

NOTE: The data source is owned by the controller framework, NOT by the controller plugin. Under no circumstances should the controller plugin delete the data source.

leave
KErrNotSupported If the controller plugin does not support the data source, it should leave with this.
Since
7.0s

Parameters

MDataSource & aDataSourceA reference to the data source to be added. The controller plugin may call aDataSource.DataSourceType() to find out exactly what type of source it is.

AddMDataSinkAndRepondClientL(MDataSink *, TMMFMessage &)

voidAddMDataSinkAndRepondClientL(MDataSink *aSink,
TMMFMessage &aMessage
)[private]

Parameters

MDataSink * aSink
TMMFMessage & aMessage

AddMDataSourceAndRepondClientL(MDataSource *, TMMFMessage &)

voidAddMDataSourceAndRepondClientL(MDataSource *aSource,
TMMFMessage &aMessage
)[private]

Parameters

MDataSource * aSource
TMMFMessage & aMessage

ClientThreadIdL()

IMPORT_C TThreadIdClientThreadIdL()[protected]

Retrieves the client thread Id of this controller.

ConstructL(MAsyncEventHandler &, TThreadId)

voidConstructL(MAsyncEventHandler &aEventHandler,
TThreadIdaClientTid
)[private]

This is internal and not intended for use.

Parameters

MAsyncEventHandler & aEventHandler
TThreadId aClientTid

CreateExtendedDataL(TThreadId)

CMMFControllerExtendedData *CreateExtendedDataL(TThreadIdaClientTid)[private, static]

Parameters

TThreadId aClientTid

CustomCommand(TMMFMessage &)

voidCustomCommand(TMMFMessage &aMessage)[protected, inline, virtual]

Handles a custom command.

Custom commands allow a controller plugin to define its own API. If the controller framework does not understand a message from the client, it is assumed this is a custom command for the plugin and passed into this interface.

The more common custom commands can be handled by Custom Command Parsers on behalf of the controller plugin. This allows the controller plugin to implement a concrete interface (defined by mixin classes) rather than having to decode the command itself. For more information, see CMMFCustomCommandParserBase.

The controller plugin must always complete the message passed into this method, even if it does not support the interface required by the message.

Parameters

TMMFMessage & aMessageThe message to be handled by the controller plugin.

DoAddDataSinkL(TMMFMessage &)

TBool DoAddDataSinkL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoAddDataSourceL(TMMFMessage &)

TBool DoAddDataSourceL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoAddFileHandleDataSinkL(TMMFMessage &)

TBool DoAddFileHandleDataSinkL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoAddFileHandleDataSinkWithInitDataL(TMMFMessage &)

TBool DoAddFileHandleDataSinkWithInitDataL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoAddFileHandleDataSourceL(TMMFMessage &)

TBool DoAddFileHandleDataSourceL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoAddFileHandleDataSourceWithInitDataL(TMMFMessage &)

TBool DoAddFileHandleDataSourceWithInitDataL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoCustomCommand(TMMFMessage &)

voidDoCustomCommand(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoGetDurationL(TMMFMessage &)

TBool DoGetDurationL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoGetMetaDataEntryL(TMMFMessage &)

TBool DoGetMetaDataEntryL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoGetNumberOfMetaDataEntriesL(TMMFMessage &)

TBool DoGetNumberOfMetaDataEntriesL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoGetPositionL(TMMFMessage &)

TBool DoGetPositionL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoGetSizeOfMetaDataEntryL(TMMFMessage &)

TBool DoGetSizeOfMetaDataEntryL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoPauseL(TMMFMessage &)

TBool DoPauseL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoPlayL(TMMFMessage &)

TBool DoPlayL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoPreloadSourceSinkInitDataL(TMMFMessage &)

TBool DoPreloadSourceSinkInitDataL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoPrimeL(TMMFMessage &)

TBool DoPrimeL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoRemoveDataSinkL(TMMFMessage &)

TBool DoRemoveDataSinkL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoRemoveDataSourceL(TMMFMessage &)

TBool DoRemoveDataSourceL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoResetL(TMMFMessage &)

TBool DoResetL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoSendEventToClient(const TMMFEvent &)

IMPORT_C TIntDoSendEventToClient(const TMMFEvent &aEvent)[protected]

Sends an event to the client.

The controller plugin can use this method to send an event to the client.

Since
7.0s

Parameters

const TMMFEvent & aEventThe event to be sent to the client.

DoSetPositionL(TMMFMessage &)

TBool DoSetPositionL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoSetPrioritySettingsL(TMMFMessage &)

TBool DoSetPrioritySettingsL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DoStopL(TMMFMessage &)

TBool DoStopL(TMMFMessage &aMessage)[private]

Parameters

TMMFMessage & aMessage

DurationL()

TTimeIntervalMicroSeconds DurationL()const [protected, pure virtual]

Gets the duration of the clip.

The controller plugin should calculate the clip duration in microseconds.

Since
7.0s

GetExtendedDataL()

CMMFControllerExtendedData *GetExtendedDataL()[private]

GetMetaDataEntryL(TInt)

CMMFMetaDataEntry *GetMetaDataEntryL(TIntaIndex)[protected, pure virtual]

Retrieves a meta data entry from the clip.

Since
7.0s

Parameters

TInt aIndexThe index of the meta data entry to retrieve.

GetNumberOfMetaDataEntriesL(TInt &)

voidGetNumberOfMetaDataEntriesL(TInt &aNumberOfEntries)[protected, pure virtual]

RetrieveS the number of meta data entries in the clip.

Since
7.0s

Parameters

TInt & aNumberOfEntriesThe controller plugin must set this to the number of meta data entries in the clip.

HandleRequestL(TMMFMessage &)

IMPORT_C voidHandleRequestL(TMMFMessage &aMessage)[virtual]

Handles a message from the client.

Decodes the message and calls one of the private DoXxx methods to unpackaged the parameters.

Since
7.0s

Parameters

TMMFMessage & aMessageThe message to be handled.

IsSecureDrmModeL()

IMPORT_C TBoolIsSecureDrmModeL()[protected]

Check the Secure DRM Mode of current controller object

MMFObjectContainerL()

IMPORT_C CMMFObjectContainer &MMFObjectContainerL()[protected]

Gets a reference to the multimedia framework object container.

The controller plugin may add CMMFObject-derived objects to the container to allow them to receive messages directly from the client.

Since
7.0s

NewL(TUid, MAsyncEventHandler &, TThreadId)

CMMFController *NewL(TUidaControllerUid,
MAsyncEventHandler &aEventHandler,
TThreadIdaClientTid
)[static]

Allocates and constructs a new controller plugin.

Uses ECOM to instantiate a new controller plugin. Can leave with any of the system-wide error codes.

Since
7.0s

Parameters

TUid aControllerUidThe unique ID of the controller to be instantiated from ECOM.
MAsyncEventHandler & aEventHandlerA reference to an event handling object that can be used by the controller to send events back to the client.
TThreadId aClientTidThe thread Id of the client thread

PauseL()

voidPauseL()[protected, pure virtual]

Pauses the controller plugin.

The controller must now cease transferring data from its source(s) to its sink(s). This moves the controller from the PLAYING back to the PRIMED state.

A subsequent call to Play() will cause the controller plugin to resume playback from the point it was paused (unless there has been a call to SetPosition() in the meantime.

Since
7.0s

PauseL(TMMFMessage &)

IMPORT_C voidPauseL(TMMFMessage &aMessage)[protected, virtual]

A partner to the PauseL() method that is overridable to allow Asynchronous completion in the controller whilst maintaining a Synchronous client API.

The default implementation of this is to call PauseL() and complete the message with KErrNone.

Since
7.0s

Parameters

TMMFMessage & aMessage

PlayL()

voidPlayL()[protected, pure virtual]

Commences playback.

The controller must now begin transferring data from its source(s) to its sink(s). This moves the controller from the PRIMED to the PLAYING state.

Note: This method must return once playing has commenced, and not wait until playing is complete.

Since
7.0s

PlayL(TMMFMessage &)

IMPORT_C voidPlayL(TMMFMessage &aMessage)[protected, virtual]

A partner to the PlayL() method that is overridable to allow Asynchronous completion in the controller whilst maintaining a Synchronous client API.

The default implementation of this is to call PlayL() and complete the message with KErrNone.

Since
7.0s

Parameters

TMMFMessage & aMessage

PositionL()

TTimeIntervalMicroSeconds PositionL()const [protected, pure virtual]

Gets the current position.

The controller plugin should calculate the current position in microseconds.

Since
7.0s

PrimeL()

voidPrimeL()[protected, pure virtual]

Primes the controller plugin.

The controller must prepare to start playing, by initialising its sources, sinks and buffers. This moves the controller from the STOPPED to the PRIMED state.

Since
7.0s

PrimeL(TMMFMessage &)

IMPORT_C voidPrimeL(TMMFMessage &aMessage)[protected, virtual]

A partner to the PrimeL() method that is overridable to allow Asynchronous completion in the controller whilst maintaining a Synchronous client API.

The default implementation of this is to call PrimeL() and complete the message with KErrNone.

Since
7.0s

Parameters

TMMFMessage & aMessage

RemoveDataSinkL(MDataSink &)

voidRemoveDataSinkL(MDataSink &aDataSink)[protected, pure virtual]

Removes a data sink from the controller plugin.

Note: The data sink is owned by the controller framework, NOT by the controller plugin. Under no circumstances should the controller plugin delete the data sink.

leave
KErrNotSupported The controller plugin may leave during this method. If the controller plugin does not support the removal of data sinks, it should leave with KErrNotSupported. If the controller plugin leaves, the data sink will not be destroyed by the controller framework. If it does not leave, the data sink will be destroyed.
Since
7.0s

Parameters

MDataSink & aDataSinkA reference to the data sink to be removed.

RemoveDataSourceL(MDataSource &)

voidRemoveDataSourceL(MDataSource &aDataSource)[protected, pure virtual]

Removes a data source from the controller plugin.

Note: The data source is owned by the controller framework, NOT by the controller plugin. Under no circumstances should the controller plugin delete the data source.

leave
KErrNotSupported The controller plugin may leave during this method. If the controller plugin does not support the removal of data sources, it should leave with KErrNotSupported. If the controller plugin leaves, the data source will not be destroyed by the controller framework. If it does not leave, the data source will be destroyed.
Since
7.0s

Parameters

MDataSource & aDataSourceA reference to the data source to be removed.

ReplaceFileHandleInInitDataL(RFile *, TDes8 &)

voidReplaceFileHandleInInitDataL(RFile *aFile,
TDes8 &aInitData
)[private]

Parameters

RFile * aFile
TDes8 & aInitData

ResetL()

voidResetL()[protected, pure virtual]

Resets the controller plugin.

The controller should revert back to its newly constructed state. If the Reset is successful (i.e. it doesn't leave), the controller framework will delete all objects added to the MMFObjectManager including any sources and sinks.

leave
KErrNotSupported If the controller plugin does not support being reset, it should leave with KErrNotSupported.
Since
7.0s

SetPositionL(const TTimeIntervalMicroSeconds &)

voidSetPositionL(const TTimeIntervalMicroSeconds &aPosition)[protected, pure virtual]

Sets the current position.

The controller plugin should reposition itself to the position provided.

Since
7.0s

Parameters

const TTimeIntervalMicroSeconds & aPositionThe desired position in microseconds.

SetPrioritySettings(const TMMFPrioritySettings &)

voidSetPrioritySettings(const TMMFPrioritySettings &aPrioritySettings)[protected, pure virtual]

Sets the priority settings.

The new priority settings must be applied to any resource being used by the controller plugin that requires priority settings (for example the sound device).

Since
7.0s

Parameters

const TMMFPrioritySettings & aPrioritySettingsThe new priority settings

StopL()

voidStopL()[protected, pure virtual]

Stops the controller plugin.

The controller must now undo anything that occurred during the call to Prime(). This moves the controller from the PRIMED back to the STOPPED state.

Since
7.0s

StopL(TMMFMessage &)

IMPORT_C voidStopL(TMMFMessage &aMessage)[protected, virtual]

A partner to the StopL() method that is overridable to allow Asynchronous completion in the controller whilst maintaining a Synchronous client API.

The default implementation of this is to call StopL() and complete the message with KErrNone.

Since
7.0s

Parameters

TMMFMessage & aMessage

Member Data Documentation

MAsyncEventHandler * iAsyncEventHandler

MAsyncEventHandler *iAsyncEventHandler[private]

The event handler for the controller plugin.

CMMFCustomCommandParserManager * iCustomCommandParserManager

CMMFCustomCommandParserManager *iCustomCommandParserManager[private]

The custom command parser manager.

TUid iDtor_ID_Key

TUid iDtor_ID_Key[private]

Required by ECOM.

CMMFObjectContainer * iMMFObjectContainer

CMMFObjectContainer *iMMFObjectContainer[private]

The MMF object container.

CBufFlat * iMetaDataBuffer

CBufFlat *iMetaDataBuffer[private]

Buffer to assist copy of meta data over the thread boundary.