class CMMFCodec : public CBase |
ECom plugin class for a codec that processes source data in a certain fourCC coding type and converts it to a destination buffer of another fourCC coding type. The function is synchronous as it is expected that the codec will be operating in its own thread of execution - usually via a CMMFDataPath or CMMFDataPathProxy
The codec can be instantiated in 3 different ways:
1. NewL(const TFourCC& aSrcDatatype, const TFourCC& aDstDataType).
This instantiate a codec that can convert the aSrcDatatype to a aDstDataType.
2. NewL(const TFourCC& aSrcDatatype, const TFourCC& aDstDataType, const TDesC& aPreferredSupplier).
This is similar to the above but is used where there may be multiple codecs that perform the same conversion - the idea is that a 3rd party deveoper may develop there own controller and codecs and can ensure the controller uses their codecs by setting the preferredSupplier to themselves.
3. NewL(TUid aUid).
This is used to explicitly instantiated a codec where the uid is known. This might be used by controlers that only support one codec type.
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
The ProcessL should start processing the source buffer from the iPosition data member of the source data and start filling the destination buffer from its iPosition.
Public Member Functions | |
---|---|
~CMMFCodec() | |
void | ConfigureL(TUid, const TDesC8 &) |
TInt | ExtensionInterface(TUint, TAny *&) |
IMPORT_C CMMFCodec * | NewL(const TFourCC &, const TFourCC &) |
IMPORT_C CMMFCodec * | NewL(const TFourCC &, const TFourCC &, const TDesC &) |
IMPORT_C CMMFCodec * | NewL(TUid) |
TCodecProcessResult | ProcessL(const CMMFBuffer &, CMMFBuffer &) |
void | ResetL() |
void | SelectByPreference(RImplInfoPtrArray &, const TDesC &) |
Private Attributes | |
---|---|
TUid | iDtor_ID_Key |
~CMMFCodec | ( | ) | [inline, virtual] |
Destructor.
Destroys any variables then informs ECom that this specific instance of the interface has been destroyed.
void | ConfigureL | ( | TUid | aConfigType, |
const TDesC8 & | aConfigData | |||
) | [inline, virtual] |
Sets codec configuration.
This is a virtual function which does not need to be implemented by a codec, but may be if required. This function provides additional configuration information for the codec. The configuration is passed in as a descriptor. The default version leaves with KErrNotSupported.
TInt | ExtensionInterface | ( | TUint | aExtensionId, |
TAny *& | aExtPtr | |||
) |
Gets a pointer to the extension specified by an identifier. The extension can be either an interface or function. If the extension is not supported NULL value is given and returns KErrExtensionNotSupported.
If successful returns KErrNone otherwise KErrExtensionNotSupported.
IMPORT_C CMMFCodec * | NewL | ( | const TFourCC & | aSrcDatatype, |
const TFourCC & | aDstDataType | |||
) | [static] |
IMPORT_C CMMFCodec * | NewL | ( | const TFourCC & | aSrcDatatype, |
const TFourCC & | aDstDataType, | |||
const TDesC & | aPreferredSupplier | |||
) | [static] |
TCodecProcessResult | ProcessL | ( | const CMMFBuffer & | aSource, |
CMMFBuffer & | aDestination | |||
) | [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. The source buffer is converted to the appropriate coding type in the destination buffer. The buffers can be of any size, therefore there is no guarantee that all the source buffer can be processed to fill the destination buffer or that all the source buffer may be processed before the destination is full. This function therefore returns the number of source, and destination, bytes processed along with a process result code indicating completion status.
The aSource and aSink buffers passed in are derived from CMMFBuffer. The buffer type (e.g. a CMMFDataBuffer) passed in should be supported by the codec otherwise this function should leave with KErrNotSupported. The position of the source buffer should be checked by calling the source buffer's Position() member which indicates the current source read position in bytes. The codec should start processing from the current source buffer read position. The position of the destination buffer should be checked by calling the destination buffer's Position() method which indicates the current destination write position in bytes. The codec should start writing to the destination buffer at the current destination buffer write position.
This is a virtual function that each derived class must implement.
enum TCodecProcessResult
The result of the processing.
const CMMFBuffer & aSource | The source buffer containing data to encode or decode. |
CMMFBuffer & aDestination | The destination buffer to hold the data after encoding or decoding. |
void | ResetL | ( | ) | [inline, virtual] |
Codec reset.
Used to flush out status information when a reposition occurs. This is a virtual function that is provided should the codec require resetting prior to use.
void | SelectByPreference | ( | RImplInfoPtrArray & | aPlugInArray, |
const TDesC & | aPreferredSupplier | |||
) | [static] |
RImplInfoPtrArray & aPlugInArray | |
const TDesC & aPreferredSupplier |