class CMMFHwDevice : public CBase |
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.
Public Member Functions | |
---|---|
~CMMFHwDevice() | |
TAny * | CustomInterface(TUid) |
TInt | DeleteCodec() |
TInt | Init(THwDeviceInitParams &) |
CMMFHwDevice * | NewL(const TFourCC &, const TFourCC &) |
CMMFHwDevice * | NewL(const TFourCC &, const TFourCC &, const TDesC &) |
CMMFHwDevice * | NewL(TUid) |
CMMFHwDevice * | NewL(TFileName) |
TInt | Pause() |
TInt | SetConfig(TTaskConfig &) |
TInt | Start(TDeviceFunc, TDeviceFlow) |
TInt | Stop() |
TInt | StopAndDeleteCodec() |
TInt | ThisHwBufferEmptied(CMMFBuffer &) |
TInt | ThisHwBufferFilled(CMMFBuffer &) |
Private Member Functions | |
---|---|
void | SelectByPreference(RImplInfoPtrArray &, const TDesC &) |
Protected Attributes | |
---|---|
MMMFHwDeviceObserver * | iHwDeviceObserver |
Private Attributes | |
---|---|
TUid | iDtor_ID_Key |
~CMMFHwDevice | ( | ) | [inline, virtual] |
Destructor.
The destructor is called by ECom framework allowing derived classes to clean up the implementation specific resources.
Destructor
TAny * | CustomInterface | ( | TUid | aInterfaceId | ) | [pure virtual] |
Retrieves a custom interface to the device.
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.
TUid aInterfaceId | The interface UID, defined with the custom interface. |
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.
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.
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
THwDeviceInitParams & aDevInfo | The device initialization parameters. |
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).
An instantiated CMMFHwDevice derived object from ECom.
TUid aUid | - The Uid of a plugin implementation |
CMMFHwDevice * | NewL | ( | TFileName | aFileName | ) | [static, inline] |
Create a CMMFHwDevice object from .dll. Will leave if dll cannot be loaded (KErrNotFound).
an instantiated CMMFHwDevice derived object from a DLL.
TFileName aFileName | Implementation .dll |
TInt | Pause | ( | ) | [pure virtual] |
Temporarily suspends the current task of decoding or encoding.
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
void | SelectByPreference | ( | RImplInfoPtrArray & | aPlugInArray, |
const TDesC & | aPreferredSupplier | |||
) | [private, static] |
RImplInfoPtrArray & aPlugInArray | |
const TDesC & aPreferredSupplier |
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.
TTaskConfig & aConfig | The device configuration. |
TInt | Start | ( | TDeviceFunc | aFuncCmd, |
TDeviceFlow | aFlowCmd | |||
) | [pure virtual] |
Starts Encoding or Decoding task(s) based on the parameter specified.
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
TDeviceFunc aFuncCmd | The device function specifying the requested service i.e. decode or encode. |
TDeviceFlow aFlowCmd | The device flow directions for the requested service. |
TInt | Stop | ( | ) | [pure virtual] |
Stops the current on-going task.
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.
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.
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
CMMFBuffer & aEmptyBufferPtr | The data buffer processed by the observer. |
TInt | ThisHwBufferFilled | ( | CMMFBuffer & | aFillBufferPtr | ) | [pure virtual] |
Call this function to notify hardware device implementation that data is available in aFillBufferPtr for decoding.
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
CMMFBuffer & aFillBufferPtr | The data buffer filled by the observer. |
MMMFHwDeviceObserver * | iHwDeviceObserver | [protected] |
A pointer to the hardware device observer.