|
||
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 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:
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(const CMMFBuffer &,CMMFBuffer &)
method, the CMMFSwCodec::ProcessL(const CMMFBuffer &,CMMFBuffer &)
method should not return EProcessIncomplete as this case is not handled by the CMMFSwCodecWrapper
.
CBase
-
Base class for all classes to be instantiated on the heap.
CMMFSwCodec
- ...
Defined in CMMFSwCodec
:
ProcessL(const CMMFBuffer &,CMMFBuffer &)
Processes the data in the specified source buffer and writes the processed data ...SinkBufferSize()
Gets the max size of the sink (destination) buffer passed into the CMMFSwCodec::...SourceBufferSize()
Gets the max size of the source buffer passed into the CMMFSwCodec::ProcessL(con...TCodecProcessResult
...Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...virtual TCodecProcessResult ProcessL(const CMMFBuffer &aSource, CMMFBuffer &aDest)=0;
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.
|
|
virtual TUint SourceBufferSize()=0;
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.
|
virtual TUint SinkBufferSize()=0;
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.
|
class TCodecProcessResult;
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.
Defined in CMMFSwCodec::TCodecProcessResult
:
EDstNotFilled
Could not fill the destination buffer because the source buffer has been emptied...EEndOfData
Codec came across an end of data. EProcessComplete
The codec has successfully completed its processing. EProcessError
An error occured. EProcessIncomplete
Could not empty the source buffer because the destination buffer became full. TCodecProcessResult()
Default constructor.TCodecProcessResultStatus
Flag to track the codec's processing status.iCodecProcessStatus
The codec's processing statusiDstBytesAdded
The number of bytes added to the destination buffer iSrcBytesProcessed
The number of source bytes processed operator!=(const TCodecProcessResultStatus)const
Overloaded operator to test inequality. operator==(const TCodecProcessResultStatus)const
Overloaded operator to test equality. TCodecProcessResult()
inline TCodecProcessResult();
Default constructor.
operator==(const TCodecProcessResultStatus)const
inline TBool operator==(const TCodecProcessResultStatus aStatus) const;
Overloaded operator to test equality.
|
|
operator!=(const TCodecProcessResultStatus)const
inline TBool operator!=(const TCodecProcessResultStatus aStatus) const;
Overloaded operator to test inequality.
|
|
TCodecProcessResultStatus
TCodecProcessResultStatus
Flag to track the codec's processing status.
|
iCodecProcessStatus
TCodecProcessResultStatus iCodecProcessStatus;
The codec's processing status
CMMFSwCodec::TCodecProcessResult::TCodecProcessResultStatus
Flag to track the codec's processing status.iSrcBytesProcessed
TUint iSrcBytesProcessed;
The number of source bytes processed
iDstBytesAdded
TUint iDstBytesAdded;
The number of bytes added to the destination buffer