Table of Contents

Class LVCInput

Namespace
VisioForge.Core.LiveVideoCompositorV2
Assembly
VisioForge.Core.dll

Base class for all Live Video Compositor input sources.

public class LVCInput : IDisposable

Inheritance

Derived

Implements

Inherited Members

Remarks

This abstract base class provides the common functionality for all input types in the Live Video Compositor. It manages the input pipeline, bridge connections, and lifecycle operations. Derived classes implement specific input types such as video-only, audio-only, or combined video/audio inputs. Each input maintains its own pipeline for processing before sending data to the main compositor.

Constructors

LVCInput(string, LiveVideoCompositor, MediaBlock, LVCMediaType, bool, MediaBlock, bool)

Initializes a new instance of the VisioForge.Core.LiveVideoCompositorV2.LVCInput class.

protected LVCInput(string name, LiveVideoCompositor compositor, MediaBlock mainBlock, LVCMediaType mediaType, bool autostart, MediaBlock processingBlock = null, bool live = true)

Parameters

name string

A descriptive name for this input.

compositor LiveVideoCompositor

The compositor this input belongs to. Can be null if adding later.

mainBlock MediaBlock

The source block that provides the media stream.

mediaType LVCMediaType

The type of media this input provides (video, audio, or both).

autostart bool

If true, starts automatically when the compositor starts.

processingBlock MediaBlock

Optional processing block for applying effects. Default is null.

live bool

If true, indicates a live source requiring real-time processing. Default is true.

Remarks

This protected constructor is called by derived classes to initialize the base input functionality. It creates a separate pipeline for this input and configures clock synchronization.

Fields

_bridgeSinkBlock

The bridge sink block.

protected MediaBlock _bridgeSinkBlock

Field Value

MediaBlock

_compositor

Reference to the parent Live Video Compositor that manages this input.

protected LiveVideoCompositor _compositor

Field Value

LiveVideoCompositor

_context

The execution context providing logging, error handling, and platform-specific services.

protected ContextX _context

Field Value

ContextX

_processingBlock

The processing block (optional).

protected MediaBlock _processingBlock

Field Value

MediaBlock

disposedValue

The disposed value.

protected bool disposedValue

Field Value

bool

Properties

AutoStart

Gets or sets a value indicating whether this input starts automatically with the main compositor.

public bool AutoStart { get; set; }

Property Value

bool

Remarks

When set to true, this input will begin processing as soon as the compositor starts. When false, the input must be started manually using StartAsync() or ResumeAsync().

ID

Gets the unique identifier for this input.

public Guid ID { get; }

Property Value

Guid

Remarks

This ID is generated automatically when the input is created and remains constant throughout the input's lifetime. Use this for reliable input identification.

IsSeekable

Gets a value indicating whether this input supports seeking operations.

public bool IsSeekable { get; }

Property Value

bool

Remarks

Seekability is determined by the main block type. File-based sources typically support seeking, while live sources (cameras, network streams) typically do not.

MainBlock

Gets or sets the main source block that provides media data for this input.

public MediaBlock MainBlock { get; }

Property Value

MediaBlock

Remarks

This is typically a source block such as UniversalSourceBlock, DecklinkVideoSourceBlock, or other media source implementations. The block type determines the input's capabilities and whether it supports seeking.

MediaType

Gets the type of media this input provides.

public LVCMediaType MediaType { get; }

Property Value

LVCMediaType

Name

Gets the descriptive name of this input.

public string Name { get; }

Property Value

string

Pipeline

Gets the media processing pipeline for this input.

public MediaBlocksPipeline Pipeline { get; }

Property Value

MediaBlocksPipeline

Remarks

Each input maintains its own pipeline separate from the main compositor pipeline. This allows independent control over playback state and processing.

UniqueName

Gets or sets the unique bridge identifier for the primary media stream.

public string UniqueName { get; set; }

Property Value

string

Remarks

This internal identifier is used by the bridge system to connect this input's pipeline to the main compositor pipeline. It is set automatically during the build process.

UniqueName2

Gets or sets the unique bridge identifier for the secondary media stream.

public string UniqueName2 { get; set; }

Property Value

string

Remarks

This internal identifier is used when an input provides both video and audio streams, requiring separate bridge connections. It is set automatically during the build process.

Methods

Dispose(bool)

Releases the unmanaged and optionally managed resources used by this input.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

This method disposes of the main block, pipeline, and bridge sink block if they exist. Derived classes should override this method to dispose of their specific resources, ensuring to call the base implementation.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting resources.

public void Dispose()

Remarks

Call this method when you are finished using the input. This method calls Dispose(true) and suppresses finalization to improve performance.

~LVCInput()

Finalizes an instance of the VisioForge.Core.LiveVideoCompositorV2.LVCInput class.

protected ~LVCInput()

Remarks

The finalizer calls Dispose(false) to release unmanaged resources. This ensures resources are cleaned up even if Dispose() is not called explicitly.

PauseAsync()

Pauses playback of this input.

public Task PauseAsync()

Returns

Task

A Task representing the asynchronous pause operation.

Remarks

The input can be resumed later using ResumeAsync(). The input maintains its current position and state while paused.

ResumeAsync()

Resumes playback of this input after it has been paused.

public virtual Task ResumeAsync()

Returns

Task

A Task representing the asynchronous resume operation.

Remarks

This virtual method can be overridden by derived classes to perform additional operations when resuming. The base implementation simply resumes the pipeline.

StartAsync(bool)

Starts this input's pipeline and begins processing media.

public Task<bool> StartAsync(bool preloadOnly = false)

Parameters

preloadOnly bool

If true, only preloads the pipeline without starting playback. Default is false.

Returns

Task<bool>

A Task<TResult> that completes with true if the start was successful; otherwise, false.

Remarks

For certain source types (UniversalSourceBlock, DecklinkVideoSourceBlock), this method waits for the pipeline to reach a ready state before returning. This ensures proper initialization of complex sources. The preloadOnly parameter is useful for preparing inputs without immediately starting playback.

StopAsync()

Stops this input's pipeline and releases processing resources.

public Task<bool> StopAsync()

Returns

Task<bool>

A Task<TResult> that completes with true if the stop was successful; otherwise, false.

Remarks

This method performs a forced stop of the pipeline to ensure quick shutdown. After stopping, the input would need to be restarted using StartAsync() to resume processing.

See Also