#include "mmfcontrollerframework.h"
class RMMFControllerProxy : public RMmfSessionBase |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
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.
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.
See also: TMMFEvent
Returns: One of the standard system-wide error codes.
IMPORT_C void | Close | ( | ) |
Reimplemented from RHandleBase::Close()
Delete the controller plugin and close its thread.
Clients must call Close() on the controller proxy, otherwise leaks will occur.
Create a new thread and load a controller plugin into that thread.
Parameter | Description |
---|---|
aControllerUid | The UID of the controller plugin to be loaded. |
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. |
Returns: One of the system-wide error codes.
IMPORT_C TInt | LoadController | ( | const CMMFControllerImplementationInformation & | aControllerInfo, |
TBool | aUseSharedHeap | |||
) |
Create a new thread and load a controller plugin into that thread.
Parameter | Description |
---|---|
aControllerInfo | A reference to a CMMFControllerImplementationInformation object used for determining the controller UID and heap size |
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. |
Returns: One of the system-wide error codes.
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.
Parameter | Description |
---|---|
aControllerUid | The UID of the controller plugin to be loaded. |
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. |
Returns: One of the system-wide error codes.
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.
Parameter | Description |
---|---|
aControllerInfo | A reference to a CMMFControllerImplementationInformation object used for determining the controller UID and heap size |
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. |
Returns: One of the system-wide error codes.
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.
See also: TMMFEvent CMMFControllerEventMonitor
Parameter | Description |
---|---|
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. |
aStatus | The TRequestStatus of the active object calling this method. |
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.
Parameter | Description |
---|---|
aDestination | The destination of the message, consisting of the uid of the interface of this message. |
aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
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. |
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. |
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. |
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.
Parameter | Description |
---|---|
aDestination | The destination of the message, consisting of the uid of the interface of this message. |
aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
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. |
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. |
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 |
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.
Parameter | Description |
---|---|
aDestination | The destination of the message, consisting of the uid of the interface of this message. |
aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
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. |
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. |
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. |
Returns: The result of the request. Exact range of values is dependent on the interface.
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.
Parameter | Description |
---|---|
aDestination | The destination of the message, consisting of the uid of the interface of this message. |
aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
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. |
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. |
Returns: The result of the request. Exact range of values is dependent on the interface.
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.
Parameter | Description |
---|---|
aPriority | The 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.
void | ThreadTerminated | ( | ) |
The controller subthread has been terminated.
This is called by CLogonMonitor when the the thread terminates