AVBlocks for .NET  1.13
Audio and Video Software Development Kit
MediaBuffer Class Reference

A buffer for media data. More...

Public Member Functions

 MediaBuffer (byte[] data)
 Creates a buffer by using the supplied byte array both as underlying storage and valid data. More...
 
bool SetData (int dataOffset, int dataSize)
 This is a convenience method that sets buffer data offset and size at once. More...
 

Properties

byte[] Bytes [get, set]
 The buffer storage. More...
 
int DataOffset [get, set]
 The offset at which valid data starts in the buffer. More...
 
int DataSize [get, set]
 The size of the valid data in the buffer. More...
 

Detailed Description

A buffer for media data.

MediaBuffer has a capacity which is the size of the buffer and data size which is the size of the actual data in the buffer. The buffer is a continuous block of memory. The valid data is also a continuous block. The data can start at any offset in the buffer.

Constructor & Destructor Documentation

MediaBuffer ( byte[]  data)

Creates a buffer by using the supplied byte array both as underlying storage and valid data.

Parameters
dataA byte array which is used by the new MediaBuffer instance.

Member Function Documentation

bool SetData ( int  dataOffset,
int  dataSize 
)

This is a convenience method that sets buffer data offset and size at once.

Parameters
dataOffsetThe offset in the buffer where valid data starts.
dataSizeThe size in bytes of the valid data in the buffer.
Returns
true if dataOffset and dataSize are accepted by the method and the valid data is set.

false if dataOffset and dataSize are not accepted by the method and the valid data is not set.

Property Documentation

byte [] Bytes
getset

The buffer storage.

int DataOffset
getset

The offset at which valid data starts in the buffer.

Data offset is validated when set.

int DataSize
getset

The size of the valid data in the buffer.

Data size is validated when set.

Referenced by Transcoder.Push().