RMMFControllerProxy Class Reference

class RMMFControllerProxy : public RMmfSessionBase

RSessionBase-based client class to handle the creation of the controller thread and message sending over IPC.

The controller proxy is responsible for sending and recieving messages over IPC; it does not care exactly what those messages are.

Note the fact that, although this is an internal component, its size cannot be changed because it's embedded in a publishedAll class (RMMFController) and the size of the latter would also be changed raising a binary compatibility problem.

7.0s

Inherits from

Public Member Functions
RMMFControllerProxy()
IMPORT_C TIntCancelReceiveEvents()
IMPORT_C voidClose()
IMPORT_C TIntLoadController(TUid, TBool)
IMPORT_C TIntLoadController(const CMMFControllerImplementationInformation &, TBool)
IMPORT_C TIntLoadControllerInSecureDRMProcess(TUid, TBool)
IMPORT_C TIntLoadControllerInSecureDRMProcess(const CMMFControllerImplementationInformation &, TBool)
IMPORT_C voidReceiveEvents(TMMFEventPckg &, TRequestStatus &)
IMPORT_C voidSendAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C voidSendAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus &)
IMPORT_C voidSendAsync(TInt, const TIpcArgs &, TRequestStatus &)
IMPORT_C TIntSendSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &)
IMPORT_C TIntSendSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntSendSync(TInt, const TIpcArgs &)
IMPORT_C TIntSetThreadPriority(const TThreadPriority &)
voidThreadTerminated()
Private Member Functions
TUint ControllersMaxHeapSizeL(TUid)
TInt DoCreateSessionForNoDRMCapClient(TUint, TBool, TUint)
TInt DoCreateSubThread(RServer2 *, TUint, TBool, TUint)
TInt LoadController(TUid, const CMMFControllerImplementationInformation &, TBool, TBool)
voidReleaseHeap()
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RMmfSessionBase::SendReceive(TInt)const
RMmfSessionBase::SendReceive(TInt,TInt)const
RMmfSessionBase::SendReceive(TInt,TInt,TInt)const
RMmfSessionBase::SendReceive(TInt,TInt,TInt,TRequestStatus &)const
RMmfSessionBase::SendReceive(TInt,TInt,TRequestStatus &)const
RMmfSessionBase::SendReceive(TInt,TInt,const TDesC8 &,const TDesC8 &)const
RMmfSessionBase::SendReceive(TInt,TInt,const TDesC8 &,const TDesC8 &,TRequestStatus &)const
RMmfSessionBase::SendReceive(TInt,TRequestStatus &)const
RMmfSessionBase::SendReceive(TInt,const TDesC &)const
RMmfSessionBase::SendReceive(TInt,const TDesC &,TRequestStatus &)const
RMmfSessionBase::SendReceive(TInt,const TDesC8 &)const
RMmfSessionBase::SendReceive(TInt,const TDesC8 &,TRequestStatus &)const
RMmfSessionBase::SendReceive(TInt,const TDesC8 &,const TDesC8 &)const
RMmfSessionBase::SendReceive(TInt,const TDesC8 &,const TDesC8 &,TRequestStatus &)const
RMmfSessionBase::SendReceive(TInt,const TDesC8 &,const TDesC8 &,const TDesC8 &)const
RMmfSessionBase::SendReceive(TInt,const TDesC8 &,const TDesC8 &,const TDesC8 &,TRequestStatus &)const
RMmfSessionBase::SendReceiveResult(TInt,TDes8 &)const
RMmfSessionBase::SendReceiveResult(TInt,TDes8 &,TRequestStatus &)const
RMmfSessionBase::SendReceiveResult(TInt,TInt,const TDesC8 &,const TDesC8 &,TDes8 &)const
RMmfSessionBase::SendReceiveResult(TInt,TInt,const TDesC8 &,const TDesC8 &,TDes8 &,TRequestStatus &)const
RMmfSessionBase::SendReceiveResult(TInt,const TDesC8 &,const TDesC8 &,TDes &)const
RMmfSessionBase::SendReceiveResult(TInt,const TDesC8 &,const TDesC8 &,TDes8 &)const
RMmfSessionBase::SendReceiveResult(TInt,const TDesC8 &,const TDesC8 &,TDes8 &,TRequestStatus &)const
RMmfSessionBase::SendReceiveResult(TInt,const TDesC8 &,const TDesC8 &,const TDesC8 &,TDes8 &)const
RMmfSessionBase::SendReceiveResult(TInt,const TDesC8 &,const TDesC8 &,const TDesC8 &,TDes8 &,TRequestStatus &)const
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Private Member Enumerations
enumanonymous { EFlagOpenedSharedHeap = 0x01 }
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
TMMFMessageDestinationPckg iDestinationPckg
TInt iFlags
CLogonMonitor *iLogonAO
TInt iReserved1
RThread iSubThread
TThreadPriority iThreadPriority
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RMMFControllerProxy()

IMPORT_CRMMFControllerProxy()

Constructor. 7.0s

Member Functions Documentation

CancelReceiveEvents()

IMPORT_C TIntCancelReceiveEvents()

Cancel a previous registration to receive events from the controller framework.

This must be called from the DoCancel() method of the active object using the ReceiveEvents() API.

One of the standard system-wide error codes.

TMMFEvent

7.0s

Close()

IMPORT_C voidClose()

Delete the controller plugin and close its thread.

Clients must call Close() on the controller proxy, otherwise leaks will occur.

7.0s

ControllersMaxHeapSizeL(TUid)

TUint ControllersMaxHeapSizeL(TUidaControllerUid)[private]

Determines the maximum heap size required by the selected controller

Parameters

TUid aControllerUid

DoCreateSessionForNoDRMCapClient(TUint, TBool, TUint)

TInt DoCreateSessionForNoDRMCapClient(TUintaMaxHeapSize,
TBoolaUseSharedHeap,
TUintaStackSize
)[private]

Create a session to handle situation of playing DRM protected content in process with no DRM capability. DRM server process will be created, if not yet created. This server is responsible to manage and monitor all the MMF Controller servers created as seperate threads belong to DRM server process. Once the new MMF Controller server is running, a MMF Controller server session will be created and the handle is passing back.

Parameters

TUint aMaxHeapSize
TBool aUseSharedHeap
TUint aStackSize

DoCreateSubThread(RServer2 *, TUint, TBool, TUint)

TInt DoCreateSubThread(RServer2 *aServer2,
TUintaMaxHeapSize,
TBoolaUseSharedHeap,
TUintaStackSize
)[private]

Creates the new thread

Parameters

RServer2 * aServer2
TUint aMaxHeapSize
TBool aUseSharedHeap
TUint aStackSize

LoadController(TUid, TBool)

IMPORT_C TIntLoadController(TUidaControllerUid,
TBoolaUseSharedHeap
)

Create a new thread and load a controller plugin into that thread.

One of the system-wide error codes.

7.0s

Parameters

TUid aControllerUidThe UID of the controller plugin to be loaded.
TBool aUseSharedHeapIf this value is EFalse each controller is created with its own heap. The alternative, if the value is ETrue, is that controllers share a special heap with other controllers created the same way. Each heap uses a chunk, so this avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then ETrue should be provided to prevent running out of heaps or chunks.

LoadController(const CMMFControllerImplementationInformation &, TBool)

IMPORT_C TIntLoadController(const CMMFControllerImplementationInformation &aControllerInfo,
TBoolaUseSharedHeap
)

Create a new thread and load a controller plugin into that thread.

One of the system-wide error codes.

7.0s

Parameters

const CMMFControllerImplementationInformation & aControllerInfoA reference to a CMMFControllerImplementationInformation object used for determining the controller UID and heap size
TBool aUseSharedHeapIf this value is EFalse each controller is created with its own heap. The alternative, if the value is ETrue, is that controllers share a special heap with other controllers created the same way. Each heap uses a chunk, so this avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then ETrue should be provided to prevent running out of heaps or chunks.

LoadController(TUid, const CMMFControllerImplementationInformation &, TBool, TBool)

TInt LoadController(TUidaControllerUid,
const CMMFControllerImplementationInformation &aControllerInfo,
TBoolaUseSharedHeap,
TBoolaNoDRMCap = EFalse
)[private]

Load a controller by UID

TInt One of the system-wide error codes.

Parameters

TUid aControllerUidThe UID of the controller plugin to be loaded.
const CMMFControllerImplementationInformation & aControllerInfoA reference to a CMMFControllerImplementationInformation object used for determining the heap size and DRM server supporting state.
TBool aUseSharedHeapIf this value is EFalse each controller is created with its own heap. The alternative, if the value is ETrue, is that controllers share a special heap with other controllers created the same way. Each heap uses a chunk, so this avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then ETrue should be provided to prevent running out of heaps or chunks.
TBool aNoDRMCap = EFalseThe indicator supplied from user used to determine whether the user's process has DRM capability

LoadControllerInSecureDRMProcess(TUid, TBool)

IMPORT_C TIntLoadControllerInSecureDRMProcess(TUidaControllerUid,
TBoolaUseSharedHeap
)

Create a new thread in another process through Secure DRM Plugin server and load a controller plugin into that thread. The motivation of this model is to allow applications without DRM capability able to play protected content through MMF.

One of the system-wide error codes.

Parameters

TUid aControllerUidThe UID of the controller plugin to be loaded.
TBool aUseSharedHeapIf this value is EFalse each controller is created with its own heap. The alternative, if the value is ETrue, is that controllers share a special heap with other controllers created the same way. Each heap uses a chunk, so this avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then ETrue should be provided to prevent running out of heaps or chunks.

LoadControllerInSecureDRMProcess(const CMMFControllerImplementationInformation &, TBool)

IMPORT_C TIntLoadControllerInSecureDRMProcess(const CMMFControllerImplementationInformation &aControllerInfo,
TBoolaUseSharedHeap
)

Create a new thread in another process through Secure DRM Plugin server and load a controller plugin into that thread. The motivation of this model is to allow applications without DRM capability able to play protected content through MMF.

One of the system-wide error codes.

Parameters

const CMMFControllerImplementationInformation & aControllerInfoA reference to a CMMFControllerImplementationInformation object used for determining the controller UID and heap size
TBool aUseSharedHeapIf this value is EFalse each controller is created with its own heap. The alternative, if the value is ETrue, is that controllers share a special heap with other controllers created the same way. Each heap uses a chunk, so this avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then ETrue should be provided to prevent running out of heaps or chunks.

ReceiveEvents(TMMFEventPckg &, TRequestStatus &)

IMPORT_C voidReceiveEvents(TMMFEventPckg &aEvent,
TRequestStatus &aStatus
)

Register to receive events from the controller framework.

Events can be generated at any time, and are generally associated with things that occur due to something happening internally within the controller. For example, an event will be generated if the controller stops playing due to reaching the end of a file.

TMMFEvent

CMMFControllerEventMonitor

7.0s

Parameters

TMMFEventPckg & aEventA reference to a TMMFEventPckg object that must be member data of the active object calling this method. The details of the event will be copied into this object when an event occurs.
TRequestStatus & aStatusThe TRequestStatus of the active object calling this method.

ReleaseHeap()

voidReleaseHeap()[private]

Release heap - for use when a shared heap has been registered

SendAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)

IMPORT_C voidSendAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom,
TRequestStatus &aStatus
)const

Send a message asynchronously to the controller thread.

The controller framework will analyze the message to determine its correct destination.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

7.0s

Parameters

const TMMFMessageDestinationPckg & aDestinationThe destination of the message, consisting of the uid of the interface of this message.
TInt aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
const TDesC8 & aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be NULL.
const TDesC8 & aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be NULL.
TDes8 & aDataFromA reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be NULL.
TRequestStatus & aStatusThe TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.

SendAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus &)

IMPORT_C voidSendAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TRequestStatus &aStatus
)const

Send a message asynchronously to the controller thread.

The controller framework will analyze the message to determine its correct destination.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

7.0s

Parameters

const TMMFMessageDestinationPckg & aDestinationThe destination of the message, consisting of the uid of the interface of this message.
TInt aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
const TDesC8 & aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be NULL.
const TDesC8 & aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be NULL.
TRequestStatus & aStatusThe TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.

SendAsync(TInt, const TIpcArgs &, TRequestStatus &)

IMPORT_C voidSendAsync(TIntaFunction,
const TIpcArgs &aIpcArgs,
TRequestStatus &aStatus
)const

Parameters

TInt aFunction
const TIpcArgs & aIpcArgs
TRequestStatus & aStatus

SendSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &)

IMPORT_C TIntSendSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom
)const

Send a message synchronously to the controller thread.

The controller framework will analyze the message to determine its correct destination.

Note: This method will not return until the controller framework has serviced the command.

The result of the request. Exact range of values is dependent on the interface.

7.0s

Parameters

const TMMFMessageDestinationPckg & aDestinationThe destination of the message, consisting of the uid of the interface of this message.
TInt aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
const TDesC8 & aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be NULL.
const TDesC8 & aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be NULL.
TDes8 & aDataFromA reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be NULL.

SendSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &)

IMPORT_C TIntSendSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2
)const

Send a message synchronously to the controller thread.

The controller framework will analyze the message to determine its correct destination.

Note: This method will not return until the controller framework has serviced the command.

The result of the request. Exact range of values is dependent on the interface.

7.0s

Parameters

const TMMFMessageDestinationPckg & aDestinationThe destination of the message, consisting of the uid of the interface of this message.
TInt aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
const TDesC8 & aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be NULL.
const TDesC8 & aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be NULL.

SendSync(TInt, const TIpcArgs &)

IMPORT_C TIntSendSync(TIntaFunction,
const TIpcArgs &aIpcArgs
)const

Parameters

TInt aFunction
const TIpcArgs & aIpcArgs

SetThreadPriority(const TThreadPriority &)

IMPORT_C TIntSetThreadPriority(const TThreadPriority &aPriority)const

Set the priority of the controller's sub thread.

This can be used to increase the responsiveness of the audio plugin to minimise any lag in processing. This function should be used with care as it may have knock-on effects elsewhere in the system.

TInt A standard error code: KErrNone if successful, KErrNotReady if the thread does not have a valid handle.

Parameters

const TThreadPriority & aPriorityThe TThreadPriority that the thread should run under. The default is EPriorityNormal.

ThreadTerminated()

voidThreadTerminated()

The controller subthread has been terminated.

This is called by CLogonMonitor when the the thread terminates

Member Enumerations Documentation

Enum anonymous

Enumerators

EFlagOpenedSharedHeap = 0x01

Shared heap has been opened for this object, and must be closed

Member Data Documentation

TMMFMessageDestinationPckg iDestinationPckg

TMMFMessageDestinationPckg iDestinationPckg[private]

Used to hold destination for messages from the controller proxy (not from clients calling SendSync/SendAsync!!)

TInt iFlags

TInt iFlags[private]

Flags field

CLogonMonitor * iLogonAO

CLogonMonitor *iLogonAO[private]

Used to determine the success of a logon. If the status is not pending, the logon has failed and the thread should be closed.

TInt iReserved1

TInt iReserved1[private]

This member is internal and not intended for use.

RThread iSubThread

RThread iSubThread[private]

The thread in which the controller plugin will run.

TThreadPriority iThreadPriority

TThreadPriority iThreadPriority[private]

The priority at which the controller plugin thread runs.