|
AVBlocks for .NET
1.21
Audio and Video Software Development Kit
|
A buffer for media data. More...
Public Member Functions | |
| MediaBuffer () | |
| Creates a MediaBuffer object with no data. More... | |
| MediaBuffer (byte[] data) | |
| Creates a buffer by using the supplied byte array for the internal data buffer. More... | |
| MediaBuffer (int bufferSize) | |
| Creates a buffer by specifying the size of the internal data buffer. More... | |
| bool | Attach (byte[] buffer, bool setData) |
| Attaches an external buffer storage More... | |
| virtual object | Clone () |
| Creates a deep copy of this object. More... | |
| byte[] | Detach () |
| Detaches an external data buffer 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] |
| int | DataOffset [get] |
| The offset at which valid data starts in the data buffer. More... | |
| int | DataSize [get] |
| The size of the data that is still valid in the data buffer. More... | |
| bool | External [get] |
| Indicates that MediaBuffer uses an external data buffer. More... | |
| byte[] | Start [get] |
| Data buffer. More... | |
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.
| MediaBuffer | ( | ) |
Creates a MediaBuffer object with no data.
| MediaBuffer | ( | byte[] | data | ) |
Creates a buffer by using the supplied byte array for the internal data buffer.
| data | A byte array which is used by the new MediaBuffer instance. |
| MediaBuffer | ( | int | bufferSize | ) |
Creates a buffer by specifying the size of the internal data buffer.
| bufferSize | Specifies the size of the internal storage |
| bool Attach | ( | byte[] | buffer, |
| bool | setData | ||
| ) |
Attaches an external buffer storage
| buffer | An array that should be used as an external storage. |
| setData | Specifies whether to auto set data with a size equal to the buffer size. If true the data size is set to the buffer size. If false data size is 0. |
|
virtual |
Creates a deep copy of this object.
Only the reference to the external buffer is copied when MediaBuffer does not own its data buffer, i.e. uses external / attached data. On the contrary, when MediaBuffer owns its data, a new copy of the data is created.
| System.OutOfMemoryException | The object cannot be cloned because there's not enough memory. |
| byte [] Detach | ( | ) |
Detaches an external data buffer
| bool SetData | ( | int | dataOffset, |
| int | dataSize | ||
| ) |
This is a convenience method that sets buffer data offset and size at once.
| dataOffset | The offset in the buffer where valid data starts. |
| dataSize | The size in bytes of the valid data in the buffer. |
false if dataOffset and dataSize are not accepted by the method and the valid data is not set.
|
get |
|
get |
The offset at which valid data starts in the data buffer.
|
get |
The size of the data that is still valid in the data buffer.
Referenced by Transcoder.Push().
|
get |
Indicates that MediaBuffer uses an external data buffer.
|
get |
Data buffer.