Table of Contents

Class RTMPSourceSettings

Namespace
VisioForge.Core.Types.X.Sources
Assembly
VisioForge.Core.dll

RTMP source settings for streaming from RTMP servers.

public class RTMPSourceSettings : IMediaPlayerBaseSourceSettings, IVideoCaptureBaseVideoSourceSettings, IVideoMixerSource, IVideoSourceSettings, IMediaBlockSettings

Inheritance

Implements

Inherited Members

Properties

AsyncConnect

Gets or sets a value indicating whether to use asynchronous connection.

public bool AsyncConnect { get; set; }

Property Value

bool

AudioEnabled

Gets or sets a value indicating whether audio stream is enabled.

public bool AudioEnabled { get; set; }

Property Value

bool

CompatibilityMode

Gets or sets a value indicating whether to use compatibility mode. In compatibility mode, the SDK will not try to read stream information, but will still try to open and play the stream.

public bool CompatibilityMode { get; set; }

Property Value

bool

Context

Gets or sets the context for structured logging.

public BaseContext Context { get; set; }

Property Value

BaseContext

CustomVideoDecoder

Gets or sets the custom video decoder to use.

public string CustomVideoDecoder { get; set; }

Property Value

string

ExtraConnectArgs

Gets or sets extra connection arguments for the RTMP connection.

public string ExtraConnectArgs { get; set; }

Property Value

string

FallbackSwitch

Gets or sets the fallback switch settings for automatic failover. When configured, the source will automatically switch to a fallback (static text, image, or media) when the main RTMP stream fails.

public FallbackSwitchSettings FallbackSwitch { get; set; }

Property Value

FallbackSwitchSettings

IdleTimeout

Gets or sets the idle timeout for the connection.

public TimeSpan IdleTimeout { get; set; }

Property Value

TimeSpan

NoEofIsError

Gets or sets a value indicating whether no EOF should be treated as an error.

public bool NoEofIsError { get; set; }

Property Value

bool

Uri

Gets or sets the RTMP stream URI.

public Uri Uri { get; set; }

Property Value

Uri

UseGPUDecoder

Gets or sets a value indicating whether to use GPU decoder.

public bool UseGPUDecoder { get; set; }

Property Value

bool

Methods

CreateAsync(Uri, bool, bool)

Creates RTMP source settings asynchronously.

public static Task<RTMPSourceSettings> CreateAsync(Uri uri, bool audioEnabled = true, bool readInfo = true)

Parameters

uri Uri

The RTMP stream URI.

audioEnabled bool

if set to true audio is enabled.

readInfo bool

if set to true to read stream information. Disable only if you have connection issues.

Returns

Task<RTMPSourceSettings>

A Task<RTMPSourceSettings> representing the asynchronous operation.

CreateAsync(Uri, bool, bool, BaseContext)

Creates RTMP source settings asynchronously, optionally routing log output through the supplied context.

public static Task<RTMPSourceSettings> CreateAsync(Uri uri, bool audioEnabled, bool readInfo, BaseContext context)

Parameters

uri Uri

The RTMP stream URI.

audioEnabled bool

if set to true audio is enabled.

readInfo bool

if set to true to read stream information. Disable only if you have connection issues.

context BaseContext

Optional context for structured logging. When null, a default context is created.

Returns

Task<RTMPSourceSettings>

A Task<RTMPSourceSettings> representing the asynchronous operation.

CreateBlock()

Creates a MediaBlock instance from these settings.

public MediaBlock CreateBlock()

Returns

MediaBlock

A new RTMPSourceBlock configured with these settings.

GetInfo()

Gets the cached media information.

public MediaFileInfo GetInfo()

Returns

MediaFileInfo

MediaFileInfo containing stream information.

IsAudioAvailable()

Determines whether audio is available in the stream.

public bool IsAudioAvailable()

Returns

bool

true if audio is available; otherwise, false.

IsVideoAvailable()

Determines whether video is available in the stream.

public bool IsVideoAvailable()

Returns

bool

true if video is available; otherwise, false.

ReadInfo()

Reads the stream information.

public MediaFileInfo ReadInfo()

Returns

MediaFileInfo

MediaFileInfo containing stream information.

ReadInfoAsync()

Reads the stream information asynchronously.

public Task<MediaFileInfo> ReadInfoAsync()

Returns

Task<MediaFileInfo>

Task<MediaFileInfo> containing stream information.

ReadInfoAsync(CancellationToken)

Reads the stream information asynchronously, with cancellation support and a default 30-second timeout.

public Task<MediaFileInfo> ReadInfoAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A cancellation token to cancel the operation.

Returns

Task<MediaFileInfo>

Task<MediaFileInfo> containing stream information, or null when the underlying read fails or the timeout elapses.

Remarks

The synchronous VisioForge.Core.Types.X.Sources.RTMPSourceSettings.ReadInfo performs blocking network I/O via the MediaInfoReaderCore probe and currently has no inner cancellation hook. To keep the public contract responsive we wrap it in a Task.Run that observes cancellationToken for the dispatch latency, and race the completion against a 30s Task.Delay so the call never hangs longer than the timeout if the RTMP server is unreachable. When the timeout wins the underlying thread continues running (we cannot abort it safely) but the caller receives a null result and a warning log instead of an indefinite hang.