CMMFFormatEncode Class Reference

class CMMFFormatEncode : public CBase

Base class from which sink formats can be derived from.

The intended usage is for controllers that can support more than one type of format. The class is an MDataSink as far as the data path is concerned but is an MDataSource to the clip that is the sink of the actual data. All CMMFFormatEncode plugin DLLs must include interface_uid = KMmfUidPluginInterfaceFormatEncode in their .rss files.

Inherits from

Public Member Functions
~CMMFFormatEncode ()
void AddMetaDataEntryL (const CMMFMetaDataEntry &)
TUint BitRate ()
void BufferEmptiedL ( CMMFBuffer *)
void BufferFilledL ( CMMFBuffer *)
TInt64 BytesPerSecond ()
TBool CanCreateSinkBuffer ()
TBool CanCreateSourceBuffer ()
CMMFBuffer * CreateSinkBufferL ( TMediaId , TBool &)
CMMFBuffer * CreateSourceBufferL ( TMediaId , TBool &)
void CropL ( TTimeIntervalMicroSeconds , TBool )
TTimeIntervalMicroSeconds Duration ( TMediaId )
void EmptyBufferL ( CMMFBuffer *, MDataSource *, TMediaId )
void FillBufferL ( CMMFBuffer *, MDataSink *, TMediaId )
TTimeIntervalMicroSeconds FrameTimeInterval ( TMediaId )
TUint GetDefaultSampleRate ()
void GetNumberOfMetaDataEntriesL ( TInt &)
void GetSupportedBitRatesL ( RArray < TUint > &)
void GetSupportedDataTypesL ( TMediaId , RArray < TFourCC > &)
void GetSupportedNumChannelsL ( RArray < TUint > &)
void GetSupportedSampleRatesL ( RArray < TUint > &)
TUid ImplementationUid ()
TInt MaximumClipSize ()
CMMFMetaDataEntry * MetaDataEntryL ( TInt )
IMPORT_C CMMFFormatEncode * NewL ( TUid , MDataSink *)
IMPORT_C CMMFFormatEncode * NewL (const TDesC &, MDataSink *, const TDesC &)
IMPORT_C CMMFFormatEncode * NewL (const TDesC8 &, MDataSink *, const TDesC &)
IMPORT_C CMMFFormatEncode * NewL ( MDataSink *, const TDesC &)
TUint NumChannels ()
TTimeIntervalMicroSeconds PositionL ()
TInt RemoveMetaDataEntry ( TInt )
void ReplaceMetaDataEntryL ( TInt , const CMMFMetaDataEntry &)
TUint SampleRate ()
TInt SetBitRate ( TUint )
void SetMaximumClipSizeL ( TInt )
TInt SetNumChannels ( TUint )
void SetPositionL (const TTimeIntervalMicroSeconds &)
TInt SetSampleRate ( TUint )
TFourCC SinkDataTypeCode ( TMediaId )
TFourCC SourceDataTypeCode ( TMediaId )
Protected Member Functions
CMMFFormatEncode ()
void ConstructSinkL (const TDesC8 &)
void ConstructSourceL (const TDesC8 &)
CMMFFormatEncode * CreateFormatL ( TUid , MDataSink *)
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()
Protected Attributes
MDataSink * iClip
MDataSource * iDataPath
Private Attributes
TUid iDtor_ID_Key
TUid iImplementationUid

Constructor & Destructor Documentation

CMMFFormatEncode()

CMMFFormatEncode ( ) [protected, inline]

Default constructor

~CMMFFormatEncode()

~CMMFFormatEncode ( ) [inline, virtual]

Destructor.

Member Functions Documentation

AddMetaDataEntryL(const CMMFMetaDataEntry &)

void AddMetaDataEntryL ( const CMMFMetaDataEntry & aNewEntry ) [inline, virtual]

Adds the specified meta data entry to the clip.

The default implementation leaves with KErrNotSupported.

Parameters

const CMMFMetaDataEntry & aNewEntry The meta data entry to add.

BitRate()

TUint BitRate ( ) [inline, virtual]

Returns the bit rate.

The default returns 0.

BufferEmptiedL(CMMFBuffer *)

void BufferEmptiedL ( CMMFBuffer * aBuffer ) [inline, virtual]

Called by the clip when it has added the data to the file.

Parameters

CMMFBuffer * aBuffer The emptied buffer.

BufferFilledL(CMMFBuffer *)

void BufferFilledL ( CMMFBuffer * aBuffer ) [inline, virtual]

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

Parameters

CMMFBuffer * aBuffer The buffer that has been filled.

BytesPerSecond()

TInt64 BytesPerSecond ( ) [inline, virtual]

Returns the bytes per second.

The default returns 0.

CanCreateSinkBuffer()

TBool CanCreateSinkBuffer ( ) [inline, virtual]

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 ETrue.

CanCreateSourceBuffer()

TBool CanCreateSourceBuffer ( ) [inline, virtual]

Tests whether a source buffer can be created.

The default implementation returns EFalse.

ConstructSinkL(const TDesC8 &)

void ConstructSinkL ( const TDesC8 & ) [protected, inline, virtual]

Parameters

const TDesC8 &

ConstructSourceL(const TDesC8 &)

void ConstructSourceL ( const TDesC8 & ) [protected, inline, virtual]

Parameters

const TDesC8 &

CreateFormatL(TUid, MDataSink *)

CMMFFormatEncode * CreateFormatL ( TUid aImplementationUid,
MDataSink * aSink
) [protected, static]

Parameters

TUid aImplementationUid
MDataSink * aSink

CreateSinkBufferL(TMediaId, TBool &)

CMMFBuffer * CreateSinkBufferL ( TMediaId aMediaId,
TBool & aReference
) [pure virtual]

Creates a sink buffer for the specified media ID.

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

Parameters

TMediaId aMediaId The media type ID.
TBool & aReference If ETrue then MDataSink owns the buffer. If EFalse, then the caller owns the buffer.

CreateSourceBufferL(TMediaId, TBool &)

CMMFBuffer * CreateSourceBufferL ( TMediaId aMediaId,
TBool & aReference
) [inline, virtual]

Creates a source buffer. The default returns NULL.

Parameters

TMediaId aMediaId The media type id.
TBool & aReference If ETrue the MDataSource owns the buffer. If EFalse, then the caller owns the buffer.

CropL(TTimeIntervalMicroSeconds, TBool)

void CropL ( TTimeIntervalMicroSeconds aPosition,
TBool aToEnd = ETrue
) [inline, virtual]

This function is used to truncate the sink ie. a CMMFClip ,

If aToEnd = ETrue the sink is cropped from the aPosition to the end of the clip. If aToEnd = EFalse then the sink is cropped from the start of the clip to aPosition.

This function would be called by the CMMFController . The default implementation leaves with KErrNotSupported.

Parameters

TTimeIntervalMicroSeconds aPosition The position within the clip.
TBool aToEnd = ETrue Flag to determine which part of the clip to delete.

Duration(TMediaId)

TTimeIntervalMicroSeconds Duration ( TMediaId aMediaType ) const [pure virtual]

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

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

Parameters

TMediaId aMediaType The media type ID.

EmptyBufferL(CMMFBuffer *, MDataSource *, TMediaId)

void EmptyBufferL ( CMMFBuffer * aBuffer,
MDataSource * aSupplier,
TMediaId aMediaId
) [pure virtual]

Adds a buffer to a clip.

Called by CMMFDataPath . (from MDataSink - CMMFFormatEncode is a MDataSink to a CMMFDataPath )

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

Parameters

CMMFBuffer * aBuffer The buffer to which the clip is added.
MDataSource * aSupplier The data source.
TMediaId aMediaId The media type ID.

FillBufferL(CMMFBuffer *, MDataSink *, TMediaId)

void FillBufferL ( CMMFBuffer * aBuffer,
MDataSink * aConsumer,
TMediaId aMediaId
) [inline, virtual]

Request from CMMFDataPath to fill the specified buffer.

Parameters

CMMFBuffer * aBuffer The buffer to fill.
MDataSink * aConsumer The consumer.
TMediaId aMediaId The media ID.

FrameTimeInterval(TMediaId)

TTimeIntervalMicroSeconds FrameTimeInterval ( TMediaId aMediaType ) 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.

Parameters

TMediaId aMediaType The media type ID.

GetDefaultSampleRate()

TUint GetDefaultSampleRate ( ) [inline, virtual]

Returns the default sample rate.

The default returns 0.

GetNumberOfMetaDataEntriesL(TInt &)

void GetNumberOfMetaDataEntriesL ( TInt & aNumberOfEntries ) [inline, virtual]

Gets the number of meta data entries.

The encode format is capable of reading and writing meta data to the clip.

The default implementation leaves with KErrNotSupported.

Parameters

TInt & aNumberOfEntries On return, contains the number of meta data entries.

GetSupportedBitRatesL(RArray< TUint > &)

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

Gets the supported bit rates.

The default implementation leaves with KErrNotSupported.

Parameters

RArray < TUint > & aBitRates A reference to an array of supported bit rates.

GetSupportedDataTypesL(TMediaId, RArray< TFourCC > &)

void GetSupportedDataTypesL ( TMediaId aMediaId,
RArray < TFourCC > & aDataTypes
) [inline, virtual]

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

The default implementation leaves with KErrNotSupported.

Parameters

TMediaId aMediaId The media type id.
RArray < TFourCC > & aDataTypes A reference to an array of supported data types.

GetSupportedNumChannelsL(RArray< TUint > &)

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

Gets the supported number of channels.

The default implementation leaves with KErrNotSupported.

Parameters

RArray < TUint > & aNumChannels A reference to an array of supported number of channels.

GetSupportedSampleRatesL(RArray< TUint > &)

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

Gets the supported sample rates.

The default implementation leaves with KErrNotSupported.

Parameters

RArray < TUint > & aSampleRates A reference to an array of supported sample rates.

ImplementationUid()

TUid ImplementationUid ( ) const [inline]

Gets the ECom plugin UID of this format.

MaximumClipSize()

TInt MaximumClipSize ( ) [inline, virtual]

Returns the maximum clip size.

The default returns 0.

MetaDataEntryL(TInt)

CMMFMetaDataEntry * MetaDataEntryL ( TInt aIndex ) [inline, virtual]

Returns the specified meta data entry.

The default implementation leaves with KErrNotSupported.

Parameters

TInt aIndex The zero based meta data entry index to retrieve.

NewL(TUid, MDataSink *)

IMPORT_C CMMFFormatEncode * NewL ( TUid aUid,
MDataSink * aSink
) [static]

Allocates and constructs an ECom format encode object.

Parameters

TUid aUid The implementation UID.
MDataSink * aSink The data sink.

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

IMPORT_C CMMFFormatEncode * NewL ( const TDesC & aFileName,
MDataSink * aSink,
const TDesC & aPreferredSupplier
) [static]

Attempts to locate and instantiate a CMMFFormatEncode using a filename or an extension.

Only the extension of the supplied file name is used. If no extension is supplied (ie. no dot is present) the whole of the filename will be treated as the extension.

Parameters

const TDesC & aFileName File name of target file. May be extension only or may include the full path.
MDataSink * aSink The data source.
const TDesC & aPreferredSupplier If this is provided, the list of matching plugins will be further searched for the latest version of a plugin supplied by supplier named.

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

IMPORT_C CMMFFormatEncode * NewL ( const TDesC8 & aSourceHeader,
MDataSink * aSink,
const TDesC & aPreferredSupplier
) [static]

Attempts to locate and instantiate a CMMFFormatEncode using data in the specified 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.

Parameters

const TDesC8 & aSourceHeader The data which is searched for matching signatures.
MDataSink * aSink The data sink.
const TDesC & aPreferredSupplier If this is provided the list of matching plugins will be further searched for the latest version of a plugin supplied by supplier named.

NewL(MDataSink *, const TDesC &)

IMPORT_C CMMFFormatEncode * NewL ( MDataSink * aSink,
const TDesC & aPreferredSupplier
) [static]

Attempts to locate and instantiate a CMMFFormatEncode using data from aSink.

The data is expected to contain header data (from a file, stream or descriptor). Signatures (supplied by the plugin registry information) are sought in the source header.

Parameters

MDataSink * aSink The header data. Must be derived from CMMFClip.
const TDesC & aPreferredSupplier If this is provided, the list of matching plugins will be further searched for the latest version of a plugin supplied by supplier specified.

NumChannels()

TUint NumChannels ( ) [inline, virtual]

Returns the number of channels.

The default implementation returns 0.

PositionL()

TTimeIntervalMicroSeconds PositionL ( ) [inline, virtual]

Supplies the current position.

Subsequent data reads will commence from this position.

RemoveMetaDataEntry(TInt)

TInt RemoveMetaDataEntry ( TInt aIndex ) [inline, virtual]

Removes the specified meta data entry.

The default implementation returns KErrNotSupported.

Parameters

TInt aIndex The zero based meta data entry index to remove.

ReplaceMetaDataEntryL(TInt, const CMMFMetaDataEntry &)

void ReplaceMetaDataEntryL ( TInt aIndex,
const CMMFMetaDataEntry & aNewEntry
) [inline, virtual]

Replaces the specified meta data entry with the entry supplied in aNewEntry.

The default implementation leaves with KErrNotSupported.

Parameters

TInt aIndex The zero based meta data entry index to replace.
const CMMFMetaDataEntry & aNewEntry The meta data entry to replace.

SampleRate()

TUint SampleRate ( ) [inline, virtual]

Returns the sample rate.

The default implementation returns 0.

SetBitRate(TUint)

TInt SetBitRate ( TUint aBitRate ) [inline, virtual]

Sets the bit rate.

The default implementation returns KErrNotSupported.

Parameters

TUint aBitRate The bit rate.

SetMaximumClipSizeL(TInt)

void SetMaximumClipSizeL ( TInt aBytes ) [inline, virtual]

Sets the maximum clip size.

The default implementation leaves with KErrNotSupported.

Parameters

TInt aBytes The maximum clip size.

SetNumChannels(TUint)

TInt SetNumChannels ( TUint aChannels ) [inline, virtual]

Sets the number of channels.

The default implementation returns KErrNotSupported.

Parameters

TUint aChannels The number of channels.

SetPositionL(const TTimeIntervalMicroSeconds &)

void SetPositionL ( 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 to 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

const TTimeIntervalMicroSeconds & aPosition The position the format should use.

SetSampleRate(TUint)

TInt SetSampleRate ( TUint aSampleRate ) [inline, virtual]

Sets the sample rate.

The default implementation returns KErrNotSupported.

Parameters

TUint aSampleRate The sample rate.

SinkDataTypeCode(TMediaId)

TFourCC SinkDataTypeCode ( TMediaId aMediaId ) [pure 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.

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

Parameters

TMediaId aMediaId The media type ID.

SourceDataTypeCode(TMediaId)

TFourCC SourceDataTypeCode ( TMediaId aMediaId ) [inline, virtual]

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

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

Parameters

TMediaId aMediaId The media type id.

Member Data Documentation

MDataSink * iClip

MDataSink * iClip [protected]

The clip is the sink for the encode format.

MDataSource * iDataPath

MDataSource * iDataPath [protected]

The Data path is the source for the encode format.

TUid iDtor_ID_Key

TUid iDtor_ID_Key [private]

TUid iImplementationUid

TUid iImplementationUid [private]