Table of Contents

Class HTTPSourceBlockWithDecoder

Namespace
VisioForge.Core.MediaBlocks.Sources
Assembly
VisioForge.Core.dll

Composite media source block that combines an HTTP/HTTPS source with automatic decoding. VisioForge.Core.MediaBlocks.Sources.HTTPSourceBlock hands downstream the raw byte stream souphttpsrc receives - its src pad accepts any caps - so a consumer that needs decoded frames has to add the demuxer and the decoders itself. This block does that: it wraps VisioForge.Core.MediaBlocks.Sources.HTTPSourceBlock and VisioForge.Core.MediaBlocks.Special.DecodeBinBlock and exposes the decoded video, audio and subtitle outputs, the same shape VisioForge.Core.MediaBlocks.Sources.StreamSourceBlockWithDecoder gives a .NET Stream. The HTTP settings - custom headers, cookies, credentials, proxy, user agent, timeouts and the rest - are applied by the inner VisioForge.Core.MediaBlocks.Sources.HTTPSourceBlock. Implements the VisioForge.Core.MediaBlocks.Special.SuperMediaBlock.

public class HTTPSourceBlockWithDecoder : SuperMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

HTTPSourceBlockWithDecoder(HTTPSourceSettings, bool, bool, bool)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.HTTPSourceBlockWithDecoder class.

public HTTPSourceBlockWithDecoder(HTTPSourceSettings settings, bool renderVideo = true, bool renderAudio = true, bool renderSubtitle = false)

Parameters

settings HTTPSourceSettings

The HTTP source settings: URL, custom headers, credentials, timeouts and the other souphttpsrc options.

renderVideo bool

Whether to expose a decoded video output pad. Default true.

renderAudio bool

Whether to expose a decoded audio output pad. Default true.

renderSubtitle bool

Whether to expose a decoded subtitle output pad. Default false.

Exceptions

ArgumentNullException

Thrown when settings is null.

Properties

AudioOutput

Gets the audio output pad with the decoded audio samples.

public MediaBlockPad AudioOutput { get; }

Property Value

MediaBlockPad

SubtitleOutput

Gets the subtitle output pad with the decoded subtitle data.

public MediaBlockPad SubtitleOutput { get; }

Property Value

MediaBlockPad

Type

Gets the block type discriminator. Overridden so this composite block does not inherit VisioForge.Core.MediaBlocks.MediaBlockType.SuperBlock from the base class and gets its own stable value.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

UseLegacyDecodeBin

Gets or sets a value indicating whether the decoder uses GStreamer's legacy decodebin instead of decodebin3. See VisioForge.Core.MediaBlocks.Special.DecodeBinBlock.UseLegacyDecodeBin. Set it before the pipeline starts.

public bool UseLegacyDecodeBin { get; set; }

Property Value

bool

VideoOutput

Gets the video output pad with the decoded video frames.

public MediaBlockPad VideoOutput { get; }

Property Value

MediaBlockPad

Methods

Build()

Builds the composite block. In addition to the base no-op, this override registers the source -> decoder link with the pipeline, so both inner blocks are added even on consumption paths that would not otherwise touch them.

public override bool Build()

Returns

bool

true when build succeeds.

IsSubtitlesAvailable()

Whether this block exposes a subtitle output pad. A method rather than a property, mirroring VisioForge.Core.MediaBlocks.Sources.StreamSourceBlockWithDecoder.

public bool IsSubtitlesAvailable()

Returns

bool

true when renderSubtitle was enabled in the constructor.

See Also