Main interface for using Media Foundation with NAudio.
More...
Main interface for using Media Foundation with NAudio.
◆ CreateAttributes()
static IMFAttributes NAudio.MediaFoundation.MediaFoundationApi.CreateAttributes |
( |
int | initialSize | ) |
|
|
inlinestatic |
Creates a new instance of IMFAttributes with the specified initial size.
- Parameters
-
initialSize | The initial size of the attributes. |
- Returns
- A new instance of IMFAttributes with the specified initial size.
This method creates a new instance of IMFAttributes with the specified initial size using the MFCreateAttributes method from the Media Foundation Interop library.
◆ CreateByteStream()
static IMFByteStream NAudio.MediaFoundation.MediaFoundationApi.CreateByteStream |
( |
object | stream | ) |
|
|
inlinestatic |
Creates an IMFByteStream from the given stream object.
- Parameters
-
stream | The stream object to create the IMFByteStream from. |
- Returns
- The IMFByteStream created from the input stream .
- Exceptions
-
ArgumentException | Thrown when the input stream is not of type IStream in desktop apps. |
◆ CreateMediaType()
static IMFMediaType NAudio.MediaFoundation.MediaFoundationApi.CreateMediaType |
( |
| ) |
|
|
inlinestatic |
Creates a new instance of IMFMediaType.
- Returns
- A new instance of IMFMediaType.
This method creates a new instance of IMFMediaType using the Media Foundation API MFCreateMediaType function.
◆ CreateMediaTypeFromWaveFormat()
static IMFMediaType NAudio.MediaFoundation.MediaFoundationApi.CreateMediaTypeFromWaveFormat |
( |
WaveFormat | waveFormat | ) |
|
|
inlinestatic |
Creates a new IMFMediaType object from the provided WaveFormat.
- Parameters
-
waveFormat | The WaveFormat to initialize the IMFMediaType with. |
- Returns
- The IMFMediaType object initialized with the provided WaveFormat.
This method initializes a new IMFMediaType object using the provided WaveFormat. It first creates a new IMFMediaType object, then initializes it with the provided WaveFormat using MediaFoundationInterop.MFInitMediaTypeFromWaveFormatEx method. If an exception occurs during the initialization process, the created IMFMediaType object is released before rethrowing the exception.
◆ CreateMemoryBuffer()
static IMFMediaBuffer NAudio.MediaFoundation.MediaFoundationApi.CreateMemoryBuffer |
( |
int | bufferSize | ) |
|
|
inlinestatic |
Creates a memory buffer of the specified size and returns it.
- Parameters
-
bufferSize | The size of the memory buffer to be created. |
- Returns
- The memory buffer of size bufferSize .
This method creates a memory buffer of the specified size using Media Foundation's MFCreateMemoryBuffer function. The created memory buffer is then returned for further use.
◆ CreateSample()
static IMFSample NAudio.MediaFoundation.MediaFoundationApi.CreateSample |
( |
| ) |
|
|
inlinestatic |
Creates a new Media Foundation sample.
- Returns
- A new instance of IMFSample representing the Media Foundation sample.
◆ CreateSourceReaderFromByteStream()
Creates a source reader from the specified byte stream.
- Parameters
-
byteStream | The byte stream from which to create the source reader. |
- Returns
- The source reader created from the specified byte stream.
This method creates a source reader from the provided byte stream using Media Foundation interop.
◆ EnumerateTransforms()
static IEnumerable< IMFActivate > NAudio.MediaFoundation.MediaFoundationApi.EnumerateTransforms |
( |
Guid | category | ) |
|
|
inlinestatic |
Enumerates and returns a collection of IMFActivate interfaces for the specified category.
- Parameters
-
category | The category for which to enumerate the IMFActivate interfaces. |
- Returns
- A collection of IMFActivate interfaces for the specified category.
This method uses MediaFoundationInterop.MFTEnumEx to enumerate the IMFActivate interfaces for the specified category. It then iterates through the interfaces, marshals them, and yields each interface in the collection. Finally, it frees the memory allocated for the interfacesPointer using Marshal.FreeCoTaskMem.
◆ Shutdown()
static void NAudio.MediaFoundation.MediaFoundationApi.Shutdown |
( |
| ) |
|
|
inlinestatic |
Shuts down the Media Foundation platform if it has been initialized.
This method checks if the Media Foundation platform has been initialized. If it has been initialized, it shuts down the platform using the MFShutdown method and sets the initialized flag to false.
◆ Startup()
static void NAudio.MediaFoundation.MediaFoundationApi.Startup |
( |
| ) |
|
|
inlinestatic |
Initializes the Media Foundation platform if not already initialized.
This method checks if the Media Foundation platform is already initialized. If not, it initializes the platform by calling MediaFoundationInterop.MFStartup. The method first checks the Media Foundation SDK version and the operating system version to determine the appropriate startup parameters.
◆ initialized
bool NAudio.MediaFoundation.MediaFoundationApi.initialized |
|
staticprivate |
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.Wasapi/MediaFoundation/MediaFoundationHelpers.cs