#include <mmf/server/mmfformat.h>
class CMMFFormatEncode : public CBase, public MDataSource, public MDataSink |
Protected Attributes | |
---|---|
MDataSink * | iClip |
MDataSource * | iDataPath |
Protected Member Functions | |
---|---|
CMMFFormatEncode() | |
virtual void | ConstructSinkL(const TDesC8 &) |
virtual void | ConstructSourceL(const TDesC8 &) |
CMMFFormatEncode * | CreateFormatL(TUid, 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.
void | AddMetaDataEntryL | ( | const CMMFMetaDataEntry & | aNewEntry | ) | [inline, virtual] |
Adds the specified meta data entry to the clip.
The default implementation leaves with KErrNotSupported.
Parameters | |
---|---|
aNewEntry | The meta data entry to add. |
TUint | BitRate | ( | ) | [inline, virtual] |
Returns the bit rate.
The default returns 0.
void | BufferEmptiedL | ( | CMMFBuffer * | aBuffer | ) | [inline, virtual] |
Reimplemented from MDataSource::BufferEmptiedL(CMMFBuffer *)
Called by the clip when it has added the data to the file.
Parameters | |
---|---|
aBuffer | The emptied buffer. |
void | BufferFilledL | ( | CMMFBuffer * | aBuffer | ) | [inline, virtual] |
Reimplemented from MDataSink::BufferFilledL(CMMFBuffer *)
Called by the CMMFDataPath's MDataSource when it has filled the buffer.
Parameters | |
---|---|
aBuffer | The buffer that has been filled. |
TInt64 | BytesPerSecond | ( | ) | [inline, virtual] |
Returns the bytes per second.
The default returns 0.
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 ETrue.
TBool | CanCreateSourceBuffer | ( | ) | [inline, virtual] |
Reimplemented from MDataSource::CanCreateSourceBuffer()
Tests whether a source buffer can be created.
The default implementation returns EFalse.
void | ConstructSinkL | ( | const TDesC8 & | ) | [protected, inline, virtual] |
Reimplemented from MDataSink::ConstructSinkL(const TDesC8 &)
void | ConstructSourceL | ( | const TDesC8 & | ) | [protected, inline, virtual] |
Reimplemented from MDataSource::ConstructSourceL(const TDesC8 &)
CMMFFormatEncode * | CreateFormatL | ( | TUid | aImplementationUid, |
MDataSink * | aSink | |||
) | [protected, static] |
CMMFBuffer * | CreateSinkBufferL | ( | TMediaId | aMediaId, |
TBool & | aReference | |||
) | [pure virtual] |
Reimplemented from MDataSink::CreateSinkBufferL(TMediaId,TBool &)
Creates a sink buffer for the specified media ID.
This is a virtual function that each derived class must implement.
If EFalse, then the caller owns the buffer.
Parameters | |
---|---|
aMediaId | The media type ID. |
aReference | If ETrue then MDataSink owns the buffer. |
CMMFBuffer * | CreateSourceBufferL | ( | TMediaId | aMediaId, |
TBool & | aReference | |||
) | [inline, virtual] |
Reimplemented from MDataSource::CreateSourceBufferL(TMediaId,TBool &)
Creates a source buffer. The default returns NULL.
If EFalse, then the caller owns the buffer.
Parameters | |
---|---|
aMediaId | The media type id. |
aReference | If ETrue the MDataSource owns the buffer. |
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 | |
---|---|
aPosition | The position within the clip. |
aToEnd | Flag to determine which part of the clip to delete. |
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 | |
---|---|
aMediaType | The media type ID. |
void | EmptyBufferL | ( | CMMFBuffer * | aBuffer, |
MDataSource * | aSupplier, | |||
TMediaId | aMediaId | |||
) | [pure virtual] |
Reimplemented from MDataSink::EmptyBufferL(CMMFBuffer *,MDataSource *,TMediaId)
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 | |
---|---|
aBuffer | The buffer to which the clip is added. |
aSupplier | The data source. |
aMediaId | The media type ID. |
void | FillBufferL | ( | CMMFBuffer * | aBuffer, |
MDataSink * | aConsumer, | |||
TMediaId | aMediaId | |||
) | [inline, virtual] |
Reimplemented from MDataSource::FillBufferL(CMMFBuffer *,MDataSink *,TMediaId)
Request from CMMFDataPath to fill the specified buffer.
Parameters | |
---|---|
aBuffer | The buffer to fill. |
aConsumer | The consumer. |
aMediaId | The media ID. |
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 | |
---|---|
aMediaType | The media type ID. |
TUint | GetDefaultSampleRate | ( | ) | [inline, virtual] |
Returns the default sample rate.
The default returns 0.
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 | |
---|---|
aNumberOfEntries | On return, contains the number of meta data entries. |
Gets the supported data types for the given media type ID.
The default implementation leaves with KErrNotSupported.
Parameters | |
---|---|
aMediaId | The media type id. |
aDataTypes | A reference to an array of supported data types. |
TUid | ImplementationUid | ( | ) | const [inline] |
Gets the ECom plugin UID of this format.
TInt | MaximumClipSize | ( | ) | [inline, virtual] |
Returns the maximum clip size.
The default returns 0.
CMMFMetaDataEntry * | MetaDataEntryL | ( | TInt | aIndex | ) | [inline, virtual] |
Returns the specified meta data entry.
The default implementation leaves with KErrNotSupported.
Parameters | |
---|---|
aIndex | The zero based meta data entry index to retrieve. |
IMPORT_C CMMFFormatEncode * | NewL | ( | TUid | aUid, |
MDataSink * | aSink | |||
) | [static] |
Allocates and constructs an ECom format encode object.
leaves with KErrNotFound.
Parameters | |
---|---|
aUid | The implementation UID. |
aSink | The data sink. |
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.
plugin supplied by supplier named.
leaves with KErrNotFound.
Parameters | |
---|---|
aFileName | File name of target file. May be extension only or may include the full path. |
aSink | The data source. |
aPreferredSupplier | If this is provided, the list of matching plugins will be further searched for the latest version of a |
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.
plugin supplied by supplier named.
leaves with KErrNotFound.
Parameters | |
---|---|
aSourceHeader | The data which is searched for matching signatures. |
aSink | The data sink. |
aPreferredSupplier | If this is provided the list of matching plugins will be further searched for the latest version of a |
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.
plugin supplied by supplier specified.
leaves with KErrNotFound.
Parameters | |
---|---|
aSink | The header data. Must be derived from CMMFClip. |
aPreferredSupplier | If this is provided, the list of matching plugins will be further searched for the latest version of a |
TUint | NumChannels | ( | ) | [inline, virtual] |
Returns the number of channels.
The default implementation returns 0.
TTimeIntervalMicroSeconds | PositionL | ( | ) | [inline, virtual] |
Supplies the current position.
Subsequent data reads will commence from this position.
Removes the specified meta data entry.
The default implementation returns KErrNotSupported.
another of the system-wide error codes.
Parameters | |
---|---|
aIndex | The zero based meta data entry index to remove. |
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 | |
---|---|
aIndex | The zero based meta data entry index to replace. |
aNewEntry | The meta data entry to replace. |
TUint | SampleRate | ( | ) | [inline, virtual] |
Returns the sample rate.
The default implementation returns 0.
void | SetMaximumClipSizeL | ( | TInt | aBytes | ) | [inline, virtual] |
Sets the maximum clip size.
The default implementation leaves with KErrNotSupported.
Parameters | |
---|---|
aBytes | The maximum clip size. |
Sets the number of channels.
The default implementation returns KErrNotSupported.
another of the system-wide error codes.
Parameters | |
---|---|
aChannels | The number of channels. |
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 | |
---|---|
aPosition | The position the format should use. |
Sets the sample rate.
The default implementation returns KErrNotSupported.
another of the system-wide error codes.
Parameters | |
---|---|
aSampleRate | The sample rate. |
Reimplemented from MDataSink::SinkDataTypeCode(TMediaId)
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 | |
---|---|
aMediaId | The media type ID. |
Reimplemented from MDataSource::SourceDataTypeCode(TMediaId)
Returns the source data type code for the specified media type ID.
This is a virtual function that each derived class must implement.
Parameters | |
---|---|
aMediaId | The media type id. |