class CMMFSwCodecWrapper : public CMMFHwDevice |
Class to make a CMMFSwCodec into a CMMFHwDevice ECOM plugin.
Most of the code to make a CMMFSwCodec into a CMMFHwDevice ECOM plugin is provided in CMMFSwCodecWrapper . Someone writing a plugin derrived from CMMFSwCodecWrapper only needs to provide the standard ECOM implementation code, constructors and destructors and implement the Codec() function which should return the appropriate CMMFSwCodec .
Third parties using CMMFSwCodecWrapper that do not use the RMdaDevSound API to talk to the sound drivers would need to port the datapaths for their own sound drivers. Third parties would also need to change the custom interfaces where necessary.
Public Member Functions | |
---|---|
~CMMFSwCodecWrapper () |
Protected Member Functions | |
---|---|
CMMFSwCodecWrapper () | |
CMMFSwCodec & | Codec () |
IMPORT_C TAny * | CustomInterface ( TUid ) |
IMPORT_C TInt | DeleteCodec () |
IMPORT_C TInt | Init ( THwDeviceInitParams &) |
IMPORT_C TInt | Pause () |
IMPORT_C TInt | SetConfig ( TTaskConfig &) |
IMPORT_C void | SetVbrFlag () |
IMPORT_C TInt | Start ( TDeviceFunc , TDeviceFlow ) |
IMPORT_C TInt | Stop () |
IMPORT_C TInt | StopAndDeleteCodec () |
IMPORT_C TInt | ThisHwBufferEmptied ( CMMFBuffer &) |
IMPORT_C TInt | ThisHwBufferFilled ( CMMFBuffer &) |
Private Member Functions | |
---|---|
TInt | StartConvert () |
TInt | StartDecode () |
TInt | StartEncode () |
Inherited Attributes | |
---|---|
CMMFHwDevice::iHwDeviceObserver |
IMPORT_C | ~CMMFSwCodecWrapper | ( | ) | [virtual] |
Destructor.
The destructor is called by ECom framework allowing derived classes to clean up implementation specific resources. The sound device drivers are freed.
CMMFSwCodec & | Codec | ( | ) | [protected, pure virtual] |
This method must return the CMMFSwCodec used by the derived CMMFSwCodecWrapper class. The method should create the CMMFSwCodec if it hasn't done so already.
This is a virtual function that each derived class must implement.
IMPORT_C TAny * | CustomInterface | ( | TUid | aInterfaceId | ) | [protected, virtual] |
Retrieves a custom interface to the device. The reference CMMFSwCodecWrapper supports two standard custom interfaces, MPlayCustomInterface and MRecordCustomInterface .
TUid aInterfaceId | Interface UID, defined with the custom interface. aInterface = KMmfPlaySettingsCustomInterface for MPlayCustomInterface, aInterface = KMmfRecordSettingsCustomInterface for MRecordCustomInterface. aInterface = KMmfUidEmptyBuffersCustomInterface for MEmptyBuffersCustomInterface Actual device implementations of CMMFSwCodecWrapper may do this differently however. |
IMPORT_C TInt | DeleteCodec | ( | ) | [protected, virtual] |
Deletes the codec This default implementation does nothing but real hardware devices might use this method to free up resources.
IMPORT_C TInt | Init | ( | THwDeviceInitParams & | aDevInfo | ) | [protected, virtual] |
Initializes the hardware device tasks - in the case of a sw codec wrapper 'hardware device' this consits of loading the sound device drivers and creating the CMMFSwCodec .
THwDeviceInitParams & aDevInfo | Device initialization parameters. Only the iHwDeviceObserver is used for CMFSwCodecWrapper derived CMMFHwDevices. |
IMPORT_C TInt | Pause | ( | ) | [protected, virtual] |
Temporarily suspends the current task of decoding or encoding.
IMPORT_C TInt | SetConfig | ( | TTaskConfig & | aConfig | ) | [protected, 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. |
IMPORT_C void | SetVbrFlag | ( | ) | [protected] |
Used to set iVbrFlag on the datapath.
This method is used to set the iVbrFlag in datapath. This flag is added to datapath to avail the alternative dataflow wherein datapath makes sure that destinationbuffer is filled to its maximum length before sending it to the sound driver. Sending the buffer directly to the device causes underflow incase of VBR codecs.
IMPORT_C TInt | Start | ( | TDeviceFunc | aFuncCmd, |
TDeviceFlow | aFlowCmd | |||
) | [protected, virtual] |
Starts Encoding or Decoding task(s) based on the parameter specified.
TDeviceFunc aFuncCmd | The device function specifying the requested service i.e. decode or encode where EDevEncode = Record, EDevDecode = Play and EDevNullFunc = Convert. |
TDeviceFlow aFlowCmd | The device flow directions for requested service. This parameter is ignored for CMMFSwCodecWrapper CMMFHwDevicePlugins |
IMPORT_C TInt | StopAndDeleteCodec | ( | ) | [protected, virtual] |
Stops and deletes the codec.
This default implementation simply calls DeleteCodec() and then Stop() but real hardware devices might use this method to free up resources.
IMPORT_C TInt | ThisHwBufferEmptied | ( | CMMFBuffer & | aBuffer | ) | [protected, virtual] |
Call this function to notify hardware device implementation that data in aEmptyBufferPtr from encoding is processed.
CMMFBuffer & aBuffer | The data buffer processed by observer. |
IMPORT_C TInt | ThisHwBufferFilled | ( | CMMFBuffer & | aFillBufferPtr | ) | [protected, virtual] |
Call this function to notify hardware device implementation that data is available in aFillBufferPtr for decoding.
CMMFBuffer & aFillBufferPtr | The data buffer filled by the observer. |
CMMFSwCodecDataPath * | iDataPath | [protected] |
The datapath used to transfer the data
MPlayCustomInterface * | iPlayCustomInterface | [protected] |
The play custom interface
MRecordCustomInterface * | iRecordCustomInterface | [protected] |
The record custom interface
CMMFDataBuffer * | iSourceBuffer | [protected] |
The source buffer for the codec
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.