Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: mmfformat.h
Link against: mmfserverbaseclasses.lib

This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.

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:
AddMetaDataEntryL(), BitRate(), BufferEmptiedL(), BytesPerSecond(), CMMFFormatEncode(), CanCreateSinkBuffer(), CanCreateSourceBuffer(), CreateSinkBufferL(), CreateSourceBufferL(), CropL(), Duration(), EmptyBufferL(), FrameTimeInterval(), GetDefaultSampleRate(), GetNumberOfMetaDataEntriesL(), GetSupportedBitRatesL(), GetSupportedDataTypesL(), GetSupportedNumChannelsL(), GetSupportedSampleRatesL(), ImplementationUid(), MaximumClipSize(), MetaDataEntryL(), NewL(), NewL(), NewL(), NewL(), NumChannels(), PositionL(), RemoveMetaDataEntry(), ReplaceMetaDataEntryL(), SampleRate(), SetBitRate(), SetMaximumClipSizeL(), SetNumChannels(), SetPositionL(), SetSampleRate(), SinkDataTypeCode(), SourceDataTypeCode(), iClip, iDataPath, ~CMMFFormatEncode()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from MDataSink:
BufferFilledL(), ConstructSinkL(), DataSinkType(), NegotiateL(), NewSinkL(), SetSinkDataTypeCode(), SetSinkPrioritySettings(), SinkCustomCommand(), SinkPauseL(), SinkPlayL(), SinkPrimeL(), SinkStopL(), SinkThreadLogoff(), SinkThreadLogon()

Inherited from MDataSource:
ConstructSourceL(), DataSourceType(), FillBufferL(), NegotiateSourceL(), NewSourceL(), SetSourceDataTypeCode(), SetSourcePrioritySettings(), SourceCustomCommand(), SourcePauseL(), SourcePlayL(), SourcePrimeL(), SourceSampleConvert(), SourceStopL(), SourceThreadLogoff(), SourceThreadLogon()


Construction and destruction


NewL()

static IMPORT_C 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()

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

Description

Parameters

const TDesC &aFileName

MDataSink *aSink

const TDesC &aPreferredSupplier

Return value

CMMFFormatEncode *


NewL()

static IMPORT_C 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 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.

Return value

CMMFFormatEncode *

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


NewL()

static IMPORT_C 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 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.

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()

inline TUid ImplementationUid() const;

Description

Gets the ECom plugin UID of this format.

Return value

TUid

The plugin UID.


FrameTimeInterval()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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.