Xeno-rat
Loading...
Searching...
No Matches
NAudio.MediaFoundation.MediaFoundationApi Class Reference

Main interface for using Media Foundation with NAudio. More...

Collaboration diagram for NAudio.MediaFoundation.MediaFoundationApi:

Static Public Member Functions

static void Startup ()
 Initializes the Media Foundation platform if not already initialized.
 
static IEnumerable< IMFActivateEnumerateTransforms (Guid category)
 Enumerates and returns a collection of IMFActivate interfaces for the specified category.
 
static void Shutdown ()
 Shuts down the Media Foundation platform if it has been initialized.
 
static IMFMediaType CreateMediaType ()
 Creates a new instance of IMFMediaType.
 
static IMFMediaType CreateMediaTypeFromWaveFormat (WaveFormat waveFormat)
 Creates a new IMFMediaType object from the provided WaveFormat.
 
static IMFMediaBuffer CreateMemoryBuffer (int bufferSize)
 Creates a memory buffer of the specified size and returns it.
 
static IMFSample CreateSample ()
 Creates a new Media Foundation sample.
 
static IMFAttributes CreateAttributes (int initialSize)
 Creates a new instance of IMFAttributes with the specified initial size.
 
static IMFByteStream CreateByteStream (object stream)
 Creates an IMFByteStream from the given stream object.
 
static IMFSourceReader CreateSourceReaderFromByteStream (IMFByteStream byteStream)
 Creates a source reader from the specified byte stream.
 

Static Private Attributes

static bool initialized
 

Detailed Description

Main interface for using Media Foundation with NAudio.

Member Function Documentation

◆ CreateAttributes()

static IMFAttributes NAudio.MediaFoundation.MediaFoundationApi.CreateAttributes ( int initialSize)
inlinestatic

Creates a new instance of IMFAttributes with the specified initial size.

Parameters
initialSizeThe 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.

Here is the caller graph for this function:

◆ CreateByteStream()

static IMFByteStream NAudio.MediaFoundation.MediaFoundationApi.CreateByteStream ( object stream)
inlinestatic

Creates an IMFByteStream from the given stream object.

Parameters
streamThe stream object to create the IMFByteStream from.
Returns
The IMFByteStream created from the input stream .
Exceptions
ArgumentExceptionThrown when the input stream is not of type IStream in desktop apps.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ CreateMediaTypeFromWaveFormat()

static IMFMediaType NAudio.MediaFoundation.MediaFoundationApi.CreateMediaTypeFromWaveFormat ( WaveFormat waveFormat)
inlinestatic

Creates a new IMFMediaType object from the provided WaveFormat.

Parameters
waveFormatThe 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateMemoryBuffer()

static IMFMediaBuffer NAudio.MediaFoundation.MediaFoundationApi.CreateMemoryBuffer ( int bufferSize)
inlinestatic

Creates a memory buffer of the specified size and returns it.

Parameters
bufferSizeThe 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.

Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ CreateSourceReaderFromByteStream()

static IMFSourceReader NAudio.MediaFoundation.MediaFoundationApi.CreateSourceReaderFromByteStream ( IMFByteStream byteStream)
inlinestatic

Creates a source reader from the specified byte stream.

Parameters
byteStreamThe 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnumerateTransforms()

static IEnumerable< IMFActivate > NAudio.MediaFoundation.MediaFoundationApi.EnumerateTransforms ( Guid category)
inlinestatic

Enumerates and returns a collection of IMFActivate interfaces for the specified category.

Parameters
categoryThe 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ initialized

bool NAudio.MediaFoundation.MediaFoundationApi.initialized
staticprivate

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