CMMFHwDevice Class Reference

#include <mmf/server/mmfhwdevice.h>

Link against: tsu_mdf_omxvorbiscodecs.lib

class CMMFHwDevice : public CBase

Inherits from

  • CMMFHwDevice

    Detailed Description

    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.

    Member Attribute Documentation

    iHwDeviceObserver

    MMMFHwDeviceObserver *iHwDeviceObserver[protected]

    A pointer to the hardware device observer.

    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 Function Documentation

    CustomInterface ( TUid )

    TAny *CustomInterface(TUidaInterfaceId)[pure virtual]

    Retrieves a custom interface to the device.

    ParameterDescription
    aInterfaceIdThe 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.

    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.

    Returns: 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.

    ParameterDescription
    aDevInfoThe 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.

    NewL ( const TFourCC &, const TFourCC & )

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

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

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

    NewL ( TUid )

    CMMFHwDevice *NewL(TUidaUid)[static, inline]

    Create a CMMFHwDevice object with a known implementation Uid. Will leave if it is not found (KErrNotFound).

    ParameterDescription
    aUid- The Uid of a plugin implementation

    Returns: An instantiated CMMFHwDevice derived object from ECom.

    NewL ( TFileName )

    CMMFHwDevice *NewL(TFileNameaFileName)[static, inline]

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

    ParameterDescription
    aFileNameImplementation .dll

    Returns: an instantiated CMMFHwDevice derived object from a DLL.

    Pause ( )

    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.

    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.

    ParameterDescription
    aConfigThe device configuration.

    Start ( TDeviceFunc, TDeviceFlow )

    TInt Start(TDeviceFuncaFuncCmd,
    TDeviceFlowaFlowCmd
    )[pure virtual]

    Starts Encoding or Decoding task(s) based on the parameter specified.

    ParameterDescription
    aFuncCmdThe device function specifying the requested service i.e. decode or encode.
    aFlowCmdThe 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.

    Stop ( )

    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.

    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.

    Returns: 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.

    ParameterDescription
    aEmptyBufferPtrThe 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.

    ThisHwBufferFilled ( CMMFBuffer & )

    TInt ThisHwBufferFilled(CMMFBuffer &aFillBufferPtr)[pure virtual]

    Call this function to notify hardware device implementation that data is available in aFillBufferPtr for decoding.

    ParameterDescription
    aFillBufferPtrThe 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.