Class LVCInput
- Assembly
- VisioForge.Core.dll
Base class for all Live Video Compositor input sources.
public class LVCInput : IDisposableInheritance
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
namestring-
A descriptive name for this input.
compositorLiveVideoCompositor-
The compositor this input belongs to. Can be
nullif adding later. mainBlockMediaBlock-
The source block that provides the media stream.
mediaTypeLVCMediaType-
The type of media this input provides (video, audio, or both).
autostartbool-
If
true, starts automatically when the compositor starts. processingBlockMediaBlock-
Optional processing block for applying effects. Default is
null. livebool-
If
true, indicates a live source requiring real-time processing. Default istrue.
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 _bridgeSinkBlockField Value
_compositor
Reference to the parent Live Video Compositor that manages this input.
protected LiveVideoCompositor _compositorField Value
_context
The execution context providing logging, error handling, and platform-specific services.
protected ContextX _contextField Value
- ContextX
_processingBlock
The processing block (optional).
protected MediaBlock _processingBlockField Value
disposedValue
The disposed value.
protected bool disposedValueField Value
Properties
AutoStart
Gets or sets a value indicating whether this input starts automatically with the main compositor.
public bool AutoStart { get; set; }Property Value
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
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
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
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
Name
Gets the descriptive name of this input.
public string Name { get; }Property Value
Pipeline
Gets the media processing pipeline for this input.
public MediaBlocksPipeline Pipeline { get; }Property Value
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
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
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
disposingbool-
trueto release both managed and unmanaged resources;falseto 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
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
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
preloadOnlybool-
If
true, only preloads the pipeline without starting playback. Default isfalse.
Returns
- Task<bool>
-
A Task<TResult> that completes with
trueif 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
trueif 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.