Table of Contents

Class MemoryStreamSource

Namespace
VisioForge.Core.Types.MediaPlayer
Assembly
VisioForge.Core.dll

Represents a memory-based media source for the Media Player SDK that allows playback from in-memory data streams instead of files.

public class MemoryStreamSource

Inheritance

Inherited Members

Remarks

This class is used when MediaPlayerSourceMode is set to Memory_DS. It wraps a COM IStream interface that provides access to media data stored in memory. This is useful for scenarios where media data is generated dynamically, downloaded to memory, or needs to be played without writing to disk.

Constructors

MemoryStreamSource(IStream, bool?, bool?, long)

Initializes a new instance of the VisioForge.Core.Types.MediaPlayer.MemoryStreamSource class.

public MemoryStreamSource(IStream stream, bool? videoPresent, bool? audioPresent, long size)

Parameters

stream IStream

IStream stream.

videoPresent bool?

Video present flag. If LAV engine is available you can ignore this parameter.

audioPresent bool?

Audio present flag. If LAV engine is available you can ignore this parameter.

size long

Size.

MemoryStreamSource(IStream, long)

Initializes a new instance of the VisioForge.Core.Types.MediaPlayer.MemoryStreamSource class.

public MemoryStreamSource(IStream stream, long size)

Parameters

stream IStream

The stream.

size long

The size.

Properties

IsAudioPresent

Gets a value indicating whether the media stream contains audio data.

public bool? IsAudioPresent { get; }

Property Value

bool?

Remarks

This hint helps the media player optimize the filter graph construction. If null, the player will auto-detect audio presence. When using LAV filters, this parameter can typically be left as null for automatic detection.

IsVideoPresent

Gets a value indicating whether the media stream contains video data.

public bool? IsVideoPresent { get; }

Property Value

bool?

Remarks

This hint helps the media player optimize the filter graph construction. If null, the player will auto-detect video presence. When using LAV filters, this parameter can typically be left as null for automatic detection.

Size

Gets the total size of the media stream in bytes.

public long Size { get; }

Property Value

long

Remarks

The size is used for seeking operations and progress calculation. It should represent the total length of the media data available in the stream. For live or growing streams, this may represent the current size.

Stream

Gets the COM IStream interface that provides access to the media data.

[JsonIgnore]
public IStream Stream { get; }

Property Value

IStream

Remarks

The IStream must be seekable and readable. It should contain valid media data in a format supported by DirectShow filters. This property is excluded from JSON serialization as COM interfaces cannot be serialized.