Methods (9) Properties (2)
Namespace: CSCore.DMO

Syntax

public class MediaBuffer : IMediaBuffer, IWriteable, IDisposable

Implements

Summary

Default-Implementation of the IMediaBuffer interface. For more information, see .

Used by

Methods

MediaBuffer(Int32 maxlength)

Creates a MediaBuffer and allocates the specified number of bytes in the memory.

public void MediaBuffer(Int32 maxlength)

Parameters

maxlength

Int32

The number of bytes which has to be allocated in the memory.

Dispose()

Frees the allocated memory of the internally used buffer.

public void Dispose()

Finalize()

Frees the allocated memory of the internally used buffer.

protected void Finalize()

GetBufferAndLength(IntPtr ppBuffer, IntPtr validDataByteLength)

The GetBufferAndLength method retrieves the buffer and the size of the valid data in the buffer.

none Int32 GetBufferAndLength(IntPtr ppBuffer, IntPtr validDataByteLength)

Parameters

ppBuffer

IntPtr

Address of a pointer that receives the buffer array. Can be Zero if validDataByteLength is not Zero.

validDataByteLength

IntPtr

Pointer to a variable that receives the size of the valid data, in bytes. Can be Zero if ppBuffer is not Zero.

Returns

HRESULT

GetMaxLength(Int32& length)

The GetMaxLength method retrieves the maximum number of bytes this buffer can hold.

none Int32 GetMaxLength(Int32& length)

Parameters

length

Int32&

A variable that receives the buffer's maximum size, in bytes.

Returns

HRESULT

Read(Byte[] buffer, Int32 offset)

Reads a sequence of bytes from the internally used buffer.

public void Read(Byte[] buffer, Int32 offset)

Parameters

buffer

Byte[]

Array of bytes to store the read bytes in.

offset

Int32

Zero-based byte offset in the specified buffer at which to begin storing the data read from the buffer.

Read(Byte[] buffer, Int32 offset, Int32 count)

Reads a sequence of bytes from the buffer.

public void Read(Byte[] buffer, Int32 offset, Int32 count)

Parameters

buffer

Byte[]

Array of bytes to store the read bytes in.

offset

Int32

Zero-based byte offset in the specified buffer at which to begin storing the data read from the buffer.

count

Int32

The maximum number of bytes to read from the buffer.

SetLength(Int32 length)

The SetLength method specifies the length of the data currently in the buffer.

none Int32 SetLength(Int32 length)

Parameters

length

Int32

Size of the data, in bytes. The value must not exceed the buffer's maximum size. Call the GetMaxLength method to obtain the maximum size.

Returns

HRESULT

Write(Byte[] buffer, Int32 offset, Int32 count)

Writes a sequence of bytes to the internally used buffer.

public void Write(Byte[] buffer, Int32 offset, Int32 count)

Parameters

buffer

Byte[]

Array of bytes. The Write method copies data from the specified array of bytes to the internally used buffer.

offset

Int32

Zero-based bytes offset in the specified buffer at which to begin copying bytes to the internally used buffer.

count

Int32

The number of bytes to be copied.

Properties

Length

Gets the length of the data currently in the buffer.

public Int32 Length { get; set; }

MaxLength

Gets the maximum number of bytes this buffer can hold.

public Int32 MaxLength { get; }