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...
|
| 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.
|
|
|
int | Length [get, set] |
| Length of data in the media buffer.
|
|
|
| ~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.
|
|
Attempting to implement the COM IMediaBuffer interface as a .NET object Not sure what will happen when I pass this to an unmanaged object.
◆ MediaBuffer()
NAudio.Dmo.MediaBuffer.MediaBuffer |
( |
int | maxLength | ) |
|
|
inline |
Creates a new Media Buffer.
- Parameters
-
maxLength | Maximum length in bytes |
◆ ~MediaBuffer()
NAudio.Dmo.MediaBuffer.~MediaBuffer |
( |
| ) |
|
|
inlineprivate |
◆ 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.
◆ 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
-
bufferPointerPointer | A pointer to the memory location where the buffer pointer will be written. |
validDataLengthPointer | A 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
-
maxLength | When 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
-
data | The byte array containing the data to be loaded. |
bytes | The 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.
◆ 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
-
data | The destination array where the data will be copied. |
offset | The zero-based byte offset in the destination array at which to begin copying bytes. |
- Exceptions
-
ArgumentNullException | Thrown when the destination array is null. |
ArgumentOutOfRangeException | Thrown 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
-
length | The 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.
◆ buffer
IntPtr NAudio.Dmo.MediaBuffer.buffer |
|
private |
◆ length
int NAudio.Dmo.MediaBuffer.length |
|
private |
◆ maxLength
readonly int NAudio.Dmo.MediaBuffer.maxLength |
|
private |
◆ 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:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.Wasapi/Dmo/MediaBuffer.cs