Location:
mmfswcodecwrapper.h
Link against: mmfswcodecwrapper.lib
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.
CMMFHwDevice
- No description.
CMMFSwCodecWrapper
- Class to make a
Defined in CMMFSwCodecWrapper
:
CMMFSwCodecWrapper()
, Codec()
, CustomInterface()
, DeleteCodec()
, Init()
, Pause()
, SetConfig()
, SetVbrFlag()
, Start()
, Stop()
, StopAndDeleteCodec()
, ThisHwBufferEmptied()
, ThisHwBufferFilled()
, iChannels
, iCodec
, iDataPath
, iDeviceBufferSize
, iPlayCustomInterface
, iRecordCustomInterface
, iSampleRate
, iSinkBuffer
, iSourceBuffer
, ~CMMFSwCodecWrapper()
virtual IMPORT_C ~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: virtual IMPORT_C 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: virtual IMPORT_C TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd);
Starts Encoding or Decoding task(s) based on the parameter specified.
|
|
protected: virtual IMPORT_C TInt Stop();
Stops the current on-going task.
|
protected: virtual IMPORT_C TInt Pause();
Temporarily suspends the current task of decoding or encoding.
|
protected: virtual IMPORT_C TAny *CustomInterface(TUid aInterfaceId);
Retrieves a custom interface to the device. The reference CMMFSwCodecWrapper supports two standard custom interfaces, MPlayCustomInterface
and MRecordCustomInterface
.
|
|
protected: virtual IMPORT_C TInt ThisHwBufferFilled(CMMFBuffer &aFillBufferPtr);
Call this function to notify hardware device implementation that data is available in aFillBufferPtr for decoding.
|
|
protected: virtual IMPORT_C TInt ThisHwBufferEmptied(CMMFBuffer &aBuffer);
Call this function to notify hardware device implementation that data in aEmptyBufferPtr from encoding is processed.
|
|
protected: virtual IMPORT_C 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: virtual IMPORT_C TInt StopAndDeleteCodec();
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.
|
protected: virtual IMPORT_C 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