CMMFDescriptor Class Reference

#include <mmf/server/mmfdes.h>

class CMMFDescriptor : public CMMFClip
Public Member Functions
virtual ~CMMFDescriptor()
virtual voidBufferEmptiedL(CMMFBuffer *)
virtual voidBufferFilledL(CMMFBuffer *)
virtual TInt64 BytesFree()
virtual TBool CanCreateSinkBuffer()
virtual TBool CanCreateSourceBuffer()
TBool CanUseTransferBuffer()
virtual CMMFBuffer *CreateSinkBufferL(TMediaId, TBool &)
virtual CMMFBuffer *CreateSourceBufferL(TMediaId, TBool &)
virtual voidEmptyBufferL(CMMFBuffer *, MDataSource *, TMediaId)
virtual voidFillBufferL(CMMFBuffer *, MDataSink *, TMediaId)
MDataSink *NewSinkL()
MDataSource *NewSourceL()
virtual voidReadBufferL(TInt, CMMFBuffer *, TInt, MDataSink *)
virtual voidReadBufferL(CMMFBuffer *, TInt, MDataSink *)
virtual voidReadBufferL(CMMFBuffer *, TInt)
virtual TInt SetSize(TInt)
voidSetTransferBuffer(TBool)
virtual TFourCC SinkDataTypeCode(TMediaId)
virtual TInt Size()
virtual TFourCC SourceDataTypeCode(TMediaId)
virtual voidWriteBufferL(TInt, CMMFBuffer *, TInt, MDataSource *)
virtual voidWriteBufferL(CMMFBuffer *, TInt, MDataSource *)
virtual voidWriteBufferL(CMMFBuffer *, TInt)
Protected Member Functions
CMMFDescriptor()
voidConstructL(const TDesC8 &)
virtual voidConstructSinkL(const TDesC8 &)
virtual voidConstructSourceL(const TDesC8 &)
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()
CMMFClip::CMMFClip(TUid,TUid)
CMMFClip::Delete()
MDataSink::DataSinkType()const
MDataSink::MDataSink(TUid)
MDataSink::NegotiateL(MDataSource &)
MDataSink::NewSinkL(TUid,const TDesC8 &)
MDataSink::NewSinkLC(TUid,const TDesC8 &)
MDataSink::SetSinkDataTypeCode(TFourCC,TMediaId)
MDataSink::SetSinkPrioritySettings(const TMMFPrioritySettings &)
MDataSink::SinkCustomCommand(TMMFMessage &)
MDataSink::SinkPauseL()
MDataSink::SinkPlayL()
MDataSink::SinkPrimeL()
MDataSink::SinkStopL()
MDataSink::SinkThreadLogoff()
MDataSink::SinkThreadLogon(MAsyncEventHandler &)
MDataSink::~MDataSink()
MDataSource::CreateSourceBufferL(TMediaId,CMMFBuffer &,TBool &)
MDataSource::DataSourceType()const
MDataSource::MDataSource(TUid)
MDataSource::NegotiateSourceL(MDataSink &)
MDataSource::NewSourceL(TUid,const TDesC8 &)
MDataSource::NewSourceLC(TUid,const TDesC8 &)
MDataSource::SetSourceDataTypeCode(TFourCC,TMediaId)
MDataSource::SetSourcePrioritySettings(const TMMFPrioritySettings &)
MDataSource::SourceCustomCommand(TMMFMessage &)
MDataSource::SourcePauseL()
MDataSource::SourcePlayL()
MDataSource::SourcePrimeL()
MDataSource::SourceSampleConvert()
MDataSource::SourceStopL()
MDataSource::SourceThreadLogoff()
MDataSource::SourceThreadLogon(MAsyncEventHandler &)
MDataSource::~MDataSource()

Detailed Description

MultiMedia framework class. Represents a client side descriptor. May be source descriptor from which data is read or destination to which data is written

Constructor & Destructor Documentation

CMMFDescriptor ( )

CMMFDescriptor()[protected]

~CMMFDescriptor ( )

~CMMFDescriptor()[virtual]

Member Function Documentation

BufferEmptiedL ( CMMFBuffer * )

voidBufferEmptiedL(CMMFBuffer *aBuffer)[virtual]

Function called by a data sink to pass back an emptied buffer to the source.

This is a pure virtual function that each derived class must implement. This method is used as the callback when the data source actively requests a consumer ie. a data sink to empty a buffer by calling the data sinks EmptyBufferL. When the data source gets this callback it knows that the buffer has been emptied and can be reused.

Parameters
aBufferThe buffer that has been emptied by a data sink and is now available for reuse.

BufferFilledL ( CMMFBuffer * )

voidBufferFilledL(CMMFBuffer *aBuffer)[virtual]

Function called by a data source to pass back a filled buffer to the sink.

This is a pure virtual function that each derived class must implement. This method is used as the callback when the data sink actively requests a supplier ie. a data source to fill a buffer by calling the data sources FillBufferL. When the data sink gets this callback it knows that the buffer has been filled and is ready to be emptied.

Parameters
aBufferThe buffer that has been filled by a data source and is now available for processing.

BytesFree ( )

TInt64 BytesFree()[virtual]

Reimplemented from CMMFClip::BytesFree()

Returns the amount of space available for the clip.

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

Return Value
The amount of space available.

CanCreateSinkBuffer ( )

TBool CanCreateSinkBuffer()[virtual]

Deprecated

Function to indicate whether the data sink can create a buffer.

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

Return Value
A boolean indicating if the data sink can create a buffer. ETrue if it can otherwise EFalse.

CanCreateSourceBuffer ( )

TBool CanCreateSourceBuffer()[virtual]

Deprecated

Function to indicate whether the data source can create a buffer.

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

Return Value
A boolean indicating if the data source can create a buffer. ETrue if it can otherwise EFalse.

CanUseTransferBuffer ( )

TBool CanUseTransferBuffer()

ConstructL ( const TDesC8 & )

voidConstructL(const TDesC8 &aInitData)[protected]

ConstructSinkL ( const TDesC8 & )

voidConstructSinkL(const TDesC8 &aInitData)[protected, virtual]

Performs any sink construction dependant on the sink construction initialisation data aInitData.

This is a pure virtual function that a derrived data sink must implement

Parameters
aInitDataThe sink specific initialisation data required for sink construction.

ConstructSourceL ( const TDesC8 & )

voidConstructSourceL(const TDesC8 &aInitData)[protected, virtual]

Performs any source construction dependant on the source construction initialisation data aInitData.

This is a pure virtual function that a derrived data source must implement

Parameters
aInitDataThe source specific initialisation data required for source construction.

CreateSinkBufferL ( TMediaId, TBool & )

CMMFBuffer *CreateSinkBufferL(TMediaIdaMediaId,
TBool &aReference
)[virtual]

Returns a buffer created by the data sink.

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

Parameters
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the source can supply data of more than one media type and/or multiple streams of data.
aReferenceThis must be written to by the method to indicate whether the created buffer is a 'reference' buffer. A 'reference' buffer is a buffer that is owned by the sink and should be used in preference to the source buffer provided the source buffer is also not a reference buffer.
Return Value
The created buffer.

CreateSourceBufferL ( TMediaId, TBool & )

CMMFBuffer *CreateSourceBufferL(TMediaIdaMediaId,
TBool &aReference
)[virtual]

Deprecated

Returns a buffer created by the data source

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

Parameters
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the source can supply data of more than one media type and/or multiple strams of data eg a multimedia file.
aReferenceThis must be written to by the method to indicate whether the created buffer is a 'reference' buffer. A 'reference' buffer is a buffer that is owned by the source and should be used in preference to the sink buffer provided the sink buffer is also not a reference buffer.
Return Value
A pointer to the created buffer.

EmptyBufferL ( CMMFBuffer *, MDataSource *, TMediaId )

voidEmptyBufferL(CMMFBuffer *aBuffer,
MDataSource *aSupplier,
TMediaIdaMediaId
)[virtual]

Method called by a MDataSource to request the data sink to empty aBuffer of data.

This is a pure virtual function that each derived class must implement. This method is used when a data sink is passively waiting for requests from a supplier ie. a data source to empty a buffer. The data sink must call the BufferEmptiedL member on aSupplier when it has emptied the buffer of it's data. The data sink can either make this callback synchronously or asynchronously.

Parameters
aBufferThe full buffer that needs emptying of it's data.
aSupplierThe data source that supplied the data. The data sink needs this to make the BufferEmptiedL callback on aSupplier to indicate to the data source that the data sink has finished with the buffer.
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the source can supply data of more than one media type and/or multiple streams of data.

FillBufferL ( CMMFBuffer *, MDataSink *, TMediaId )

voidFillBufferL(CMMFBuffer *aBuffer,
MDataSink *aConsumer,
TMediaIdaMediaId
)[virtual]

Function called by a MDataSink to request the data source to fill aBuffer with data.

This is a pure virtual function that each derived class must implement. This method is used when a data source is passively waiting for requests from a consumer ie. a data sink to fill a buffer. The data source must call the BufferFilledL member on aConsumer when it has filled the buffer with data. The data source can either make this callback synchronously or asynchronously.

The format should read the frame number of the buffer via the buffer's CMMFBuffer::FrameNumber() function. From this, the format should be able to determine the actual position of the data on the data source. The technique here depends on the nature of the format. For a linear audio format, the position can be obtained by a simple calculation of the frame size, the header size and where appropriate the datatype.

For non-linear formats, either an index table of frame number and location will need to be created in the NewL() or some form of approximating algorithm will be required. Some formats have an index table as part of the format eg. AVI. If no random access is required then no index table is required, the format can keep track of the current read position and increment it on each access, and reset it if the frame number is reset to 0 or 1. Given that for non-linear ie. variable bit rate formats, the size of the data read may vary from frame to frame, then the format should either set the request size of the buffer for the required frame or call the source's ReadBufferL() (either CMMFClip::ReadBufferL(), CMMFDescriptor ::ReadBufferL() or CMMFFile::ReadBufferL()) function that takes the aLength parameter.

It is the responsibility of the format decode to determine the size and position of the source data for each frame. For linear audio formats, the format decode should fill the buffer up to its maximum length. For multimedia formats e.g. mp4, AVI etc, the format decode is effectively acting as a demultiplexor, and must obtain the appropriate data from the source depending on the aMediaId.

Parameters
aBufferThe buffer that needs filling with data.
aConsumerThe data sink that consumes the data. The data source needs this to make the BufferFilledL callback on aConsumer when the data source has completed filling the aBuffer.
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the source can supply data of more than one media type and/or multiple strams of data eg. a multimedia file.

NewSinkL ( )

MDataSink *NewSinkL()[static]

NewSourceL ( )

MDataSource *NewSourceL()[static]

ReadBufferL ( TInt, CMMFBuffer *, TInt, MDataSink * )

voidReadBufferL(TIntaLength,
CMMFBuffer *aBuffer,
TIntaPosition,
MDataSink *aConsumer
)[virtual]

Reads aLength number of bytes of data from the offset, aPosition into the buffer, aBuffer.

Intended for asynchronous usage.

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

Parameters
aLengthThe number of bytes to read.
aBufferThe buffer to read the data into.
aPositionThe offset from which to start reading.
aConsumerThe sink of tha data read from the clip. Will be informed of read if not NULL.

ReadBufferL ( CMMFBuffer *, TInt, MDataSink * )

voidReadBufferL(CMMFBuffer *aBuffer,
TIntaPosition,
MDataSink *aConsumer
)[virtual]

Reads the maximum number of bytes of data from the offset, aPosition into the buffer, aBuffer.

Intended for asynchronous usage.

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

Parameters
aBufferThe buffer to read the data into.
aPositionThe offset from which to start reading.
aConsumerThe sink of tha data read from the clip. Will be informed of read if not NULL.

ReadBufferL ( CMMFBuffer *, TInt )

voidReadBufferL(CMMFBuffer *aBuffer,
TIntaPosition
)[virtual]

Reads the maximum number of bytes of data from the offset, aPosition into the buffer, aBuffer.

Intended for synchronous usage.

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

Parameters
aBufferThe buffer to read the data into.
aPositionThe offset from which to start reading.

SetSize ( TInt )

TInt SetSize(TIntaSize)[virtual]

Reimplemented from CMMFClip::SetSize(TInt)

Sets the size of the clip. This should be overriden in the derived

classes, the default version returns KErrNotSupported.

another of the system-wide error codes.

Parameters
aSizeThe size of the clip.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise

SetTransferBuffer ( TBool )

voidSetTransferBuffer(TBoolaTBuffer)

SinkDataTypeCode ( TMediaId )

TFourCC SinkDataTypeCode(TMediaIdaMediaId)[virtual]

Returns the data type as a fourCC code of the data sink.

This is a pure virtual function that each derrived class must implement.

Parameters
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the sink can accept data of more than one media type and/or multiple streams of data.
Return Value
The fourCC code identifying the sink datatype for the specified aMediaId.

Size ( )

TInt Size()[virtual]

Reimplemented from CMMFClip::Size()

Returns the size of the clip in bytes.

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

Return Value
The size of the clip.

SourceDataTypeCode ( TMediaId )

TFourCC SourceDataTypeCode(TMediaIdaMediaId)[virtual]

Returns the data type as a fourCC code of the data source.

This is a pure virtual function that each derrived class must implement.

Parameters
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the source can supply data of more than one media type and/or multiple streams of data.
Return Value
The fourCC code identifying the source datatype for the specified aMediaId.

WriteBufferL ( TInt, CMMFBuffer *, TInt, MDataSource * )

voidWriteBufferL(TIntaLength,
CMMFBuffer *aBuffer,
TIntaPosition,
MDataSource *aSupplier
)[virtual]

Writes aLength number of bytes of data from the offset, aPosition from the buffer, aBuffer.

Intended for asynchronous usage.

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

Parameters
aLengthThe number of bytes to write.
aBufferThe buffer to write the data into.
aPositionThe offset from which to start writing.
aSupplierThe source of the data writen to the clip. Will be informed of write if not NULL.

WriteBufferL ( CMMFBuffer *, TInt, MDataSource * )

voidWriteBufferL(CMMFBuffer *aBuffer,
TIntaPosition,
MDataSource *aSupplier
)[virtual]

Writes the maximum number of bytes of data from the offset, aPosition from the buffer, aBuffer.

Intended for asynchronous usage.

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

Parameters
aBufferThe buffer to write the data into.
aPositionThe offset from which to start writing.
aSupplierThe source of the data writen to the clip. Will be informed of write if not NULL.

WriteBufferL ( CMMFBuffer *, TInt )

voidWriteBufferL(CMMFBuffer *aBuffer,
TIntaPosition
)[virtual]

Writes the maximum number of bytes of data from the offset, aPosition from the buffer, aBuffer.

Intended for synchronous usage.

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

Parameters
aBufferThe buffer to write the data into.
aPositionThe offset from which to start writing.