CMMFHwDevice Class Reference

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.

3. NewL(TUid aUid)

This is used to explicitly instantiate a hardware device where the UID is known.

4. NewL(TFileName aFileName)

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.

Inherits from

Constructor & Destructor Documentation

~CMMFHwDevice()

~CMMFHwDevice()[inline, virtual]

Destructor.

The destructor is called by ECom framework allowing derived classes to clean up the implementation specific resources.

Destructor

Member Functions Documentation

CustomInterface(TUid)

TAny *CustomInterface(TUidaInterfaceId)[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.

Parameters

TUid aInterfaceIdThe interface UID, defined with the custom interface.

DeleteCodec()

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.

Init(THwDeviceInitParams &)

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.

Parameters

THwDeviceInitParams & aDevInfoThe device initialization parameters.

NewL(const TFourCC &, const TFourCC &)

CMMFHwDevice *NewL(const TFourCC &aSrcDatatype,
const TFourCC &aDstDataType
)[static]

Parameters

const TFourCC & aSrcDatatype
const TFourCC & aDstDataType

NewL(const TFourCC &, const TFourCC &, const TDesC &)

CMMFHwDevice *NewL(const TFourCC &aSrcDatatype,
const TFourCC &aDstDataType,
const TDesC &aPreferredSupplier
)[static]

Parameters

const TFourCC & aSrcDatatype
const TFourCC & aDstDataType
const TDesC & aPreferredSupplier

NewL(TUid)

CMMFHwDevice *NewL(TUidaUid)[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.

Parameters

TUid aUid- The Uid of a plugin implementation

NewL(TFileName)

CMMFHwDevice *NewL(TFileNameaFileName)[static, inline]

Create a CMMFHwDevice object from .dll. Will leave if dll cannot be loaded (KErrNotFound).

an instantiated CMMFHwDevice derived object from a DLL.

Parameters

TFileName aFileNameImplementation .dll

Pause()

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.

SelectByPreference(RImplInfoPtrArray &, const TDesC &)

voidSelectByPreference(RImplInfoPtrArray &aPlugInArray,
const TDesC &aPreferredSupplier
)[private, static]

Parameters

RImplInfoPtrArray & aPlugInArray
const TDesC & aPreferredSupplier

SetConfig(TTaskConfig &)

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.

Parameters

TTaskConfig & aConfigThe device configuration.

Start(TDeviceFunc, TDeviceFlow)

TInt Start(TDeviceFuncaFuncCmd,
TDeviceFlowaFlowCmd
)[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.

Parameters

TDeviceFunc aFuncCmdThe device function specifying the requested service i.e. decode or encode.
TDeviceFlow aFlowCmdThe device flow directions for the requested service.

Stop()

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.

StopAndDeleteCodec()

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.

ThisHwBufferEmptied(CMMFBuffer &)

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.

Parameters

CMMFBuffer & aEmptyBufferPtrThe data buffer processed by the observer.

ThisHwBufferFilled(CMMFBuffer &)

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.

Parameters

CMMFBuffer & aFillBufferPtrThe data buffer filled by the observer.

Member Data Documentation

TUid iDtor_ID_Key

TUid iDtor_ID_Key[private]

MMMFHwDeviceObserver * iHwDeviceObserver

MMMFHwDeviceObserver *iHwDeviceObserver[protected]

A pointer to the hardware device observer.