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

Media Object. More...

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

Public Member Functions

DmoMediaTypeGetInputType (int inputStream, int inputTypeIndex)
 Retrieves the input type for a specified input stream and input type index.
 
DmoMediaTypeGetOutputType (int outputStream, int outputTypeIndex)
 Retrieves the output type for a specified output stream and output type index.
 
DmoMediaType GetOutputCurrentType (int outputStreamIndex)
 Retrieves the current output media type for the specified output stream index.
 
IEnumerable< DmoMediaTypeGetInputTypes (int inputStreamIndex)
 Retrieves the input types for the specified input stream index.
 
IEnumerable< DmoMediaTypeGetOutputTypes (int outputStreamIndex)
 Retrieves the output types for the specified output stream index.
 
bool SupportsInputType (int inputStreamIndex, DmoMediaType mediaType)
 Checks if the specified input stream index supports the given media type.
 
void SetInputType (int inputStreamIndex, DmoMediaType mediaType)
 Sets the input type.
 
void SetInputWaveFormat (int inputStreamIndex, WaveFormat waveFormat)
 Sets the input wave format for the specified input stream.
 
bool SupportsInputWaveFormat (int inputStreamIndex, WaveFormat waveFormat)
 Checks if the specified input stream supports the given wave format.
 
bool SupportsOutputType (int outputStreamIndex, DmoMediaType mediaType)
 Checks if the specified output stream supports the given media type.
 
bool SupportsOutputWaveFormat (int outputStreamIndex, WaveFormat waveFormat)
 Checks if the specified output stream supports the given wave format.
 
void SetOutputType (int outputStreamIndex, DmoMediaType mediaType)
 Sets the output type n.b. may need to set the input type first.
 
void SetOutputWaveFormat (int outputStreamIndex, WaveFormat waveFormat)
 Sets the output wave format for the specified output stream.
 
MediaObjectSizeInfo GetInputSizeInfo (int inputStreamIndex)
 Retrieves the size information for the input stream at the specified index.
 
MediaObjectSizeInfo GetOutputSizeInfo (int outputStreamIndex)
 Retrieves the size information for the specified output stream.
 
void ProcessInput (int inputStreamIndex, IMediaBuffer mediaBuffer, DmoInputDataBufferFlags flags, long timestamp, long duration)
 Processes the input data using the specified media buffer and flags.
 
void ProcessOutput (DmoProcessOutputFlags flags, int outputBufferCount, DmoOutputDataBuffer[] outputBuffers)
 Processes the output data buffers using the specified flags and output buffer count.
 
void AllocateStreamingResources ()
 Allocates streaming resources for the media object.
 
void FreeStreamingResources ()
 Frees the streaming resources used by the media object.
 
long GetInputMaxLatency (int inputStreamIndex)
 Retrieves the maximum latency for the specified input stream.
 
void Flush ()
 Flushes the media object.
 
void Discontinuity (int inputStreamIndex)
 Notifies the media object that a discontinuity has occurred in the input stream at the specified index.
 
bool IsAcceptingData (int inputStreamIndex)
 Checks if the specified input stream is accepting data.
 
void Dispose ()
 Releases the unmanaged resources used by the media object.
 

Properties

int InputStreamCount [get]
 Number of input streams.
 
int OutputStreamCount [get]
 Number of output streams.
 

Private Member Functions

bool SetInputType (int inputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
 Sets the input type for the specified input stream using the given media type.
 
DmoMediaType CreateDmoMediaTypeForWaveFormat (WaveFormat waveFormat)
 Creates a DMO media type for the specified WaveFormat.
 
bool SetOutputType (int outputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
 Sets the output type for the specified output stream using the provided media type.
 

Private Attributes

IMediaObject mediaObject
 
readonly int inputStreams
 
readonly int outputStreams
 

Detailed Description

Media Object.

Member Function Documentation

◆ AllocateStreamingResources()

void NAudio.Dmo.MediaObject.AllocateStreamingResources ( )
inline

Allocates streaming resources for the media object.

Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error occurs during the allocation of streaming resources.
Here is the call graph for this function:

◆ CreateDmoMediaTypeForWaveFormat()

DmoMediaType NAudio.Dmo.MediaObject.CreateDmoMediaTypeForWaveFormat ( WaveFormat waveFormat)
inlineprivate

Creates a DMO media type for the specified WaveFormat.

Parameters
waveFormatThe WaveFormat for which the DMO media type is to be created.
Returns
The DMO media type created for the specified waveFormat .

This method initializes a DMO media type, sets the wave format, and returns the created media type.

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

◆ Discontinuity()

void NAudio.Dmo.MediaObject.Discontinuity ( int inputStreamIndex)
inline

Notifies the media object that a discontinuity has occurred in the input stream at the specified index.

Parameters
inputStreamIndexThe index of the input stream where the discontinuity has occurred.
Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error occurs while notifying the media object about the discontinuity.
Here is the call graph for this function:

◆ Dispose()

void NAudio.Dmo.MediaObject.Dispose ( )
inline

Releases the unmanaged resources used by the media object.

This method releases the unmanaged resources used by the media object by calling the Marshal.ReleaseComObject(object) method. If the media object is not null, it releases the resources and sets the media object to null.

Here is the caller graph for this function:

◆ Flush()

void NAudio.Dmo.MediaObject.Flush ( )
inline

Flushes the media object.

Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error is encountered while flushing the media object.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeStreamingResources()

void NAudio.Dmo.MediaObject.FreeStreamingResources ( )
inline

Frees the streaming resources used by the media object.

Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error occurs while freeing the streaming resources.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInputMaxLatency()

long NAudio.Dmo.MediaObject.GetInputMaxLatency ( int inputStreamIndex)
inline

Retrieves the maximum latency for the specified input stream.

Parameters
inputStreamIndexThe index of the input stream for which to retrieve the maximum latency.
Returns
The maximum latency for the specified input stream.
Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error occurs while retrieving the maximum latency from the media object.
Here is the call graph for this function:

◆ GetInputSizeInfo()

MediaObjectSizeInfo NAudio.Dmo.MediaObject.GetInputSizeInfo ( int inputStreamIndex)
inline

Retrieves the size information for the input stream at the specified index.

Parameters
inputStreamIndexThe index of the input stream for which to retrieve size information.
Returns
An instance of MediaObjectSizeInfo containing the size, max lookahead, and alignment information for the input stream.
Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error occurs while retrieving the input size information from the media object.
Here is the call graph for this function:

◆ GetInputType()

DmoMediaType? NAudio.Dmo.MediaObject.GetInputType ( int inputStream,
int inputTypeIndex )
inline

Retrieves the input type for a specified input stream and input type index.

Parameters
inputStreamThe index of the input stream.
inputTypeIndexThe index of the input type.
Returns
The input type for the specified input stream and input type index, or null if not found.
Exceptions
COMExceptionThrown when an error occurs while retrieving the input type.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInputTypes()

IEnumerable< DmoMediaType > NAudio.Dmo.MediaObject.GetInputTypes ( int inputStreamIndex)
inline

Retrieves the input types for the specified input stream index.

Parameters
inputStreamIndexThe index of the input stream for which to retrieve the types.
Returns
An enumerable collection of input types for the specified input stream index.

This method retrieves the input types for the specified input stream index by iterating through the available types using a while loop. It calls the GetInputType method to retrieve each type and yields the result until no more types are available.

Here is the call graph for this function:

◆ GetOutputCurrentType()

DmoMediaType NAudio.Dmo.MediaObject.GetOutputCurrentType ( int outputStreamIndex)
inline

Retrieves the current output media type for the specified output stream index.

Parameters
outputStreamIndexThe index of the output stream for which to retrieve the media type.
Returns
The current media type of the specified output stream.
Exceptions
InvalidOperationExceptionThrown when the media type was not set.
ExceptionThrown when an error occurs while retrieving the media type.

This method retrieves the current media type for the specified output stream index from the media object. If the operation is successful, it returns the current media type. If the media type was not set, it throws an InvalidOperationException. If an error occurs during the retrieval process, it throws an Exception with details of the error.

Here is the call graph for this function:

◆ GetOutputSizeInfo()

MediaObjectSizeInfo NAudio.Dmo.MediaObject.GetOutputSizeInfo ( int outputStreamIndex)
inline

Retrieves the size information for the specified output stream.

Parameters
outputStreamIndexThe index of the output stream for which to retrieve size information.
Returns
A MediaObjectSizeInfo object containing the size and alignment information for the specified output stream.
Exceptions
MarshalDirectiveExceptionThrown when an HRESULT indicates a failed COM method call.
Here is the call graph for this function:

◆ GetOutputType()

DmoMediaType? NAudio.Dmo.MediaObject.GetOutputType ( int outputStream,
int outputTypeIndex )
inline

Retrieves the output type for a specified output stream and output type index.

Parameters
outputStreamThe index of the output stream.
outputTypeIndexThe index of the output type.
Returns
The output type for the specified output stream and output type index, or null if no more items are available.
Exceptions
COMExceptionThrown when an error occurs during the retrieval of the output type, except when the error is due to no more items being available.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetOutputTypes()

IEnumerable< DmoMediaType > NAudio.Dmo.MediaObject.GetOutputTypes ( int outputStreamIndex)
inline

Retrieves the output types for the specified output stream index.

Parameters
outputStreamIndexThe index of the output stream for which to retrieve the types.
Returns
An enumerable collection of DmoMediaType representing the output types for the specified output stream index.

This method iterates through the output types of the specified output stream index using a while loop. It retrieves each output type using the GetOutputType method and yields the result. The method continues iterating until no more output types are found for the specified output stream index.

Here is the call graph for this function:

◆ IsAcceptingData()

bool NAudio.Dmo.MediaObject.IsAcceptingData ( int inputStreamIndex)
inline

Checks if the specified input stream is accepting data.

Parameters
inputStreamIndexThe index of the input stream to be checked.
Returns
True if the input stream is accepting data; otherwise, false.
Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error occurs while getting the input status from the media object.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessInput()

void NAudio.Dmo.MediaObject.ProcessInput ( int inputStreamIndex,
IMediaBuffer mediaBuffer,
DmoInputDataBufferFlags flags,
long timestamp,
long duration )
inline

Processes the input data using the specified media buffer and flags.

Parameters
inputStreamIndexThe index of the input stream.
mediaBufferThe media buffer containing the input data.
flagsThe flags indicating how the input data should be processed.
timestampThe timestamp of the input data.
durationThe duration of the input data.
Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error occurs during processing the input data using the media object.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessOutput()

void NAudio.Dmo.MediaObject.ProcessOutput ( DmoProcessOutputFlags flags,
int outputBufferCount,
DmoOutputDataBuffer[] outputBuffers )
inline

Processes the output data buffers using the specified flags and output buffer count.

Parameters
flagsThe flags that specify the processing behavior.
outputBufferCountThe number of output data buffers.
outputBuffersAn array of DmoOutputDataBuffer objects containing the output data.
Exceptions
System.Runtime.InteropServices.COMExceptionThrown when an error occurs during the processing of output data.

This method processes the output data buffers using the specified flags and output buffer count. It throws a COMException if an error occurs during the processing.

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

◆ SetInputType() [1/2]

void NAudio.Dmo.MediaObject.SetInputType ( int inputStreamIndex,
DmoMediaType mediaType )
inline

Sets the input type.

Parameters
inputStreamIndexInput stream index
mediaTypeMedia Type
Here is the call graph for this function:

◆ SetInputType() [2/2]

bool NAudio.Dmo.MediaObject.SetInputType ( int inputStreamIndex,
DmoMediaType mediaType,
DmoSetTypeFlags flags )
inlineprivate

Sets the input type for the specified input stream using the given media type.

Parameters
inputStreamIndexThe index of the input stream for which the media type is to be set.
mediaTypeThe media type to be set for the input stream.
Exceptions
ArgumentExceptionThrown when the specified media type is not supported.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetInputWaveFormat()

void NAudio.Dmo.MediaObject.SetInputWaveFormat ( int inputStreamIndex,
WaveFormat waveFormat )
inline

Sets the input wave format for the specified input stream.

Parameters
inputStreamIndexThe index of the input stream for which the wave format is to be set.
waveFormatThe WaveFormat to be set for the input stream.
Exceptions
ArgumentExceptionThrown when the specified media type is not supported.

This method sets the input wave format for the specified input stream using the DMO (DirectX Media Object) media type. It creates a DMO media type based on the provided WaveFormat and sets it for the input stream using DmoInterop.SetInputType method. If the media type cannot be set, an ArgumentException is thrown with the message "Media Type not supported".

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

◆ SetOutputType() [1/2]

void NAudio.Dmo.MediaObject.SetOutputType ( int outputStreamIndex,
DmoMediaType mediaType )
inline

Sets the output type n.b. may need to set the input type first.

Parameters
outputStreamIndexOutput stream index
mediaTypeMedia type to set
Here is the call graph for this function:

◆ SetOutputType() [2/2]

bool NAudio.Dmo.MediaObject.SetOutputType ( int outputStreamIndex,
DmoMediaType mediaType,
DmoSetTypeFlags flags )
inlineprivate

Sets the output type for the specified output stream using the provided media type.

Parameters
outputStreamIndexThe index of the output stream for which the media type is to be set.
mediaTypeThe media type to be set for the output stream.
Exceptions
ArgumentExceptionThrown when the specified media type is not supported.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetOutputWaveFormat()

void NAudio.Dmo.MediaObject.SetOutputWaveFormat ( int outputStreamIndex,
WaveFormat waveFormat )
inline

Sets the output wave format for the specified output stream.

Parameters
outputStreamIndexThe index of the output stream for which the wave format is to be set.
waveFormatThe wave format to be set for the output stream.
Exceptions
ArgumentExceptionThrown when the specified media type is not supported.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SupportsInputType()

bool NAudio.Dmo.MediaObject.SupportsInputType ( int inputStreamIndex,
DmoMediaType mediaType )
inline

Checks if the specified input stream index supports the given media type.

Parameters
inputStreamIndexThe index of the input stream to be checked.
mediaTypeThe media type to be checked for support.
Returns
True if the input stream supports the specified media type; otherwise, false.
Here is the call graph for this function:

◆ SupportsInputWaveFormat()

bool NAudio.Dmo.MediaObject.SupportsInputWaveFormat ( int inputStreamIndex,
WaveFormat waveFormat )
inline

Checks if the specified input stream supports the given wave format.

Parameters
inputStreamIndexThe index of the input stream to be checked.
waveFormatThe wave format to be checked for support.
Returns
True if the input stream supports the specified wave format; otherwise, false.

This method creates a DMO media type for the provided wave format and then sets the input type for the specified input stream using the DMO_SET_TYPEF_TEST_ONLY flag to check for support. After the check, the allocated DMO media type is freed using MoFreeMediaType method.

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

◆ SupportsOutputType()

bool NAudio.Dmo.MediaObject.SupportsOutputType ( int outputStreamIndex,
DmoMediaType mediaType )
inline

Checks if the specified output stream supports the given media type.

Parameters
outputStreamIndexThe index of the output stream to be checked.
mediaTypeThe media type to be checked for support.
Returns
True if the specified output stream supports the given media type; otherwise, false.

This method internally calls the SetOutputType method with the DMO_SET_TYPEF_TEST_ONLY flag to check if the specified output stream supports the given media type without actually setting it.

Here is the call graph for this function:

◆ SupportsOutputWaveFormat()

bool NAudio.Dmo.MediaObject.SupportsOutputWaveFormat ( int outputStreamIndex,
WaveFormat waveFormat )
inline

Checks if the specified output stream supports the given wave format.

Parameters
outputStreamIndexThe index of the output stream to be checked.
waveFormatThe wave format to be checked for support.
Returns
True if the specified output stream supports the given wave format; otherwise, false.

This method creates a DMO media type for the provided wave format and sets the output type for the specified stream to test if it is supported. It then frees the allocated media type and returns the result indicating whether the wave format is supported by the output stream.

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

Member Data Documentation

◆ inputStreams

readonly int NAudio.Dmo.MediaObject.inputStreams
private

◆ mediaObject

IMediaObject NAudio.Dmo.MediaObject.mediaObject
private

◆ outputStreams

readonly int NAudio.Dmo.MediaObject.outputStreams
private

Property Documentation

◆ InputStreamCount

int NAudio.Dmo.MediaObject.InputStreamCount
get

Number of input streams.

◆ OutputStreamCount

int NAudio.Dmo.MediaObject.OutputStreamCount
get

Number of output streams.


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