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
Private Member Functions | |
---|---|
TUint | ControllersMaxHeapSizeL(TUid) |
TInt | DoCreateSessionForNoDRMCapClient(TUint, TBool, TUint) |
TInt | DoCreateSubThread(RServer2 *, TUint, TBool, TUint) |
TInt | LoadController(TUid, const CMMFControllerImplementationInformation &, TBool, TBool) |
void | ReleaseHeap() |
Private Member Enumerations | |
---|---|
enum | anonymous { 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 |
IMPORT_C TInt | CancelReceiveEvents | ( | ) |
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.
7.0s
IMPORT_C void | Close | ( | ) |
Delete the controller plugin and close its thread.
Clients must call Close() on the controller proxy, otherwise leaks will occur.
7.0s
TUint | ControllersMaxHeapSizeL | ( | TUid | aControllerUid | ) | [private] |
Determines the maximum heap size required by the selected controller
TUid aControllerUid |
TInt | DoCreateSessionForNoDRMCapClient | ( | TUint | aMaxHeapSize, |
TBool | aUseSharedHeap, | |||
TUint | aStackSize | |||
) | [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.
TInt | DoCreateSubThread | ( | RServer2 * | aServer2, |
TUint | aMaxHeapSize, | |||
TBool | aUseSharedHeap, | |||
TUint | aStackSize | |||
) | [private] |
Creates the new thread
IMPORT_C TInt | LoadController | ( | TUid | aControllerUid, |
TBool | aUseSharedHeap | |||
) |
Create a new thread and load a controller plugin into that thread.
One of the system-wide error codes.
7.0s
TUid aControllerUid | The UID of the controller plugin to be loaded. |
TBool aUseSharedHeap | If 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. |
IMPORT_C TInt | LoadController | ( | const CMMFControllerImplementationInformation & | aControllerInfo, |
TBool | aUseSharedHeap | |||
) |
Create a new thread and load a controller plugin into that thread.
One of the system-wide error codes.
7.0s
const CMMFControllerImplementationInformation & aControllerInfo | A reference to a CMMFControllerImplementationInformation object used for determining the controller UID and heap size |
TBool aUseSharedHeap | If 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. |
TInt | LoadController | ( | TUid | aControllerUid, |
const CMMFControllerImplementationInformation & | aControllerInfo, | |||
TBool | aUseSharedHeap, | |||
TBool | aNoDRMCap = EFalse | |||
) | [private] |
Load a controller by UID
TInt One of the system-wide error codes.
TUid aControllerUid | The UID of the controller plugin to be loaded. |
const CMMFControllerImplementationInformation & aControllerInfo | A reference to a CMMFControllerImplementationInformation object used for determining the heap size and DRM server supporting state. |
TBool aUseSharedHeap | If 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 = EFalse | The indicator supplied from user used to determine whether the user's process has DRM capability |
IMPORT_C TInt | LoadControllerInSecureDRMProcess | ( | TUid | aControllerUid, |
TBool | aUseSharedHeap | |||
) |
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.
TUid aControllerUid | The UID of the controller plugin to be loaded. |
TBool aUseSharedHeap | If 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. |
IMPORT_C TInt | LoadControllerInSecureDRMProcess | ( | const CMMFControllerImplementationInformation & | aControllerInfo, |
TBool | aUseSharedHeap | |||
) |
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.
const CMMFControllerImplementationInformation & aControllerInfo | A reference to a CMMFControllerImplementationInformation object used for determining the controller UID and heap size |
TBool aUseSharedHeap | If 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. |
IMPORT_C void | ReceiveEvents | ( | 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.
7.0s
TMMFEventPckg & aEvent | A 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 & aStatus | The TRequestStatus of the active object calling this method. |
void | ReleaseHeap | ( | ) | [private] |
Release heap - for use when a shared heap has been registered
IMPORT_C void | SendAsync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
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
const TMMFMessageDestinationPckg & aDestination | The destination of the message, consisting of the uid of the interface of this message. |
TInt aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
const TDesC8 & aDataTo1 | A 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 & aDataTo2 | A 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 & aDataFrom | A 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 & aStatus | The 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. |
IMPORT_C void | SendAsync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
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
const TMMFMessageDestinationPckg & aDestination | The destination of the message, consisting of the uid of the interface of this message. |
TInt aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
const TDesC8 & aDataTo1 | A 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 & aDataTo2 | A 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 & aStatus | The 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. |
IMPORT_C void | SendAsync | ( | TInt | aFunction, |
const TIpcArgs & | aIpcArgs, | |||
TRequestStatus & | aStatus | |||
) | const |
TInt aFunction | |
const TIpcArgs & aIpcArgs | |
TRequestStatus & aStatus |
IMPORT_C TInt | SendSync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
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
const TMMFMessageDestinationPckg & aDestination | The destination of the message, consisting of the uid of the interface of this message. |
TInt aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
const TDesC8 & aDataTo1 | A 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 & aDataTo2 | A 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 & aDataFrom | A 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. |
IMPORT_C TInt | SendSync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
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
const TMMFMessageDestinationPckg & aDestination | The destination of the message, consisting of the uid of the interface of this message. |
TInt aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
const TDesC8 & aDataTo1 | A 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 & aDataTo2 | A 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. |
IMPORT_C TInt | SendSync | ( | TInt | aFunction, |
const TIpcArgs & | aIpcArgs | |||
) | const |
IMPORT_C TInt | SetThreadPriority | ( | 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.
const TThreadPriority & aPriority | The TThreadPriority that the thread should run under. The default is EPriorityNormal. |
void | ThreadTerminated | ( | ) |
The controller subthread has been terminated.
This is called by CLogonMonitor when the the thread terminates
EFlagOpenedSharedHeap = 0x01 |
Shared heap has been opened for this object, and must be closed |
TMMFMessageDestinationPckg | iDestinationPckg | [private] |
Used to hold destination for messages from the controller proxy (not from clients calling SendSync/SendAsync!!)
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.
TThreadPriority | iThreadPriority | [private] |
The priority at which the controller plugin thread runs.