|
||
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 CMMFSwCodecWrapper::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.
CMMFHwDevice
- No description.
CMMFSwCodecWrapper
-
Class to make a CMMFSwCodec into a CMMFHwDevice ECOM plugin.
Defined in CMMFSwCodecWrapper
:
CMMFSwCodecWrapper()
Constructor. Codec()
This method must return the CMMFSwCodec used by the derived CMMFSwCodecWrapper c...CustomInterface(TUid)
Retrieves a custom interface to the device. The reference CMMFSwCodecWrapper sup...DeleteCodec()
Deletes the codec This default implementation does nothing but real hardware dev...Init(THwDeviceInitParams &)
Initializes the hardware device tasks - in the case of a sw codec wrapper 'hardw...Pause()
Temporarily suspends the current task of decoding or encoding.SetConfig(TTaskConfig &)
Used to configure the sample rate and stereo mode of a CMMFHwDevice plugin.SetVbrFlag()
Used to set iVbrFlag on the datapath.Start(TDeviceFunc,TDeviceFlow)
Starts Encoding or Decoding task(s) based on the parameter specified.Stop()
Stops the current on-going task.StopAndDeleteCodec()
Stops and deletes the codec.ThisHwBufferEmptied(CMMFBuffer &)
Call this function to notify hardware device implementation that data in aEmptyB...ThisHwBufferFilled(CMMFBuffer &)
Call this function to notify hardware device implementation that data is availab...iChannels
The number of channels of the sound deviceiCodec
The software codec usediDataPath
The datapath used to transfer the dataiDeviceBufferSize
The buffer size of the sound deviceiPlayCustomInterface
The play custom interfaceiRecordCustomInterface
The record custom interfaceiSampleRate
The sample rate of the sound deviceiSinkBuffer
The sink buffer for the codeciSourceBuffer
The source buffer for the codec~CMMFSwCodecWrapper()
Destructor.IMPORT_C virtual ~CMMFSwCodecWrapper();
Destructor.
The destructor is called by ECom framework allowing derived classes to clean up implementation specific resources. The sound device drivers are freed.
protected: IMPORT_C virtual TInt Init(THwDeviceInitParams &aDevInfo);
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
.
|
|
protected: IMPORT_C virtual TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd);
Starts Encoding or Decoding task(s) based on the parameter specified.
|
|
protected: IMPORT_C virtual TInt Stop();
Stops the current on-going task.
|
protected: IMPORT_C virtual TInt Pause();
Temporarily suspends the current task of decoding or encoding.
|
protected: IMPORT_C virtual TAny* CustomInterface(TUid aInterfaceId);
Retrieves a custom interface to the device. The reference CMMFSwCodecWrapper supports two standard custom interfaces, MPlayCustomInterface
and MRecordCustomInterface
.
|
|
protected: IMPORT_C virtual TInt ThisHwBufferFilled(CMMFBuffer &aFillBufferPtr);
Call this function to notify hardware device implementation that data is available in aFillBufferPtr for decoding.
|
|
protected: IMPORT_C virtual TInt ThisHwBufferEmptied(CMMFBuffer &aBuffer);
Call this function to notify hardware device implementation that data in aEmptyBufferPtr from encoding is processed.
|
|
protected: IMPORT_C virtual TInt SetConfig(TTaskConfig &aConfig);
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.
|
|
protected: IMPORT_C virtual TInt StopAndDeleteCodec();
Stops and deletes the codec.
This default implementation simply calls CMMFSwCodecWrapper::DeleteCodec()
and then CMMFSwCodecWrapper::Stop()
but real hardware devices might use this method to free up resources.
|
protected: IMPORT_C virtual TInt DeleteCodec();
Deletes the codec This default implementation does nothing but real hardware devices might use this method to free up resources.
|
protected: virtual CMMFSwCodec& Codec()=0;
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.
|
protected: IMPORT_C void SetVbrFlag();
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.
protected: TInt iChannels;
The number of channels of the sound device