Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <mmfdatabuffer.h>
Link against: mmfserverbaseclasses.lib

Class CMMFDescriptorBuffer

class CMMFDescriptorBuffer : public CMMFDataBuffer;

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.

Derivation

Members

Defined in CMMFDescriptorBuffer:

Inherited from CBase:

Inherited from CMMFBuffer:

Inherited from CMMFDataBuffer:


Construction and destruction


NewL()

IMPORT_C static CMMFDescriptorBuffer* NewL();

Description

Method to instantiate a CMMFDescriptorBuffer.

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

Return value

CMMFDescriptorBuffer *

A pointer to a new CMMFDescriptorBuffer.


NewL(TInt)

IMPORT_C static CMMFDescriptorBuffer* NewL(TInt aMaxBufferSize);

Description

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

Parameters

TInt aMaxBufferSize

The size in bytes of the descriptor buffer to be created.

Return value

CMMFDescriptorBuffer *

A pointer to a new CMMFDescriptorBuffer.


~CMMFDescriptorBuffer()

IMPORT_C ~CMMFDescriptorBuffer();

Description

Destructor.

Destructor also deletes the buffer contained in the CMMFDescriptorBuffer.

[Top]


Member functions


ReAllocBufferL(TInt)

IMPORT_C void ReAllocBufferL(TInt aMaxBufferSize);

Description

Reallocates the max size in bytes of a CMMFDescriptorBuffer.

Parameters

TInt aMaxBufferSize

The new size in bytes of the descriptor buffer.


Data()

virtual TDes8& Data();

Description

Returns a descriptor to the data contained in the CMMFDescriptorBuffer.

Return value

TDes8 &

A reference to a TPtr containing the CMMFDescriptorBuffer data.


Data()const

virtual const TDesC8& Data() const;

Description

Returns a descriptor to the data contained in the CMMFDescriptorBuffer.

Return value

const TDesC8 &

A const reference to a TPtr containing the CMMFDescriptorBuffer data.


SetStatus(TBufferStatus)

virtual void SetStatus(TBufferStatus aStatus);

Description

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

Parameters

TBufferStatus aStatus

The buffer status. See TBufferStatus for possible options.


SetRequestSizeL(TInt)

virtual void SetRequestSizeL(TInt aSize);

Description

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 CMMFDescriptorBuffer::SetRequestSizeL(TInt) can be set which can be read by the CMMFBuffer::RequestSize()const 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.

Parameters

TInt aSize

The request size.


BufferSize()const

virtual TUint BufferSize() const;

Description

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

Return value

TUint

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


SetPosition(TUint)

virtual void SetPosition(TUint aPosition);

Description

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.

Parameters

TUint aPosition

The position.