Xeno-rat
Loading...
Searching...
No Matches
NAudio.Dmo.MediaBuffer Class Reference

Attempting to implement the COM IMediaBuffer interface as a .NET object Not sure what will happen when I pass this to an unmanaged object. More...

Inheritance diagram for NAudio.Dmo.MediaBuffer:
Collaboration diagram for NAudio.Dmo.MediaBuffer:

Public Member Functions

 MediaBuffer (int maxLength)
 Creates a new Media Buffer.
 
void Dispose ()
 Releases the unmanaged resources used by the current instance of the ClassName class.
 
void LoadData (byte[] data, int bytes)
 Loads the specified data into the buffer.
 
void RetrieveData (byte[] data, int offset)
 Copies the elements of the buffer to the specified array starting at the specified offset.
 

Properties

int Length [get, set]
 Length of data in the media buffer.
 

Private Member Functions

 ~MediaBuffer ()
 Finalizer.
 
int IMediaBuffer. SetLength (int length)
 Sets the length of the media buffer.
 
int IMediaBuffer. GetMaxLength (out int maxLength)
 Retrieves the maximum length of the media buffer and returns the result.
 
int IMediaBuffer. GetBufferAndLength (IntPtr bufferPointerPointer, IntPtr validDataLengthPointer)
 Retrieves the buffer and its length and writes them to the specified memory locations.
 

Private Attributes

IntPtr buffer
 
int length
 
readonly int maxLength
 

Detailed Description

Attempting to implement the COM IMediaBuffer interface as a .NET object Not sure what will happen when I pass this to an unmanaged object.

Constructor & Destructor Documentation

◆ MediaBuffer()

NAudio.Dmo.MediaBuffer.MediaBuffer ( int maxLength)
inline

Creates a new Media Buffer.

Parameters
maxLengthMaximum length in bytes

◆ ~MediaBuffer()

NAudio.Dmo.MediaBuffer.~MediaBuffer ( )
inlineprivate

Finalizer.

Here is the call graph for this function:

Member Function Documentation

◆ Dispose()

void NAudio.Dmo.MediaBuffer.Dispose ( )
inline

Releases the unmanaged resources used by the current instance of the ClassName class.

This method releases the unmanaged memory allocated for the buffer, if it is not already released. It also requests that the common language runtime not call the finalizer for the current instance of the class.

Here is the caller graph for this function:

◆ GetBufferAndLength()

int IMediaBuffer. NAudio.Dmo.MediaBuffer.GetBufferAndLength ( IntPtr bufferPointerPointer,
IntPtr validDataLengthPointer )
inlineprivate

Retrieves the buffer and its length and writes them to the specified memory locations.

Parameters
bufferPointerPointerA pointer to the memory location where the buffer pointer will be written.
validDataLengthPointerA pointer to the memory location where the valid data length will be written.
Returns
The result of the operation. Returns HResult.S_OK if successful.

If bufferPointerPointer is not IntPtr.Zero, the buffer pointer is written to the specified memory location. If validDataLengthPointer is not IntPtr.Zero, the valid data length is written to the specified memory location.

Implements NAudio.Dmo.IMediaBuffer.

◆ GetMaxLength()

int IMediaBuffer. NAudio.Dmo.MediaBuffer.GetMaxLength ( out int maxLength)
inlineprivate

Retrieves the maximum length of the media buffer and returns the result.

Parameters
maxLengthWhen this method returns, contains the maximum length of the media buffer.
Returns
An HRESULT value indicating the success or failure of the method call.

Implements NAudio.Dmo.IMediaBuffer.

◆ LoadData()

void NAudio.Dmo.MediaBuffer.LoadData ( byte[] data,
int bytes )
inline

Loads the specified data into the buffer.

Parameters
dataThe byte array containing the data to be loaded.
bytesThe number of bytes to be loaded from the data array.

This method sets the length of the buffer to the specified number of bytes and copies the data from the input data array into the buffer using the Marshal.Copy method.

Here is the caller graph for this function:

◆ RetrieveData()

void NAudio.Dmo.MediaBuffer.RetrieveData ( byte[] data,
int offset )
inline

Copies the elements of the buffer to the specified array starting at the specified offset.

Parameters
dataThe destination array where the data will be copied.
offsetThe zero-based byte offset in the destination array at which to begin copying bytes.
Exceptions
ArgumentNullExceptionThrown when the destination array is null.
ArgumentOutOfRangeExceptionThrown when the offset is less than zero or greater than the length of the destination array.

◆ SetLength()

int IMediaBuffer. NAudio.Dmo.MediaBuffer.SetLength ( int length)
inlineprivate

Sets the length of the media buffer.

Parameters
lengthThe new length to be set for the media buffer.
Returns
HResult.E_INVALIDARG if the specified length is greater than the maximum length; otherwise, HResult.S_OK.

This method sets the length of the media buffer to the specified value. If the specified length is greater than the maximum length, it returns HResult.E_INVALIDARG; otherwise, it sets the length and returns HResult.S_OK.

Implements NAudio.Dmo.IMediaBuffer.

Member Data Documentation

◆ buffer

IntPtr NAudio.Dmo.MediaBuffer.buffer
private

◆ length

int NAudio.Dmo.MediaBuffer.length
private

◆ maxLength

readonly int NAudio.Dmo.MediaBuffer.maxLength
private

Property Documentation

◆ Length

int NAudio.Dmo.MediaBuffer.Length
getset

Length of data in the media buffer.


The documentation for this class was generated from the following file: