CMMFFormatDecode Class Reference

#include <mmf/server/mmfformat.h>

class CMMFFormatDecode : public CBase, public MDataSource, public MDataSink

Inherits from

Protected Attributes
MDataSource *iClip
MDataSink *iDataPath
Public Member Functions
virtual ~CMMFFormatDecode()
virtual TUint BitRate()
virtual voidBufferEmptiedL(CMMFBuffer *)
virtual voidBufferFilledL(CMMFBuffer *)
virtual TBool CanCreateSinkBuffer()
virtual TBool CanCreateSourceBuffer()
virtual CMMFBuffer *CreateSinkBufferL(TMediaId, TBool &)
pure virtual CMMFBuffer *CreateSourceBufferL(TMediaId, TBool &)
pure virtual TTimeIntervalMicroSeconds Duration(TMediaId)
virtual voidEmptyBufferL(CMMFBuffer *, MDataSource *, TMediaId)
pure virtual voidFillBufferL(CMMFBuffer *, MDataSink *, TMediaId)
pure virtual TTimeIntervalMicroSeconds FrameTimeInterval(TMediaId)
virtual voidGetNumberOfMetaDataEntriesL(TInt &)
virtual voidGetSupportedBitRatesL(RArray< TUint > &)
virtual voidGetSupportedDataTypesL(TMediaId, RArray< TFourCC > &)
virtual voidGetSupportedNumChannelsL(RArray< TUint > &)
virtual voidGetSupportedSampleRatesL(RArray< TUint > &)
TUid ImplementationUid()
virtual CMMFMetaDataEntry *MetaDataEntryL(TInt)
IMPORT_C CMMFFormatDecode *NewL(TUid, MDataSource *)
IMPORT_C CMMFFormatDecode *NewL(const TDesC &, MDataSource *, const TDesC &)
IMPORT_C CMMFFormatDecode *NewL(const TDesC8 &, MDataSource *, const TDesC &)
IMPORT_C CMMFFormatDecode *NewL(MDataSource *, const TDesC &)
IMPORT_C CMMFFormatDecode *NewL(const TDesC &, MDataSource *, const TDesC &, TBool &)
IMPORT_C CMMFFormatDecode *NewL(const TDesC8 &, MDataSource *, const TDesC &, TBool &)
IMPORT_C CMMFFormatDecode *NewL(MDataSource *, const TDesC &, TBool &)
virtual TUint NumChannels()
virtual TTimeIntervalMicroSeconds PositionL()
virtual TUint SampleRate()
virtual TInt SetBitRate(TUint)
virtual TInt SetNumChannels(TUint)
virtual voidSetPositionL(const TTimeIntervalMicroSeconds &)
virtual TInt SetSampleRate(TUint)
virtual TFourCC SinkDataTypeCode(TMediaId)
pure virtual TFourCC SourceDataTypeCode(TMediaId)
pure virtual TUint Streams(TUid)
virtual voidSuggestSourceBufferSize(TUint)
Protected Member Functions
CMMFFormatDecode()
virtual voidConstructSinkL(const TDesC8 &)
virtual voidConstructSourceL(const TDesC8 &)
CMMFFormatDecode *CreateFormatL(TUid, MDataSource *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
MDataSink::DataSinkType()const
MDataSink::MDataSink(TUid)
MDataSink::NegotiateL(MDataSource &)
MDataSink::NewSinkL(TUid,const TDesC8 &)
MDataSink::NewSinkLC(TUid,const TDesC8 &)
MDataSink::SetSinkDataTypeCode(TFourCC,TMediaId)
MDataSink::SetSinkPrioritySettings(const TMMFPrioritySettings &)
MDataSink::SinkCustomCommand(TMMFMessage &)
MDataSink::SinkPauseL()
MDataSink::SinkPlayL()
MDataSink::SinkPrimeL()
MDataSink::SinkStopL()
MDataSink::SinkThreadLogoff()
MDataSink::SinkThreadLogon(MAsyncEventHandler &)
MDataSink::~MDataSink()
MDataSource::CreateSourceBufferL(TMediaId,CMMFBuffer &,TBool &)
MDataSource::DataSourceType()const
MDataSource::MDataSource(TUid)
MDataSource::NegotiateSourceL(MDataSink &)
MDataSource::NewSourceL(TUid,const TDesC8 &)
MDataSource::NewSourceLC(TUid,const TDesC8 &)
MDataSource::SetSourceDataTypeCode(TFourCC,TMediaId)
MDataSource::SetSourcePrioritySettings(const TMMFPrioritySettings &)
MDataSource::SourceCustomCommand(TMMFMessage &)
MDataSource::SourcePauseL()
MDataSource::SourcePlayL()
MDataSource::SourcePrimeL()
MDataSource::SourceSampleConvert()
MDataSource::SourceStopL()
MDataSource::SourceThreadLogoff()
MDataSource::SourceThreadLogon(MAsyncEventHandler &)
MDataSource::~MDataSource()

Detailed Description

Base class from which source formats can be derived from. The intended usage is for controllers that can support more

than one type of format. The class is an MDataSource as far as the data path is concerned but is an MDataSink to the clip

that is the source of the actual data.

All CMMFFormatDecode plugin DLLs must include interface_uid = KMmfUidPluginInterfaceFormatDecode in their .rss files.

Member Attribute Documentation

iClip

MDataSource *iClip[protected]

The clip is the source for the decode format.

iDataPath

MDataSink *iDataPath[protected]

The data path is the sink for the decode format.

Constructor & Destructor Documentation

CMMFFormatDecode ( )

CMMFFormatDecode()[protected, inline]

Default constructor

~CMMFFormatDecode ( )

~CMMFFormatDecode()[inline, virtual]

Destructor.

Member Function Documentation

BitRate ( )

TUint BitRate()[inline, virtual]

Gets the bit rate.

The default implementation returns 0.

This method is mainly provided for variable bit rate formats, such as mp3, where the bit rate

can not be directly calculated from the sample rate. This function needs overriding for any format

decode that supports audio.

Return Value
The bit rate.

BufferEmptiedL ( CMMFBuffer * )

voidBufferEmptiedL(CMMFBuffer *aBuffer)[inline, virtual]

Reimplemented from MDataSource::BufferEmptiedL(CMMFBuffer *)

Indicates data has been added to the file.

Parameters
aBufferThe emptied buffer.

BufferFilledL ( CMMFBuffer * )

voidBufferFilledL(CMMFBuffer *aBuffer)[inline, virtual]

Reimplemented from MDataSink::BufferFilledL(CMMFBuffer *)

Indicates the data source has filled the buffer.

Called by the CMMFFormat's MDataSource when it has filled the buffer.

The default implementation below would need overriding in cases where multiple

clip reads were required to fill the buffer from the data path.

Parameters
aBufferThe buffer to which the clip is added.

CanCreateSinkBuffer ( )

TBool CanCreateSinkBuffer()[inline, virtual]

Reimplemented from MDataSink::CanCreateSinkBuffer()

Tests whether a sink buffer can be created.

Format would normally pass its own buffer onto the CMMFClip, so

this may not be required. The default returns EFalse.

Return Value
A boolean indicating if the sink buffer can be created. ETrue if buffer can be created, EFalse otherwise.

CanCreateSourceBuffer ( )

TBool CanCreateSourceBuffer()[inline, virtual]

Reimplemented from MDataSource::CanCreateSourceBuffer()

Tests whether a source buffer can be created.

The format knows what type of source buffer it requires so default returns ETrue.

It doesn't usually need to set the size of this buffer.

EFalse otherwise.

Return Value
A boolean indicating whether a buffer can be created. ETrue if the buffer can be created,

ConstructSinkL ( const TDesC8 & )

voidConstructSinkL(const TDesC8 &)[protected, inline, virtual]

Reimplemented from MDataSink::ConstructSinkL(const TDesC8 &)

ConstructSourceL ( const TDesC8 & )

voidConstructSourceL(const TDesC8 &)[protected, inline, virtual]

CreateFormatL ( TUid, MDataSource * )

CMMFFormatDecode *CreateFormatL(TUidaImplementationUid,
MDataSource *aSource
)[protected, static]

CreateSinkBufferL ( TMediaId, TBool & )

CMMFBuffer *CreateSinkBufferL(TMediaIdaMediaId,
TBool &aReference
)[inline, virtual]

Creates a sink buffer for the specified media ID. The default version returns NULL.

If EFalse, then the caller owns the buffer.

Parameters
aMediaIdThe media type ID.
aReferenceIf ETrue the MDataSink owns the buffer.
Return Value
The CMMFBuffer sink buffer.

CreateSourceBufferL ( TMediaId, TBool & )

CMMFBuffer *CreateSourceBufferL(TMediaIdaMediaId,
TBool &aReference
)[pure virtual]

Creates a source buffer.

This is a virtual function that each derived class must implement.

This function should create a buffer of length 0, the maximum length should be equal to the maximum

possible frame size. In the case of non framed data it should be set to an arbitrary size, which is

effectively a trade off between being too small which will affect performance as more source reads

are required, and being too large which will give very coarse positioning granularity. For pcm data,

a buffer size of 4K is a good compromise. The same compromise also applies when deciding to put multiple

audio frames into one format frame. The sink buffer size may also effect the format buffer size and

the controller may use this to suggest a buffer size to the format by calling the format's SuggestSourceBufferSize()

method. Alternatively the MDataSource::CreateSourceBufferL() function that takes the additional aSinkBuffer

parameter may also be used when deciding the source buffer maximum size of the created source buffer.

should normally be set to EFalse as format plugins do not create the reference buffer.

Parameters
aMediaIdThe media type ID.
aReferenceIf ETrue the MDataSource owns the buffer. If EFalse, then the caller owns the buffer. This
Return Value
The created source buffer.

Duration ( TMediaId )

TTimeIntervalMicroSeconds Duration(TMediaIdaMediaType)const [pure virtual]

Returns the duration of the clip for the specified media type.

This is a virtual function that each derived class must implement.

Parameters
aMediaTypeThe media type ID.
Return Value
The duration of the clip.

EmptyBufferL ( CMMFBuffer *, MDataSource *, TMediaId )

voidEmptyBufferL(CMMFBuffer *aBuffer,
MDataSource *aSupplier,
TMediaIdaMediaId
)[inline, virtual]

Adds a buffer to a clip.

Parameters
aBufferThe buffer to which the clip is added.
aSupplierThe data source.
aMediaIdThe Media ID.

FillBufferL ( CMMFBuffer *, MDataSink *, TMediaId )

voidFillBufferL(CMMFBuffer *aBuffer,
MDataSink *aConsumer,
TMediaIdaMediaId
)[pure virtual]

Request from CMMFDataPath to fill the specified buffer.

The CMMFFormat needs to break this down into one or more reads from the clip

(from MDataSource - CMMFFormatDecode is a MDataSource to a CMMFDataPath consumer).

This is a virtual function that each derived class must implement.

This method is the means by which data is obtained from the data source. aBuffer is

the buffer that needs filling from the source data stream as identified by aMediaId. The

format should read the frame number of the buffer via the buffer's CMMFBuffer::FrameNumber()

method. From this the format should be able to determine the actual position of the data on

the data source. The technique here depends on the nature of the format. For a linear audio

format, the position can be obtained by a simple calculation of the frame size, the header size

and where appropriate the datatype.

For non-linear formats either an index table of frame number and location will need to be

created in the NewL() or some form of approximating algorithm will be required. Some formats have

an index table as part of the format e.g. AVI. If no random access is required then no index table

is required, the format can keep track of the current read position and increment it on each access,

and reset it if the frame number is reset to 0 or 1. Given that for non-linear i.e. variable bit rate

formats, the size of the data read may vary from frame to frame, then the format should either set

the request size of the buffer for the required frame or call the source's ReadBufferL() (either

CMMFClip::ReadBufferL(), CMMFDescriptor ::ReadBufferL() or CMMFFile::ReadBufferL()) function that

takes the aLength parameter.

It is the responsibility of the format decode to determine the size and position of the source data

for each frame. For linear audio formats, the format decode should fill the buffer up to its maximum

length. For multimedia formats e.g. mp4, AVI etc, the format decode is effectively acting as a demultiplexor,

and must obtain the appropriate data from the source depending on the aMediaId.

Parameters
aBufferThe buffer to fill.
aConsumerThe consumer.
aMediaIdThe media type ID.

FrameTimeInterval ( TMediaId )

TTimeIntervalMicroSeconds FrameTimeInterval(TMediaIdaMediaType)const [pure virtual]

Returns the time interval for one frame for the specified media type.

This is a virtual function that each derived class must implement.

In the case of video, a frame would usually be one frame of video. In the case of

audio, a frame may correspond to a frame of audio, if the particular audio data type

is framed eg mp3. There are two definitions of a frame. A format frame, which may

consist of several frames of a particular framed audio data type. This may be the case,

for example for GSM610 (a low quality audio data type used in telephony) where a frame

is only 65 bytes large. In this case a format frame consists of several GSM610 data type

frames as passing the data out 65 bytes at a time would be inefficient. In the case of

non-framed data such as pcm, a frame can be an arbitrary size determined by the format plugin.

Parameters
aMediaTypeThe media type id.
Return Value
The frame time interval

GetNumberOfMetaDataEntriesL ( TInt & )

voidGetNumberOfMetaDataEntriesL(TInt &aNumberOfEntries)[inline, virtual]

Gets the number of meta data entries.

Meta Data support. The decode format is only capable of reading meta data entries from the clip.

This is an optional method, used to return the number of meta data entries present in the format.

A meta data entry is a format-specific field such as authorship, copyright, security details etc.

The function is optional as many formats do not provide support for such additional meta data fields.

The default leaves with KErrNotSupported.

the number of meta data entries.

Parameters
aNumberOfEntriesA reference to the number of meta data entries supported by the format. On return, contains

GetSupportedBitRatesL ( RArray< TUint > & )

voidGetSupportedBitRatesL(RArray< TUint > &aBitRates)[inline, virtual]

Gets the supported bit rates.

The default leaves with KErrNotSupported.

This should return an array of bit rates supported by the format where applicable. Note that this

refers to the possible bit rates supported by the format, not the actual bit rate, which will be

one of the supported bit rates. The implementation of this function is optional.

Parameters
aBitRatesReference to an array of supported bit rates.

GetSupportedDataTypesL ( TMediaId, RArray< TFourCC > & )

voidGetSupportedDataTypesL(TMediaIdaMediaId,
RArray< TFourCC > &aDataTypes
)[inline, virtual]

Gets the supported data types for the given media type id.

The default leaves with KErrNotSupported.

The implementation of this procedure should return an array of data types supported by the format where

applicable. Note that this refers to the possible data types that may be supported by the format, not the

actual data type of the format, which will be one of the supported data types. For example, for a format

decode plugin capable of supporting pcm16 and GSM610 the procedure would return an array of length two the

first array member containing the fourCC code ' P16' and the second containing the value GSM6. The

implementation of this function is optional.

Parameters
aMediaIdThe media type id.
aDataTypesA reference to an array of supported data types.

GetSupportedNumChannelsL ( RArray< TUint > & )

voidGetSupportedNumChannelsL(RArray< TUint > &aNumChannels)[inline, virtual]

Gets the supported number of channels.

The default leaves with KErrNotSupported.

The implementation of this procedure should return an array of channels supported by the format

where applicable. Note that this refers to the possible number of channels supported by the format,

not the actual number of channels, which will be one of the supported channels. For example, for a

format decode plugin capable of supporting mono and stereo the procedure would return an array of

length two the first array member containing the value 1 and the second containing the value 2. The

implementation of this function is optional.

Parameters
aNumChannelsA reference to an array of supported number of channels.

GetSupportedSampleRatesL ( RArray< TUint > & )

voidGetSupportedSampleRatesL(RArray< TUint > &aSampleRates)[inline, virtual]

Gets the supported sample rates.

The default implementation leaves with KErrNotSupported.

This should return an array of sample rates supported by the format where applicable. Note

that this refers to the possible sample rates supported by the format, not the actual sample rate,

which will be one of the supported sample rates. The implementation of this function is optional.

Parameters
aSampleRatesReference to an array of supported sample rates.

ImplementationUid ( )

TUid ImplementationUid()const [inline]

Returns the ECom plugin UID of this format.

Return Value
The plugin UID.

MetaDataEntryL ( TInt )

CMMFMetaDataEntry *MetaDataEntryL(TIntaIndex)[inline, virtual]

Returns the specified meta data entry.

This method is optional as many formats do not provide support for such additional meta data fields.

The default leaves with KErrNotSupported.

Parameters
aIndexThe zero based meta data entry index to retrieve.
Return Value
The meta data entry.

NewL ( TUid, MDataSource * )

IMPORT_C CMMFFormatDecode *NewL(TUidaUid,
MDataSource *aSource
)[static]

Allocates and constructs an ECom format decode object.

This is used to explicitly instantiate a format decoder where the UID is known. This method might

be used by controllers that only support one type of format such that the UID of the format is

already known. For example, if an mp3 controller has been instantiated, there is no need for any

further format recognition as this has already been performed in the controller instantiation, thus

the controller can instantiate an mp3 format directly from its UID.

The implementation UID. This is used by Com to create the plugin.

The controller MDataSource and is the source of the data for the format decode plugin. The

format decode plugin is the sink of data for the MDataSource.

leaves with KErrNotFound.

Return Value
If successful, returns the address of the format decode plugin object created. If not successful,

NewL ( const TDesC &, MDataSource *, const TDesC & )

IMPORT_C CMMFFormatDecode *NewL(const TDesC &aFileName,
MDataSource *aSource,
const TDesC &aPreferredSupplier
)[static]

Attempt to locate and instantiate a FormatDecode using a filename or an extension.

Only the extension is used. If no extension is supplied (no dot is present) the whole of the

filename will be treated as the extension.

If the file already exists, the file header is scanned to find a match in the opaque_data field of

the resource file.

be a CMMFFile source when instantiating a CMMFFormatDecode using a file name.

plugin supplied by supplier named.

Parameters
aFileNameThe file name of target file. May be extension only or may include full path.
aSourceThe controller's MDataSource. This is the source of the data for the format decode plugin. This must
aPreferredSupplierIf this is provided the list of matching plugins will be further searched for the latest version of a
Return Value
If successful returns an instantiated CMMFFormatDecode from a plugin. If not successful, leaves with KErrNotFound.

NewL ( const TDesC8 &, MDataSource *, const TDesC & )

IMPORT_C CMMFFormatDecode *NewL(const TDesC8 &aSourceHeader,
MDataSource *aSource,
const TDesC &aPreferredSupplier
)[static]

Attempts to locate and instantiate a CMMFFormatDecode using data in a buffer. The buffer is expected to contain

header data (from a file, stream or descriptor).

Signatures (supplied by the plugin registry information) are sought in aSourceHeader.

This function uses the match string as a resolver parameter. The format base class uses the match string

to find a match to the match string defined in the opaque_data field of the resource file. The

match string would typically be a signature for a particular format usually defined in the format header.

plugin supplied by the specified supplier.

Parameters
aSourceHeaderThe data which is searched for matching signatures.
aSourceThe controller's MDataSource and the source of the data for the format decode plugin.
aPreferredSupplierIf this is provided the list of matching plugins will be further searched for the latest version of a
Return Value
If successful returns an instantiated CMMFFormatDecode from a plugin. If not successful, leaves with KErrNotFound.

NewL ( MDataSource *, const TDesC & )

IMPORT_C CMMFFormatDecode *NewL(MDataSource *aSource,
const TDesC &aPreferredSupplier
)[static]

Attempts to locate and instantiate a CMMFFormatDecode using data from MDataSource.

The data is expected to contain header data (from a file, stream or descriptor). Signatures

(supplied by the plugin registry information) are sought in aSource.

plugin supplied by the specified supplier.

Parameters
aSourceHeader data. Must be derived from CMMFClip.
aPreferredSupplierIf this is provided, the list of matching plugins will be further searched for the latest version of a
Return Value
If successful returns an instantiated CMMFFormatDecode from a plugin. If not successful, leaves with KErrNotFound.

NewL ( const TDesC &, MDataSource *, const TDesC &, TBool & )

IMPORT_C CMMFFormatDecode *NewL(const TDesC &aFileName,
MDataSource *aSource,
const TDesC &aPreferredSupplier,
TBool &aSupportsCustomInterfaces
)[static]

Attempt to locate and instantiate a FormatDecode using a filename or an extension.

Only the extension is used. If no extension is supplied (no dot is present) the whole of the

filename will be treated as the extension.

If the file already exists, the file header is scanned to find a match in the opaque_data field of

the resource file.

be a CMMFFile source when instantiating a CMMFFormatDecode using a file name.

plugin supplied by supplier named.

Parameters
aFileNameThe file name of target file. May be extension only or may include full path.
aSourceThe controller's MDataSource. This is the source of the data for the format decode plugin. This must
aPreferredSupplierIf this is provided the list of matching plugins will be further searched for the latest version of a
aSupportsCustomInterfacesIndicates whether the instantiated FormatDecode supports custom interfaces.
Return Value
If successful returns an instantiated CMMFFormatDecode from a plugin. If not successful, leaves with KErrNotFound.

NewL ( const TDesC8 &, MDataSource *, const TDesC &, TBool & )

IMPORT_C CMMFFormatDecode *NewL(const TDesC8 &aSourceHeader,
MDataSource *aSource,
const TDesC &aPreferredSupplier,
TBool &aSupportsCustomInterfaces
)[static]

Attempts to locate and instantiate a CMMFFormatDecode using data in a buffer. The buffer is expected to contain

header data (from a file, stream or descriptor).

Signatures (supplied by the plugin registry information) are sought in aSourceHeader.

This function uses the match string as a resolver parameter. The format base class uses the match string

to find a match to the match string defined in the opaque_data field of the resource file. The

match string would typically be a signature for a particular format usually defined in the format header.

plugin supplied by the specified supplier.

Parameters
aSourceHeaderThe data which is searched for matching signatures.
aSourceThe controller's MDataSource and the source of the data for the format decode plugin.
aPreferredSupplierIf this is provided the list of matching plugins will be further searched for the latest version of a
aSupportsCustomInterfacesIndicates whether the instantiated FormatDecode supports custom interfaces.
Return Value
If successful returns an instantiated CMMFFormatDecode from a plugin. If not successful, leaves with KErrNotFound.

NewL ( MDataSource *, const TDesC &, TBool & )

IMPORT_C CMMFFormatDecode *NewL(MDataSource *aSource,
const TDesC &aPreferredSupplier,
TBool &aSupportsCustomInterfaces
)[static]

Attempts to locate and instantiate a CMMFFormatDecode using data from MDataSource.

The data is expected to contain header data (from a file, stream or descriptor). Signatures

(supplied by the plugin registry information) are sought in aSource.

plugin supplied by the specified supplier.

Parameters
aSourceHeader data. Must be derived from CMMFClip.
aPreferredSupplierIf this is provided, the list of matching plugins will be further searched for the latest version of a
aSupportsCustomInterfacesIndicates whether the instantiated FormatDecode supports custom interfaces.
Return Value
If successful returns an instantiated CMMFFormatDecode from a plugin. If not successful, leaves with KErrNotFound.

NumChannels ( )

TUint NumChannels()[inline, virtual]

Returns the number of channels.

The default implementation returns 0.

Return Value
The number of channels.

PositionL ( )

TTimeIntervalMicroSeconds PositionL()[inline, virtual]

Supplies the current position.

Subsequent data reads will commence from this position.

Return Value
The current position in microseconds.

SampleRate ( )

TUint SampleRate()[inline, virtual]

Gets the sample rate.

The default implementation returns 0.

Return Value
The sample rate.

SetBitRate ( TUint )

TInt SetBitRate(TUintaBitRate)[inline, virtual]

Sets the bit rate.

The default implementation returns KErrNotSupported.

This method is mainly provided for variable bit rate formats, such as mp3, where the bit rate can

not be directly calculated from the sample rate. There would normally be no need to override this

function as the format decode can normally determine the sample rate for itself. It is only necessary

to override this in cases where the format decode plugin cannot determine for itself the sample rate.

another of the system-wide error codes.

Parameters
aBitRateThe bit rate in bits per second.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise

SetNumChannels ( TUint )

TInt SetNumChannels(TUintaChannels)[inline, virtual]

Sets the number of channels.

The default returns KErrNotSupported.

There would normally be no need to override this function as the format decode plugin can normally

determine for itself the number of channels. It is only necessary to override this in cases where the

format decode plugin cannot determine for itself the number of channels. This function should not be

used if the audio clip already exists; that is, in the "Open and Append" scenario, when the function's

behaviour is undefined.

another of the system-wide error codes.

Parameters
aChannelsThe number of channels.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise

SetPositionL ( const TTimeIntervalMicroSeconds & )

voidSetPositionL(const TTimeIntervalMicroSeconds &aPosition)[inline, virtual]

Used to set the format's position.

Subsequent data reads should ignore the FrameNumber in the CMMFBuffer and use this

setting to determine what data to provide.

The actual position the format sets itself may vary from this setting to ensure

that it is aligned to the sample boundaries ensuring consistent data output.

If not supported, positional information should be extracted from the FrameNumber in CMMFBuffer

Parameters
aPositionThe position the format should use.

SetSampleRate ( TUint )

TInt SetSampleRate(TUintaSampleRate)[inline, virtual]

Sets the sample rate.

The default implementation returns KErrNotSupported.

There would normally be no need to override this function as the format decode can normally determine

the sample rate for itself. It is only necessary to override this in cases where the format decode plugin

cannot determine for itself the sample rate.

another of the system-wide error codes.

Parameters
aSampleRateThe sample rate.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise

SinkDataTypeCode ( TMediaId )

TFourCC SinkDataTypeCode(TMediaIdaMediaId)[inline, virtual]

Returns the sink data type code for the specified media type ID.

This would be the same as the source data type four CC although

the clip is not going to need this info.

Parameters
aMediaIdThe media type id.
Return Value
The sink data type code.

SourceDataTypeCode ( TMediaId )

TFourCC SourceDataTypeCode(TMediaIdaMediaId)[pure virtual]

Returns the source data type code for the specified media type ID.

Used by the CMMFDataPath for codec matching.

This is a virtual function that each derived class must implement.

Parameters
aMediaIdThe media type ID.
Return Value
The source data type code.

Streams ( TUid )

TUint Streams(TUidaMediaType)const [pure virtual]

Gets the number of streams of the specified media type.

This is a virtual function that each derived class must implement.

For example, for a WAV or mp3 audio file this procedure would return 1 for a media

type of audio and 0 for a media type of video. More complex multimedia formats (for

example AVI and mp4) can support multiple streams of both video and audio.

Parameters
aMediaTypeThe UID of the media type, for example KUidMediaTypeAudio or KUidMediaTypeVideo.
Return Value
The number of streams of multimedia data in the format for the specified media type.

SuggestSourceBufferSize ( TUint )

voidSuggestSourceBufferSize(TUintaSuggestedBufferSize)[inline, virtual]

Used by the sink to suggest a source buffer size.

This is an optional function provided so that a controller can suggest a buffer

size for the format. The controller should not assume that the format will accept

the suggested buffer size and there is no obligation on behalf of the format to

use the suggested buffer size.

Parameters
aSuggestedBufferSizeA recommended buffer size that the format should create.