RMMFControllerProxy Class Reference

#include "mmfcontrollerframework.h"

Link against: mmfcontrollerframework.lib

class RMMFControllerProxy : public RMmfSessionBase

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()
Inherited Attributes
RHandleBase::iHandle
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
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()

Detailed Description

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.

Since
7.0s

Constructor & Destructor Documentation

RMMFControllerProxy ( )

IMPORT_CRMMFControllerProxy()
Constructor.
Since
7.0s

Member Function 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.

See also: TMMFEvent

Since
7.0s

Returns: One of the standard system-wide error codes.

Close ( )

IMPORT_C voidClose()

Reimplemented from RHandleBase::Close()

Delete the controller plugin and close its thread.

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

Since
7.0s

LoadController ( TUid, TBool )

IMPORT_C TIntLoadController(TUidaControllerUid,
TBoolaUseSharedHeap
)

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

Since
7.0s
ParameterDescription
aControllerUidThe UID of the controller plugin to be loaded.
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.

Returns: One of the system-wide error codes.

LoadController ( const CMMFControllerImplementationInformation &, TBool )

IMPORT_C TIntLoadController(const CMMFControllerImplementationInformation &aControllerInfo,
TBoolaUseSharedHeap
)

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

Since
7.0s
ParameterDescription
aControllerInfoA reference to a CMMFControllerImplementationInformation object used for determining the controller UID and heap size
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.

Returns: One of the system-wide error codes.

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.

ParameterDescription
aControllerUidThe UID of the controller plugin to be loaded.
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.

Returns: One of the system-wide error codes.

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.

ParameterDescription
aControllerInfoA reference to a CMMFControllerImplementationInformation object used for determining the controller UID and heap size
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.

Returns: One of the system-wide error codes.

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.

See also: TMMFEvent CMMFControllerEventMonitor

Since
7.0s
ParameterDescription
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.
aStatusThe TRequestStatus of the active object calling this method.

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.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
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.
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.
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.
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.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
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.
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.
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

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.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
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.
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.
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.

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

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.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
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.
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.

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

SendSync ( TInt, const TIpcArgs & )

IMPORT_C TIntSendSync(TIntaFunction,
const TIpcArgs &aIpcArgs
)const

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.

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

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

ThreadTerminated ( )

voidThreadTerminated()

The controller subthread has been terminated.

This is called by CLogonMonitor when the the thread terminates