#include <mmf/server/mmfhwdevice.h>
class CMMFHwDevice : public CBase |
Protected Attributes | |
---|---|
MMMFHwDeviceObserver * | iHwDeviceObserver |
Public Member Functions | |
---|---|
virtual | ~CMMFHwDevice() |
pure virtual TAny * | CustomInterface(TUid) |
pure virtual TInt | DeleteCodec() |
pure virtual TInt | Init(THwDeviceInitParams &) |
CMMFHwDevice * | NewL(const TFourCC &, const TFourCC &) |
CMMFHwDevice * | NewL(const TFourCC &, const TFourCC &, const TDesC &) |
CMMFHwDevice * | NewL(TUid) |
CMMFHwDevice * | NewL(TFileName) |
pure virtual TInt | Pause() |
pure virtual TInt | SetConfig(TTaskConfig &) |
pure virtual TInt | Start(TDeviceFunc, TDeviceFlow) |
pure virtual TInt | Stop() |
pure virtual TInt | StopAndDeleteCodec() |
pure virtual TInt | ThisHwBufferEmptied(CMMFBuffer &) |
pure virtual TInt | ThisHwBufferFilled(CMMFBuffer &) |
ECom plugin class for a hardware device that decodes (plays) source data in a certain FourCC coding type to another FourCC coding type or encodes (records) data from a certain FourCC coding type to a another FourCC coding type.
The hardware device can be instantiated in 3 different ways:
1. NewL(const TFourCC& aSrcDatatype, const TFourCC& aDstDataType)
This instantiate a hardware device that can encode or decode the aSrcDatatype to a aDstDataType.
2. NewL(const TFourCC& aSrcDatatype, const TFourCC& aDstDataType, const TDesC& aPreferredSupplier)
This is similar to the above but is used where there may be multiple hardware devices that perform the same conversion. Third party developers may use their own hardware device implementations and can ensure the controller uses their implementation by setting the preferred supplier to themselves.
This is used to explicitly instantiate a hardware device where the UID is known.
This is used to create an instance of a HwDevice implementation by loading the library
CMMFHwDevice provides a generic interface that every Hardware Device that decodes and/or encodes has to implement. Based on parameters specified in Start, the device implementation will start decoding or encoding. The source and destination of the decoding/encoding operations should be set up before starting the task by sending THwDeviceInitParams to the Init() function.
MMMFHwDeviceObserver * | iHwDeviceObserver | [protected] |
A pointer to the hardware device observer.
~CMMFHwDevice | ( | ) | [inline, virtual] |
Destructor.
The destructor is called by ECom framework allowing derived classes to clean up the implementation specific resources.
Destructor
Retrieves a custom interface to the device.
Parameter | Description |
---|---|
aInterfaceId | The interface UID, defined with the custom interface. |
Returns: A pointer to the interface implementation, or NULL if the device does not implement the interface requested. The return value must be cast to the correct type by the user.
TInt | DeleteCodec | ( | ) | [pure virtual] |
Call this function to delete a codec.
This is used to allow resources to be freed when using a DSP or similar hardware.
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
TInt | Init | ( | THwDeviceInitParams & | aDevInfo | ) | [pure virtual] |
Initializes the hardware device tasks.
Parameter | Description |
---|---|
aDevInfo | The device initialization parameters. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
CMMFHwDevice * | NewL | ( | const TFourCC & | aSrcDatatype, |
const TFourCC & | aDstDataType | |||
) | [static] |
CMMFHwDevice * | NewL | ( | const TFourCC & | aSrcDatatype, |
const TFourCC & | aDstDataType, | |||
const TDesC & | aPreferredSupplier | |||
) | [static] |
CMMFHwDevice * | NewL | ( | TUid | aUid | ) | [static, inline] |
Create a CMMFHwDevice object with a known implementation Uid. Will leave if it is not found (KErrNotFound).
Parameter | Description |
---|---|
aUid | - The Uid of a plugin implementation |
Returns: An instantiated CMMFHwDevice derived object from ECom.
CMMFHwDevice * | NewL | ( | TFileName | aFileName | ) | [static, inline] |
Create a CMMFHwDevice object from .dll. Will leave if dll cannot be loaded (KErrNotFound).
Parameter | Description |
---|---|
aFileName | Implementation .dll |
Returns: an instantiated CMMFHwDevice derived object from a DLL.
TInt | Pause | ( | ) | [pure virtual] |
Temporarily suspends the current task of decoding or encoding.
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
TInt | SetConfig | ( | TTaskConfig & | aConfig | ) | [pure virtual] |
Used to configure the sample rate and stereo mode of a CMMFHwDevice plugin.
The configuration of HwDevices is device specific and is not used in any of the reference devices that return KErrNotSupported.
Parameter | Description |
---|---|
aConfig | The device configuration. |
TInt | Start | ( | TDeviceFunc | aFuncCmd, |
TDeviceFlow | aFlowCmd | |||
) | [pure virtual] |
Starts Encoding or Decoding task(s) based on the parameter specified.
Parameter | Description |
---|---|
aFuncCmd | The device function specifying the requested service i.e. decode or encode. |
aFlowCmd | The device flow directions for the requested service. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
TInt | Stop | ( | ) | [pure virtual] |
Stops the current on-going task.
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
TInt | StopAndDeleteCodec | ( | ) | [pure virtual] |
Call this function to stop and then delete a codec. This is used to allow resources to be freed when using a DSP or similar hardware.
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
TInt | ThisHwBufferEmptied | ( | CMMFBuffer & | aEmptyBufferPtr | ) | [pure virtual] |
Call this function to notify hardware device implementation that data in aEmptyBufferPtr from encoding is processed.
Parameter | Description |
---|---|
aEmptyBufferPtr | The data buffer processed by the observer. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
TInt | ThisHwBufferFilled | ( | CMMFBuffer & | aFillBufferPtr | ) | [pure virtual] |
Call this function to notify hardware device implementation that data is available in aFillBufferPtr for decoding.
Parameter | Description |
---|---|
aFillBufferPtr | The data buffer filled by the observer. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.