CMMFDescriptorBuffer Class Reference

#include <mmf/server/mmfdatabuffer.h>

Link against: mmfserverbaseclasses.lib

class CMMFDescriptorBuffer : public CMMFDataBuffer

Inherits from

Detailed Description

This class is a wrapper class to give a descriptor the same API as a CMMFDataBuffer.

The purpose of this class is that components such as codecs can use CMMFDataBuffers transparently without having to be concerned with whether the buffer is a descriptor buffer or a transfer buffer.

Constructor & Destructor Documentation

~CMMFDescriptorBuffer ( )

IMPORT_C~CMMFDescriptorBuffer()

Destructor.

Destructor also deletes the buffer contained in the CMMFDescriptorBuffer.

Member Function Documentation

BufferSize ( )

TUint BufferSize()const [virtual]

Reimplemented from CMMFDataBuffer::BufferSize()const

Returns the actual data size (ie. not the maximum length) of the data contained in the CMMFDescriptorBuffer.

Returns: The size in bytes of the data contained in the CMMFDescriptorBuffer.

Data ( )

TDes8 &Data()[virtual]

Reimplemented from CMMFDataBuffer::Data()

Returns a descriptor to the data contained in the CMMFDescriptorBuffer.

Returns: A reference to a TPtr containing the CMMFDescriptorBuffer data.

Data ( )

const TDesC8 &Data()const [virtual]

Reimplemented from CMMFDataBuffer::Data()const

Returns a descriptor to the data contained in the CMMFDescriptorBuffer.

Returns: A const reference to a TPtr containing the CMMFDescriptorBuffer data.

NewL ( )

IMPORT_C CMMFDescriptorBuffer *NewL()[static]

Reimplemented from CMMFDataBuffer::NewL()

Method to instantiate a CMMFDescriptorBuffer.

Defaults to a CMMFDescriptorBuffer automatically. This NewL creates a CMMFDescriptorBuffer with a default size of 32 bytes.

Returns: A pointer to a new CMMFDescriptorBuffer.

NewL ( TInt )

IMPORT_C CMMFDescriptorBuffer *NewL(TIntaMaxBufferSize)[static]

Reimplemented from CMMFDataBuffer::NewL(TInt)

Method to instantiate a CMMFDescriptorBuffer. This NewL creates a CMMFDescriptorBuffer with a size of aMaxBufferSize bytes.

ParameterDescription
aMaxBufferSizeThe size in bytes of the descriptor buffer to be created.

Returns: A pointer to a new CMMFDescriptorBuffer.

ReAllocBufferL ( TInt )

IMPORT_C voidReAllocBufferL(TIntaMaxBufferSize)

Reallocates the max size in bytes of a CMMFDescriptorBuffer.

ParameterDescription
aMaxBufferSizeThe new size in bytes of the descriptor buffer.

SetPosition ( TUint )

voidSetPosition(TUintaPosition)[virtual]

Reimplemented from CMMFBuffer::SetPosition(TUint)

Sets the position.

This method is used by components (eg codecs) which read data from a buffer and wish to store a read position marker for further reads. Note: The position cannot exceed the size of the actual data not the max length.

ParameterDescription
aPositionThe position.

SetRequestSizeL ( TInt )

voidSetRequestSizeL(TIntaSize)[virtual]

Reimplemented from CMMFDataBuffer::SetRequestSizeL(TInt)

Sets the request size.

This function is used in cases where a component (eg a data source) may not be able or be desirable to write to the entire max length of the buffer (eg variable bit rate codecs). In which case the SetRequestSizeL() can be set which can be read by the RequestSize() function in the component so that it knows to only write data upto the request size and not fill the buffer up to its max length.

ParameterDescription
aSizeThe request size.

SetStatus ( TBufferStatus )

voidSetStatus(TBufferStatusaStatus)[virtual]

Reimplemented from CMMFBuffer::SetStatus(TBufferStatus)

Overriden method to set the status and resets the data size to 0 when the buffer becomes available.

ParameterDescription
aStatusThe buffer status. See TBufferStatus for possible options.