Table of Contents

Class MediaObject

Namespace
NAudio.Dmo
Assembly
NAudio.Dmo.dll

Media Object

public class MediaObject : IDisposable
Inheritance
MediaObject
Implements
Inherited Members

Properties

InputStreamCount

Number of input streams

public int InputStreamCount { get; }

Property Value

int

OutputStreamCount

Number of output streams

public int OutputStreamCount { get; }

Property Value

int

Methods

AllocateStreamingResources()

Gives the DMO a chance to allocate any resources needed for streaming

public void AllocateStreamingResources()

Discontinuity(int)

Report a discontinuity on the specified input stream

public void Discontinuity(int inputStreamIndex)

Parameters

inputStreamIndex int

Input Stream index

Dispose()

Releases the underlying COM object.

public void Dispose()

Flush()

Flushes all buffered data

public void Flush()

FreeStreamingResources()

Tells the DMO to free any resources needed for streaming

public void FreeStreamingResources()

GetInputMaxLatency(int)

Gets maximum input latency

public long GetInputMaxLatency(int inputStreamIndex)

Parameters

inputStreamIndex int

input stream index

Returns

long

Maximum input latency as a ref-time

GetInputSizeInfo(int)

Get Input Size Info

public MediaObjectSizeInfo GetInputSizeInfo(int inputStreamIndex)

Parameters

inputStreamIndex int

Input Stream Index

Returns

MediaObjectSizeInfo

Input Size Info

GetInputType(int, int)

Gets the input media type for the specified input stream

public DmoMediaType? GetInputType(int inputStream, int inputTypeIndex)

Parameters

inputStream int

Input stream index

inputTypeIndex int

Input type index

Returns

DmoMediaType?

DMO Media Type or null if there are no more input types

GetInputTypes(int)

Enumerates the supported input types

public IEnumerable<DmoMediaType> GetInputTypes(int inputStreamIndex)

Parameters

inputStreamIndex int

Input stream index

Returns

IEnumerable<DmoMediaType>

Enumeration of input types

GetOutputCurrentType(int)

retrieves the media type that was set for an output stream, if any

public DmoMediaType GetOutputCurrentType(int outputStreamIndex)

Parameters

outputStreamIndex int

Output stream index

Returns

DmoMediaType

DMO Media Type or null if no more available

GetOutputSizeInfo(int)

Get Output Size Info

public MediaObjectSizeInfo GetOutputSizeInfo(int outputStreamIndex)

Parameters

outputStreamIndex int

Output Stream Index

Returns

MediaObjectSizeInfo

Output Size Info

GetOutputType(int, int)

Gets the DMO Media Output type

public DmoMediaType? GetOutputType(int outputStream, int outputTypeIndex)

Parameters

outputStream int

The output stream

outputTypeIndex int

Output type index

Returns

DmoMediaType?

DMO Media Type or null if no more available

GetOutputTypes(int)

Enumerates the output types

public IEnumerable<DmoMediaType> GetOutputTypes(int outputStreamIndex)

Parameters

outputStreamIndex int

Output stream index

Returns

IEnumerable<DmoMediaType>

Enumeration of supported output types

IsAcceptingData(int)

Is this input stream accepting data?

public bool IsAcceptingData(int inputStreamIndex)

Parameters

inputStreamIndex int

Input Stream index

Returns

bool

true if accepting data

ProcessInput(int, IMediaBuffer, DmoInputDataBufferFlags, long, long)

Process Input

public void ProcessInput(int inputStreamIndex, IMediaBuffer mediaBuffer, DmoInputDataBufferFlags flags, long timestamp, long duration)

Parameters

inputStreamIndex int

Input Stream index

mediaBuffer IMediaBuffer

Media Buffer

flags DmoInputDataBufferFlags

Flags

timestamp long

Timestamp

duration long

Duration

ProcessOutput(DmoProcessOutputFlags, int, DmoOutputDataBuffer[])

Process Output

public void ProcessOutput(DmoProcessOutputFlags flags, int outputBufferCount, DmoOutputDataBuffer[] outputBuffers)

Parameters

flags DmoProcessOutputFlags

Flags

outputBufferCount int

Output buffer count

outputBuffers DmoOutputDataBuffer[]

Output buffers

SetInputType(int, DmoMediaType)

Sets the input type

public void SetInputType(int inputStreamIndex, DmoMediaType mediaType)

Parameters

inputStreamIndex int

Input stream index

mediaType DmoMediaType

Media Type

SetInputWaveFormat(int, WaveFormat)

Sets the input type to the specified Wave format

public void SetInputWaveFormat(int inputStreamIndex, WaveFormat waveFormat)

Parameters

inputStreamIndex int

Input stream index

waveFormat WaveFormat

Wave format

SetOutputType(int, DmoMediaType)

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

public void SetOutputType(int outputStreamIndex, DmoMediaType mediaType)

Parameters

outputStreamIndex int

Output stream index

mediaType DmoMediaType

Media type to set

SetOutputWaveFormat(int, WaveFormat)

Set output type to the specified wave format n.b. may need to set input type first

public void SetOutputWaveFormat(int outputStreamIndex, WaveFormat waveFormat)

Parameters

outputStreamIndex int

Output stream index

waveFormat WaveFormat

Wave format

SupportsInputType(int, DmoMediaType)

Querys whether a specified input type is supported

public bool SupportsInputType(int inputStreamIndex, DmoMediaType mediaType)

Parameters

inputStreamIndex int

Input stream index

mediaType DmoMediaType

Media type to check

Returns

bool

true if supports

SupportsInputWaveFormat(int, WaveFormat)

Requests whether the specified Wave format is supported as an input

public bool SupportsInputWaveFormat(int inputStreamIndex, WaveFormat waveFormat)

Parameters

inputStreamIndex int

Input stream index

waveFormat WaveFormat

Wave format

Returns

bool

true if supported

SupportsOutputType(int, DmoMediaType)

Checks if a specified output type is supported n.b. you may need to set the input type first

public bool SupportsOutputType(int outputStreamIndex, DmoMediaType mediaType)

Parameters

outputStreamIndex int

Output stream index

mediaType DmoMediaType

Media type

Returns

bool

True if supported

SupportsOutputWaveFormat(int, WaveFormat)

Tests if the specified Wave Format is supported for output n.b. may need to set the input type first

public bool SupportsOutputWaveFormat(int outputStreamIndex, WaveFormat waveFormat)

Parameters

outputStreamIndex int

Output stream index

waveFormat WaveFormat

Wave format

Returns

bool

True if supported