|
||
class CMMFFormatEncode : public CBase, public MDataSource, public MDataSink;
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.
MDataSink
-
Abstract class representing a data sink.
MDataSource
-
Abstract class representing a data source.
CBase
-
Base class for all classes to be instantiated on the heap.
CMMFFormatEncode
-
Base class from which sink formats can be derived from.
Defined in CMMFFormatEncode
:
AddMetaDataEntryL(const CMMFMetaDataEntry &)
Adds the specified meta data entry to the clip.BitRate()
Returns the bit rate.BufferEmptiedL(CMMFBuffer *)
Called by the clip when it has added the data to the file.BytesPerSecond()
Returns the bytes per second.CMMFFormatEncode()
Default constructorCanCreateSinkBuffer()
Tests whether a sink buffer can be created.CanCreateSourceBuffer()
Tests whether a source buffer can be created.CreateSinkBufferL(TMediaId,TBool &)
Creates a sink buffer for the specified media ID.CreateSourceBufferL(TMediaId,TBool &)
Creates a source buffer. The default returns NULL.CropL(TTimeIntervalMicroSeconds,TBool)
This function is used to truncate the sink ie. a CMMFClip,Duration(TMediaId)const
Returns the duration of the sink clip for the specified media type.EmptyBufferL(CMMFBuffer *,MDataSource *,TMediaId)
Adds a buffer to a clip.FrameTimeInterval(TMediaId)const
Returns the time interval for one frame for the specified media type.GetDefaultSampleRate()
Returns the default sample rate.GetNumberOfMetaDataEntriesL(TInt &)
Gets the number of meta data entries.GetSupportedBitRatesL(RArray< TUint > &)
Gets the supported bit rates.GetSupportedDataTypesL(TMediaId,RArray< TFourCC > &)
Gets the supported data types for the given media type ID.GetSupportedNumChannelsL(RArray< TUint > &)
Gets the supported number of channels.GetSupportedSampleRatesL(RArray< TUint > &)
Gets the supported sample rates.ImplementationUid()const
Gets the ECom plugin UID of this format.MaximumClipSize()
Returns the maximum clip size.MetaDataEntryL(TInt)
Returns the specified meta data entry.NewL(MDataSink *,const TDesC &)
Attempts to locate and instantiate a CMMFFormatEncode using data from aSink.NewL(TUid,MDataSink *)
Allocates and constructs an ECom format encode object.NewL(const TDesC &,MDataSink *,const TDesC &)
NewL(const TDesC8 &,MDataSink *,const TDesC &)
Attempts to locate and instantiate a CMMFFormatEncode using data in the specifie...NumChannels()
Returns the number of channels.PositionL()
Supplies the current position.RemoveMetaDataEntry(TInt)
Removes the specified meta data entry.ReplaceMetaDataEntryL(TInt,const CMMFMetaDataEntry &)
Replaces the specified meta data entry with the entry supplied in aNewEntry.SampleRate()
Returns the sample rate.SetBitRate(TUint)
Sets the bit rate.SetMaximumClipSizeL(TInt)
Sets the maximum clip size.SetNumChannels(TUint)
Sets the number of channels.SetPositionL(const TTimeIntervalMicroSeconds &)
Used to set the format's position.SetSampleRate(TUint)
Sets the sample rate.SinkDataTypeCode(TMediaId)
Returns the sink data type code for the specified media type ID.SourceDataTypeCode(TMediaId)
Returns the source data type code for the specified media type ID.iClip
The clip is the sink for the encode format.iDataPath
The Data path is the source for the encode format.~CMMFFormatEncode()
Destructor.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from MDataSink
:
BufferFilledL(CMMFBuffer *)
Function called by a data source to pass back a filled buffer to the sink.ConstructSinkL(const TDesC8 &)
Performs any sink construction dependant on the sink construction initialisation...DataSinkType()const
Returns the UID identifying the type of data sink.MDataSink(TUid)
Protected constructor.NegotiateL(MDataSource &)
Allows the data sink to negotiate with a data source.NewSinkL(TUid,const TDesC8 &)
Instantiates a new data sink.SetSinkDataTypeCode(TFourCC,TMediaId)
Sets the data type as a fourCC code for the data sink.SetSinkPrioritySettings(const TMMFPrioritySettings &)
Sets the sink priority settings.SinkCustomCommand(TMMFMessage &)
Calls a sink specific custom command.SinkPauseL()
Function to 'pause' the data sink.SinkPlayL()
Function 'play' the data sink.SinkPrimeL()
Function to 'prime' the data sink.SinkStopL()
Function to 'stop' the data sink.SinkThreadLogoff()
Function to 'logoff' the data sink from the same thread that sink consumes data ...SinkThreadLogon(MAsyncEventHandler &)
Function to 'logon' the data sink to the same thread that sink will be consuming...Inherited from MDataSource
:
ConstructSourceL(const TDesC8 &)
Performs any source construction dependant on the source construction initialisa...CreateSourceBufferL(TMediaId,CMMFBuffer &,TBool &)
Returns a buffer created by the data source.DataSourceType()const
Returns the UID identifying the type of data source.FillBufferL(CMMFBuffer *,MDataSink *,TMediaId)
Function called by a MDataSink to request the data source to fill aBuffer with d...MDataSource(TUid)
Protected constructor.NegotiateSourceL(MDataSink &)
Function to allow the data source to negotiate with a data sinkNewSourceL(TUid,const TDesC8 &)
Instantiates a data source.SetSourceDataTypeCode(TFourCC,TMediaId)
Sets the data type as a fourCC code for the data source.SetSourcePrioritySettings(const TMMFPrioritySettings &)
Function to set the source priority settings.SourceCustomCommand(TMMFMessage &)
Function to call a source specific custom command.SourcePauseL()
Function to 'pause' the data source.SourcePlayL()
Function to 'play' the data source.SourcePrimeL()
Function to 'prime' the data source.SourceSampleConvert()
Indicates whether the data source supports sample rate conversion.SourceStopL()
Function to 'stop' the data source.SourceThreadLogoff()
Function to 'logoff' the data source from the same thread that source supplies d...SourceThreadLogon(MAsyncEventHandler &)
Function to 'logon' the data source to the same thread that source will be suppl...IMPORT_C static CMMFFormatEncode* NewL(TUid aUid, MDataSink *aSink);
Allocates and constructs an ECom format encode object.
|
|
IMPORT_C static CMMFFormatEncode* NewL(const TDesC &aFileName, MDataSink *aSink, const TDesC &aPreferredSupplier);
|
|
IMPORT_C static CMMFFormatEncode* NewL(const TDesC8 &aSourceHeader, MDataSink *aSink, const TDesC &aPreferredSupplier);
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.
|
|
IMPORT_C static CMMFFormatEncode* NewL(MDataSink *aSink, const TDesC &aPreferredSupplier);
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.
|
|
inline TUid ImplementationUid() const;
Gets the ECom plugin UID of this format.
|
virtual TTimeIntervalMicroSeconds FrameTimeInterval(TMediaId aMediaType) const=0;
Returns the time interval for one frame for the specified media type.
This is a virtual function that each derived class must implement.
|
|
virtual TTimeIntervalMicroSeconds Duration(TMediaId aMediaType) const=0;
Returns the duration of the sink clip for the specified media type.
This is a virtual function that each derived class must implement.
|
|
inline virtual void BufferEmptiedL(CMMFBuffer *aBuffer);
Called by the clip when it has added the data to the file.
|
inline virtual TBool CanCreateSourceBuffer();
Tests whether a source buffer can be created.
The default implementation returns EFalse.
|
inline virtual CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, TBool &aReference);
Creates a source buffer. The default returns NULL.
|
|
inline virtual TFourCC SourceDataTypeCode(TMediaId aMediaId);
Returns the source data type code for the specified media type ID.
This is a virtual function that each derived class must implement.
|
|
virtual void EmptyBufferL(CMMFBuffer *aBuffer, MDataSource *aSupplier, TMediaId aMediaId)=0;
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.
|
inline virtual TBool 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 ETrue.
|
virtual CMMFBuffer* CreateSinkBufferL(TMediaId aMediaId, TBool &aReference)=0;
Creates a sink buffer for the specified media ID.
This is a virtual function that each derived class must implement.
|
|
virtual TFourCC SinkDataTypeCode(TMediaId aMediaId)=0;
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.
|
|
inline virtual void CropL(TTimeIntervalMicroSeconds aPosition, TBool aToEnd=ETrue);
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.
|
inline virtual void GetNumberOfMetaDataEntriesL(TInt &aNumberOfEntries);
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.
|
inline virtual CMMFMetaDataEntry* MetaDataEntryL(TInt aIndex);
Returns the specified meta data entry.
The default implementation leaves with KErrNotSupported.
|
|
inline virtual void AddMetaDataEntryL(const CMMFMetaDataEntry &aNewEntry);
Adds the specified meta data entry to the clip.
The default implementation leaves with KErrNotSupported.
|
inline virtual TInt RemoveMetaDataEntry(TInt aIndex);
Removes the specified meta data entry.
The default implementation returns KErrNotSupported.
|
|
inline virtual void ReplaceMetaDataEntryL(TInt aIndex, const CMMFMetaDataEntry &aNewEntry);
Replaces the specified meta data entry with the entry supplied in aNewEntry.
The default implementation leaves with KErrNotSupported.
|
inline virtual TInt SetNumChannels(TUint aChannels);
Sets the number of channels.
The default implementation returns KErrNotSupported.
|
|
inline virtual TInt SetSampleRate(TUint aSampleRate);
Sets the sample rate.
The default implementation returns KErrNotSupported.
|
|
inline virtual TInt SetBitRate(TUint aBitRate);
Sets the bit rate.
The default implementation returns KErrNotSupported.
|
|
inline virtual TUint NumChannels();
Returns the number of channels.
The default implementation returns 0.
|
inline virtual TUint SampleRate();
Returns the sample rate.
The default implementation returns 0.
|
inline virtual TUint GetDefaultSampleRate();
Returns the default sample rate.
The default returns 0.
|
inline virtual TUint BitRate();
Returns the bit rate.
The default returns 0.
|
inline virtual TInt64 BytesPerSecond();
Returns the bytes per second.
The default returns 0.
|
inline virtual void GetSupportedSampleRatesL(RArray< TUint > &aSampleRates);
Gets the supported sample rates.
The default implementation leaves with KErrNotSupported.
|
inline virtual void GetSupportedBitRatesL(RArray< TUint > &aBitRates);
Gets the supported bit rates.
The default implementation leaves with KErrNotSupported.
|
inline virtual void GetSupportedNumChannelsL(RArray< TUint > &aNumChannels);
Gets the supported number of channels.
The default implementation leaves with KErrNotSupported.
|
inline virtual void GetSupportedDataTypesL(TMediaId aMediaId, RArray< TFourCC > &aDataTypes);
Gets the supported data types for the given media type ID.
The default implementation leaves with KErrNotSupported.
|
inline virtual void SetMaximumClipSizeL(TInt aBytes);
Sets the maximum clip size.
The default implementation leaves with KErrNotSupported.
|
inline virtual TInt MaximumClipSize();
Returns the maximum clip size.
The default returns 0.
|
inline virtual void SetPositionL(const TTimeIntervalMicroSeconds &aPosition);
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
|
inline virtual TTimeIntervalMicroSeconds PositionL();
Supplies the current position.
Subsequent data reads will commence from this position.
|
protected: MDataSink * iClip;
The clip is the sink for the encode format.