Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: mmfswcodecwrapper.h

This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.

Class CMMFSwCodec

class CMMFSwCodec : public CBase;

Description

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:

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

Derivation

Members

Defined in CMMFSwCodec:
ProcessL(), SinkBufferSize(), SourceBufferSize(), TCodecProcessResult

Inherited from CBase:
Delete(), Extension_(), operator new()


Member functions


ProcessL()

virtual TCodecProcessResult ProcessL(const CMMFBuffer &aSource, CMMFBuffer &aDest)=0;

Description

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.

Parameters

const CMMFBuffer &aSource

The source buffer containing data to encode or decode.

CMMFBuffer &aDest

The destination buffer to hold the data after encoding or decoding.

Return value

TCodecProcessResult

The result of the processing.

See also:


SourceBufferSize()

virtual TUint SourceBufferSize()=0;

Description

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.

Return value

TUint

The max size of the source buffer in bytes.


SinkBufferSize()

virtual TUint SinkBufferSize()=0;

Description

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.

Return value

TUint

The max size of the sink buffer in bytes.

[Top]


Member classes


Class TCodecProcessResult

class TCodecProcessResult;

Description

Indicates the result of processing data from the source buffer to a destination buffer and provides functions to compare the result code. The CMMFSwCodec buffer sizes should be set to return EProcessComplete The other return codes are to keep the ProcessL method compatible with the 7.0s CMMFCodec API.

Members

Defined in CMMFSwCodec::TCodecProcessResult:
EDstNotFilled, EEndOfData, EProcessComplete, EProcessError, EProcessIncomplete, TCodecProcessResult(), TCodecProcessResultStatus, iCodecProcessStatus, iDstBytesAdded, iSrcBytesProcessed, operator!=(), operator==()

Construction and destruction


TCodecProcessResult()

inline TCodecProcessResult();

Description

Default constructor.

Member functions


operator==()

inline TBool operator==(const TCodecProcessResultStatus aStatus) const;

Description

Overloaded operator to test equality.

Parameters

const TCodecProcessResultStatus aStatus

Return value

TBool


operator!=()

inline TBool operator!=(const TCodecProcessResultStatus aStatus) const;

Description

Overloaded operator to test inequality.

Parameters

const TCodecProcessResultStatus aStatus

Return value

TBool

Member enumerations


Enum TCodecProcessResultStatus

TCodecProcessResultStatus

Description

Flag to track the codec's processing status.

EProcessComplete

The codec has successfully completed its processing.

EProcessIncomplete

Could not empty the source buffer because the destination buffer became full.

EEndOfData

Codec came across an end of data.

EDstNotFilled

Could not fill the destination buffer because the source buffer has been emptied.

EProcessError

An error occured.

Member data


iCodecProcessStatus

TCodecProcessResultStatus iCodecProcessStatus;

Description

The codec's processing status

See also:


iSrcBytesProcessed

TUint iSrcBytesProcessed;

Description

The number of source bytes processed


iDstBytesAdded

TUint iDstBytesAdded;

Description

The number of bytes added to the destination buffer