class CMMFPtrBuffer : public CMMFDataBuffer |
This class is a wrapper class intended to provide support for shared I/O buffers under EKA2 This class, unlike other data buffers does not own memory - rather it contains a pointer to already allocated memory 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 standard buffer or memory residing in shared I/O
Users of this class need to be very careful when using buffers of this type. It cannot be assumed that a buffer of this type can be written/read by any process other than the current one - example - handing CMMFPtrBuffer to the file server may not work since the file server's process may not have access to write data buffer.
Public Member Functions | |
---|---|
~CMMFPtrBuffer () | |
TUint | BufferSize () |
TDes8 & | Data () |
const TDesC8 & | Data () |
IMPORT_C CMMFPtrBuffer * | NewL () |
IMPORT_C CMMFPtrBuffer * | NewL (const TPtr8 &) |
void | SetPosition ( TUint ) |
IMPORT_C void | SetPtr (const TPtr8 &) |
void | SetRequestSizeL ( TInt ) |
void | SetStatus ( TBufferStatus ) |
Private Member Functions | |
---|---|
CMMFPtrBuffer () | |
void | ConstructL (const TPtr8 &) |
Private Attributes | |
---|---|
TPtr8 | iPtr |
Inherited Attributes | |
---|---|
CMMFBuffer::iFrameNumber | |
CMMFBuffer::iLastBuffer | |
CMMFBuffer::iPosition | |
CMMFBuffer::iRequestSize | |
CMMFBuffer::iStatus | |
CMMFBuffer::iTimeToPlay | |
CMMFBuffer::iType |
IMPORT_C | ~CMMFPtrBuffer | ( | ) |
Destructor.
Destructor does no deletion, as this buffer class does not own the memory.
TUint | BufferSize | ( | ) | const [virtual] |
Returns the actual data size (ie. not the max length) of the data contained in the CMMFPtrBuffer .
void | ConstructL | ( | const TPtr8 & | aPtr | ) | [private] |
ConstructL
Internal ConstructL
const TPtr8 & aPtr | Reference to a TPtr containing the CMMFPtrBuffer data |
const TDesC8 & | Data | ( | ) | const [virtual] |
Returns a descriptor to the data contained in the CMMFPtrBuffer .
IMPORT_C CMMFPtrBuffer * | NewL | ( | ) | [static] |
Function to instantiate a CMMFPtrBuffer . This NewL creates an unititalised CMMFPtrBuffer .
IMPORT_C CMMFPtrBuffer * | NewL | ( | const TPtr8 & | aPtr | ) | [static] |
Function to instantiate a CMMFPtrBuffer . This NewL creates a CMMFPtrBuffer which owns a TPtr8 .
const TPtr8 & aPtr | A reference to a TPtr containing the CMMFPtrBuffer data. |
void | SetPosition | ( | TUint | aPosition | ) | [virtual] |
Sets the position.
This function 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 maximum length.
TUint aPosition | The position. |
IMPORT_C void | SetPtr | ( | const TPtr8 & | aPtr | ) |
Takes a TPtr8 to pre-allocated memory.
const TPtr8 & aPtr | The pointer refernce. |
void | SetRequestSizeL | ( | TInt | aSize | ) | [virtual] |
Sets the request size.
This method 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 this 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 requested size and not fill the buffer up to its maximum length.
TInt aSize | The request size. |
void | SetStatus | ( | TBufferStatus | aStatus | ) | [virtual] |
Overriden method to set the status. Resets the data size to 0 when the buffer becomes available.
TBufferStatus aStatus | The buffer status. See enum TBufferStatus. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.