CMMFSwCodec Class Reference

class CMMFSwCodec : public CBase

Class for a software codec used by the CMMFSwCodecWrapper class to make the CMMFSwCodec a CMMFHwDevice plugin. The CMMFSwCodec processes source data in a certain fourCC coding type and converts it to a destination buffer of another fourCC coding type.

A CMMFSwCodec object would usually not be instantiated directly but instead would be instantiated via the CMMFSwCodecWrapper class's Codec() method.

The processing of the data is handled by the codecs ProcessL() member. The intention is that the source buffer for conversion is converted to the appropriate coding type in the destination buffer. The size of the buffers passed in are determined by SourceBufferSize() and SinkBufferSize() methods. The buffer sizes should be chosen such that the ProcessL() method can be guaranteed to have enough destination buffer to completely process one source buffer.

The ProcessL should return a TCodecProcessResult returning the number of source bytes processed and the number of destination bytes processed along with a process result code defined thus:
  • EProcessComplete: the codec processed all the source data into the sink buffer

  • EProcessIncomplete: the codec filled sink buffer before all the source buffer was processed

  • EDstNotFilled: the codec processed the source buffer but the sink buffer was not filled

  • EEndOfData: the codec detected the end data - all source data in processed but sink may not be full

  • EProcessError: the codec process error condition

Unlike the 7.0s CMMFCodec::ProcessL method, the CMMFSwCodec::ProcessL method should not return EProcessIncomplete as this case is not handled by the CMMFSwCodecWrapper.

Inherits from

Nested Classes and Structures

Member Functions Documentation

IsNullCodec()

TBool IsNullCodec()[inline, virtual]

Function that needs to be overriden if the codec is a 'Null' codec ie. it does not perform any data type transformation. The 'Null' codec should override this to return ETrue and provide a dummy ProcessL. The CMMFSwCodecWrapper will then use the same buffer for both the source and the sink. Null codecs should return the same buffer size for both the Source and SinkBufferSize methods. Since most CMMFSwCodec implementations will not be null codecs this method can be ignored.

Would not normally expect 3rd parties to have to implement this.

ProcessL(const CMMFBuffer &, CMMFBuffer &)

TCodecProcessResult ProcessL(const CMMFBuffer &aSource,
CMMFBuffer &aDest
)[pure virtual]

Processes the data in the specified source buffer and writes the processed data to the specified destination buffer.

This function is synchronous, when the function returns the data has been processed. This is a virtual function that each derived class must implement.

TCodecProcessResult

Parameters

const CMMFBuffer & aSourceThe source buffer containing data to encode or decode.
CMMFBuffer & aDestThe destination buffer to hold the data after encoding or decoding.

SinkBufferSize()

TUint SinkBufferSize()[pure virtual]

Gets the max size of the sink (destination) buffer passed into the CMMFSwCodec::ProcessL method.

Note that this means that this is the Max size of each buffer passed to the codec. The actual size of the data written to this buffer could be less than the max size. This is a virtual function that each derived class must implement.

SourceBufferSize()

TUint SourceBufferSize()[pure virtual]

Gets the max size of the source buffer passed into the CMMFSwCodec::ProcessL function.

Note that this means that this is the Max size of each buffer passed to the codec. The actual size of the data could be less than the max size. This is a virtual function that each derived class must implement.