Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <mmfSwCodecWrapper.h>
This item is not part of the S60 5th Edition SDK

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 CMMFSwCodec::ProcessL(const CMMFBuffer &,CMMFBuffer &) 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 CMMFSwCodec::SourceBufferSize() and CMMFSwCodec::SinkBufferSize() methods. The buffer sizes should be chosen such that the CMMFSwCodec::ProcessL(const CMMFBuffer &,CMMFBuffer &) method can be guaranteed to have enough destination buffer to completely process one source buffer.

The ProcessL should return a CMMFSwCodec::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(const CMMFBuffer &,CMMFBuffer &) method, the CMMFSwCodec::ProcessL(const CMMFBuffer &,CMMFBuffer &) method should not return EProcessIncomplete as this case is not handled by the CMMFSwCodecWrapper.

Derivation

Members

Defined in CMMFSwCodec:

Inherited from CBase:


Member functions


ProcessL(const CMMFBuffer &,CMMFBuffer &)

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

CMMFSwCodec::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(const CMMFBuffer &,CMMFBuffer &) 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(const CMMFBuffer &,CMMFBuffer &) 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:

Construction and destruction


TCodecProcessResult()

inline TCodecProcessResult();

Description

Default constructor.

Member functions


operator==(const TCodecProcessResultStatus)const

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

Description

Overloaded operator to test equality.

Parameters

const CMMFSwCodec::TCodecProcessResult::TCodecProcessResultStatus aStatus

Return value

TBool


operator!=(const TCodecProcessResultStatus)const

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

Description

Overloaded operator to test inequality.

Parameters

const CMMFSwCodec::TCodecProcessResult::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