CMMFSwCodecWrapper Class Reference
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.
Inherited Functions |
---|
| CBase::CBase() |
| CBase::Delete(CBase *) |
| CBase::Extension_(TUint,TAny *&,TAny *) |
| CBase::operator new(TUint) |
| CBase::operator new(TUint,TAny *) |
| CBase::operator new(TUint,TLeave) |
| CBase::operator new(TUint,TLeave,TUint) |
| CBase::operator new(TUint,TUint) |
| CBase::~CBase() |
| CMMFHwDevice::NewL(TFileName) |
| CMMFHwDevice::NewL(TUid) |
| CMMFHwDevice::NewL(const TFourCC &,const TFourCC &) |
| CMMFHwDevice::NewL(const TFourCC &,const TFourCC &,const TDesC &) |
| CMMFHwDevice::~CMMFHwDevice() |
Constructor & Destructor Documentation
CMMFSwCodecWrapper()
IMPORT_C | CMMFSwCodecWrapper | ( | ) | [protected] |
~CMMFSwCodecWrapper()
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.
Member Functions Documentation
Codec()
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.
CustomInterface(TUid)
IMPORT_C TAny * | CustomInterface | ( | TUid | aInterfaceId | ) | [protected, virtual] |
Parameters
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. |
DeleteCodec()
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.
Init(THwDeviceInitParams &)
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.
Parameters
THwDeviceInitParams & aDevInfo | Device initialization parameters. Only the iHwDeviceObserver is used for CMFSwCodecWrapper derived CMMFHwDevices. |
Pause()
IMPORT_C TInt | Pause | ( | ) | [protected, virtual] |
Temporarily suspends the current task of decoding or encoding.
SetConfig(TTaskConfig &)
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.
SetVbrFlag()
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.
Start(TDeviceFunc, TDeviceFlow)
Starts Encoding or Decoding task(s) based on the parameter specified.
Parameters
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 |
StartConvert()
TInt
| StartConvert | ( | ) | [private] |
StartDecode()
TInt
| StartDecode | ( | ) | [private] |
StartEncode()
TInt
| StartEncode | ( | ) | [private] |
Stop()
IMPORT_C TInt | Stop | ( | ) | [protected, virtual] |
Stops the current on-going task.
StopAndDeleteCodec()
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.
ThisHwBufferEmptied(CMMFBuffer &)
IMPORT_C TInt | ThisHwBufferEmptied | ( | CMMFBuffer & | aBuffer | ) | [protected, virtual] |
Call this function to notify hardware device implementation that data in aEmptyBufferPtr from encoding is processed.
Parameters
CMMFBuffer & aBuffer | The data buffer processed by observer. |
ThisHwBufferFilled(CMMFBuffer &)
IMPORT_C TInt | ThisHwBufferFilled | ( | CMMFBuffer & | aFillBufferPtr | ) | [protected, virtual] |
Call this function to notify hardware device implementation that data is available in aFillBufferPtr for decoding.
Parameters
CMMFBuffer & aFillBufferPtr | The data buffer filled by the observer. |
Member Data Documentation
TInt
iChannels
TInt
| iChannels | [protected] |
The number of channels of the sound device
CMMFSwCodecDataPath * iDataPath
The datapath used to transfer the data
TUint
iDeviceBufferSize
TUint
| iDeviceBufferSize | [protected] |
The buffer size of the sound device
MPlayCustomInterface * iPlayCustomInterface
The play custom interface
MRecordCustomInterface * iRecordCustomInterface
The record custom interface
TInt
iSampleRate
TInt
| iSampleRate | [protected] |
The sample rate of the sound device
CMMFDataBuffer * iSinkBuffer
The sink buffer for the codec
CMMFDataBuffer * iSourceBuffer
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.