Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <mmfformat.h>
Link against: mmfserverbaseclasses.lib
This item is not part of the S60 5th Edition SDK

Class CMMFFormatEncode

class CMMFFormatEncode : public CBase, public MDataSource, public MDataSink;

Description

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.

Derivation

Members

Defined in CMMFFormatEncode:

Inherited from CBase:

Inherited from MDataSink:

Inherited from MDataSource:


Construction and destruction


NewL(TUid,MDataSink *)

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

Description

Allocates and constructs an ECom format encode object.

Parameters

TUid aUid

The implementation UID.

MDataSink *aSink

The data sink.

Return value

CMMFFormatEncode *

If successful, returns the address of the format decode plugin object created. If not successful, leaves with KErrNotFound.


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

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

Description

Parameters

const TDesC16 &aFileName

MDataSink *aSink

const TDesC16 &aPreferredSupplier

Return value

CMMFFormatEncode *


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

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

Description

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 TDesC16 &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.

Return value

CMMFFormatEncode *

If successful, returns the address of the format decode plugin object created. If not successful, leaves with KErrNotFound.


NewL(MDataSink *,const TDesC &)

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

Description

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 TDesC16 &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.

Return value

CMMFFormatEncode *

If successful, returns the address of the format decode plugin object created. If not successful, leaves with KErrNotFound.


~CMMFFormatEncode()

inline virtual ~CMMFFormatEncode();

Description

Destructor.


CMMFFormatEncode()

protected: inline CMMFFormatEncode();

Description

Default constructor

[Top]


Member functions


ImplementationUid()const

inline TUid ImplementationUid() const;

Description

Gets the ECom plugin UID of this format.

Return value

TUid

The plugin UID.


FrameTimeInterval(TMediaId)const

virtual TTimeIntervalMicroSeconds FrameTimeInterval(TMediaId aMediaType) const=0;

Description

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.

Return value

TTimeIntervalMicroSeconds

The frame time interval in microseconds.


Duration(TMediaId)const

virtual TTimeIntervalMicroSeconds Duration(TMediaId aMediaType) const=0;

Description

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.

Return value

TTimeIntervalMicroSeconds

The duration of the sink clip.


BufferEmptiedL(CMMFBuffer *)

inline virtual void BufferEmptiedL(CMMFBuffer *aBuffer);

Description

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

Parameters

CMMFBuffer *aBuffer

The emptied buffer.


CanCreateSourceBuffer()

inline virtual TBool CanCreateSourceBuffer();

Description

Tests whether a source buffer can be created.

The default implementation returns EFalse.

Return value

TBool

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


CreateSourceBufferL(TMediaId,TBool &)

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

Description

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.

Return value

CMMFBuffer *

Source buffer.


SourceDataTypeCode(TMediaId)

inline virtual TFourCC SourceDataTypeCode(TMediaId aMediaId);

Description

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.

Return value

TFourCC

The source data type code.


EmptyBufferL(CMMFBuffer *,MDataSource *,TMediaId)

virtual void EmptyBufferL(CMMFBuffer *aBuffer, MDataSource *aSupplier, TMediaId aMediaId)=0;

Description

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.


CanCreateSinkBuffer()

inline virtual TBool CanCreateSinkBuffer();

Description

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.

Return value

TBool

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


CreateSinkBufferL(TMediaId,TBool &)

virtual CMMFBuffer* CreateSinkBufferL(TMediaId aMediaId, TBool &aReference)=0;

Description

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.

Return value

CMMFBuffer *

A pointer to the CMMFBuffer sink buffer.


SinkDataTypeCode(TMediaId)

virtual TFourCC SinkDataTypeCode(TMediaId aMediaId)=0;

Description

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.

Return value

TFourCC

The sink data type code.


CropL(TTimeIntervalMicroSeconds,TBool)

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

Description

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

Flag to determine which part of the clip to delete.


GetNumberOfMetaDataEntriesL(TInt &)

inline virtual void GetNumberOfMetaDataEntriesL(TInt &aNumberOfEntries);

Description

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.


MetaDataEntryL(TInt)

inline virtual CMMFMetaDataEntry* MetaDataEntryL(TInt aIndex);

Description

Returns the specified meta data entry.

The default implementation leaves with KErrNotSupported.

Parameters

TInt aIndex

The zero based meta data entry index to retrieve.

Return value

CMMFMetaDataEntry *

The meta data entry.


AddMetaDataEntryL(const CMMFMetaDataEntry &)

inline virtual void AddMetaDataEntryL(const CMMFMetaDataEntry &aNewEntry);

Description

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.


RemoveMetaDataEntry(TInt)

inline virtual TInt RemoveMetaDataEntry(TInt aIndex);

Description

Removes the specified meta data entry.

The default implementation returns KErrNotSupported.

Parameters

TInt aIndex

The zero based meta data entry index to remove.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


ReplaceMetaDataEntryL(TInt,const CMMFMetaDataEntry &)

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

Description

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.


SetNumChannels(TUint)

inline virtual TInt SetNumChannels(TUint aChannels);

Description

Sets the number of channels.

The default implementation returns KErrNotSupported.

Parameters

TUint aChannels

The number of channels.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


SetSampleRate(TUint)

inline virtual TInt SetSampleRate(TUint aSampleRate);

Description

Sets the sample rate.

The default implementation returns KErrNotSupported.

Parameters

TUint aSampleRate

The sample rate.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


SetBitRate(TUint)

inline virtual TInt SetBitRate(TUint aBitRate);

Description

Sets the bit rate.

The default implementation returns KErrNotSupported.

Parameters

TUint aBitRate

The bit rate.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


NumChannels()

inline virtual TUint NumChannels();

Description

Returns the number of channels.

The default implementation returns 0.

Return value

TUint

The number of channels.


SampleRate()

inline virtual TUint SampleRate();

Description

Returns the sample rate.

The default implementation returns 0.

Return value

TUint

The sample rate.


GetDefaultSampleRate()

inline virtual TUint GetDefaultSampleRate();

Description

Returns the default sample rate.

The default returns 0.

Return value

TUint

The default sample rate.


BitRate()

inline virtual TUint BitRate();

Description

Returns the bit rate.

The default returns 0.

Return value

TUint

The bit rate.


BytesPerSecond()

inline virtual TInt64 BytesPerSecond();

Description

Returns the bytes per second.

The default returns 0.

Return value

TInt64

The bytes per second.


GetSupportedSampleRatesL(RArray< TUint > &)

inline virtual void GetSupportedSampleRatesL(RArray< TUint > &aSampleRates);

Description

Gets the supported sample rates.

The default implementation leaves with KErrNotSupported.

Parameters

RArray< TUint > &aSampleRates

A reference to an array of supported sample rates.


GetSupportedBitRatesL(RArray< TUint > &)

inline virtual void GetSupportedBitRatesL(RArray< TUint > &aBitRates);

Description

Gets the supported bit rates.

The default implementation leaves with KErrNotSupported.

Parameters

RArray< TUint > &aBitRates

A reference to an array of supported bit rates.


GetSupportedNumChannelsL(RArray< TUint > &)

inline virtual void GetSupportedNumChannelsL(RArray< TUint > &aNumChannels);

Description

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.


GetSupportedDataTypesL(TMediaId,RArray< TFourCC > &)

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

Description

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.


SetMaximumClipSizeL(TInt)

inline virtual void SetMaximumClipSizeL(TInt aBytes);

Description

Sets the maximum clip size.

The default implementation leaves with KErrNotSupported.

Parameters

TInt aBytes

The maximum clip size.


MaximumClipSize()

inline virtual TInt MaximumClipSize();

Description

Returns the maximum clip size.

The default returns 0.

Return value

TInt

The maximum clip size.


SetPositionL(const TTimeIntervalMicroSeconds &)

inline virtual void SetPositionL(const TTimeIntervalMicroSeconds &aPosition);

Description

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.


PositionL()

inline virtual TTimeIntervalMicroSeconds PositionL();

Description

Supplies the current position.

Subsequent data reads will commence from this position.

Return value

TTimeIntervalMicroSeconds

The current position in microseconds.

[Top]


Member data


iDataPath

protected: MDataSource * iDataPath;

Description

The Data path is the source for the encode format.


iClip

protected: MDataSink * iClip;

Description

The clip is the sink for the encode format.