Class LVCVideoInput
- Assembly
- VisioForge.Core.dll
Represents a video-only input source for the Live Video Compositor.
public class LVCVideoInput : LVCInput, IDisposableInheritance
Implements
Inherited Members
Remarks
This class handles video input streams that will be composited into the final output. It supports various features including custom positioning, resize policies, optional preview rendering, and processing blocks for applying effects or transformations to the input video stream. Video inputs can be dynamically added, removed, and repositioned during playback.
Constructors
LVCVideoInput(string, LiveVideoCompositor, MediaBlock, VideoFrameInfoX, Rect, bool, MediaBlock)
Initializes a new instance of the VisioForge.Core.LiveVideoCompositorV2.LVCVideoInput class with a compositor reference.
public LVCVideoInput(string name, LiveVideoCompositor compositor, MediaBlock mainBlock, VideoFrameInfoX info, Rect rect, bool autostart, MediaBlock processingBlock = null)Parameters
namestring-
A descriptive name for this input.
compositorLiveVideoCompositor-
The VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor instance this input belongs to.
mainBlockMediaBlock-
The source media block that provides the video stream.
infoVideoFrameInfoX-
The video frame information. Width and height are required; the frame rate is a preference, and a source at another or a variable rate is accepted.
rectRect-
The position and size of this video within the compositor output.
autostartbool-
If
true, the input will start automatically when the compositor starts. processingBlockMediaBlock-
An optional processing block to apply effects or transformations. Default is
null. A non-null block is appended to VisioForge.Core.LiveVideoCompositorV2.LVCVideoInput.ProcessingVideoBlocks, so it runs between the source and the compositor, and is disposed together with this input.
Exceptions
- ArgumentOutOfRangeException
-
Thrown when
infoisnull.
LVCVideoInput(string, MediaBlock, VideoFrameInfoX, Rect, bool, MediaBlock)
Initializes a new instance of the VisioForge.Core.LiveVideoCompositorV2.LVCVideoInput class without a compositor reference.
public LVCVideoInput(string name, MediaBlock mainBlock, VideoFrameInfoX info, Rect rect, bool autostart, MediaBlock processingBlock = null)Parameters
namestring-
A descriptive name for this input.
mainBlockMediaBlock-
The source media block that provides the video stream.
infoVideoFrameInfoX-
The video frame information. Width and height are required; the frame rate is a preference, and a source at another or a variable rate is accepted.
rectRect-
The position and size of this video within the compositor output.
autostartbool-
If
true, the input will start automatically when added to a compositor. processingBlockMediaBlock-
An optional processing block to apply effects or transformations. Default is
null. A non-null block is appended to VisioForge.Core.LiveVideoCompositorV2.LVCVideoInput.ProcessingVideoBlocks, so it runs between the source and the compositor, and is disposed together with this input.
Remarks
This constructor is typically used when creating inputs that will be added to a compositor later.
Exceptions
- ArgumentOutOfRangeException
-
Thrown when
infoisnull.
Properties
Info
Gets the video frame information for this input.
public VideoFrameInfoX Info { get; }Property Value
ProcessingVideoBlocks
Gets the list of video processing blocks applied to this input.
public List<MediaBlock> ProcessingVideoBlocks { get; }Property Value
Remarks
Processing blocks are applied in the order they appear in the list, after the source block but before the video is sent to the compositor mixer. Common uses include color correction, deinterlacing, or other video filters.
Rectangle
Gets or sets the position and size of this video input within the compositor output.
public Rect Rectangle { get; set; }Property Value
Remarks
When ResizePolicy is set to LetterboxToFill, changing this property will automatically recalculate the crop area - which is the one thing the setter still does after the first build, and the mixer stream cannot. Under that policy, resize through this property as well as through the stream: a stream-only resize keeps the crop of the previous size and frames the picture wrongly.
This property seeds the input's layout for the FIRST build only. From then on the
compositor owns a VideoMixerStream for this input and carries it across a
stop/start cycle, so the mixer no longer reads this value: assigning it afterwards -
while running or while stopped - does not move the input. Read that stream with
Input_VideoStream_Get and mutate it instead;
Input_VideoStream_Update pushes the change to a running mixer, and while stopped
the mutation alone is enough - the next start builds from it.
ResizePolicy
Gets or sets the resize policy for this video input.
public LVCResizePolicy ResizePolicy { get; set; }Property Value
Remarks
The resize policy controls how the input video is fitted into its designated rectangle, affecting whether aspect ratio is preserved and how empty space or overflow is handled.
This property seeds the input's layout for the FIRST build only. From then on the
compositor owns a VideoMixerStream for this input and carries it across a
stop/start cycle, so the mixer no longer reads this value: assigning it afterwards -
while running or while stopped - does not move the input. Read that stream - its
KeepAspectRatio is what this maps to - with Input_VideoStream_Get and mutate
it instead;
Input_VideoStream_Update pushes the change to a running mixer, and while stopped
the mutation alone is enough - the next start builds from it.
VideoView
Gets or sets an optional video view for previewing this input.
public IVideoView VideoView { get; set; }Property Value
Remarks
When set, the input video will be duplicated and rendered to this view in addition to being sent to the compositor. This is useful for monitoring individual inputs. The preview uses a tee element to split the video stream without affecting the main composition.
ZOrder
Gets or sets the z-order (layer position) of this video input.
public uint ZOrder { get; set; }Property Value
Remarks
Z-order determines the stacking order when multiple video inputs overlap. Inputs with higher z-order values will be rendered on top of those with lower values.
This property seeds the input's layout for the FIRST build only. From then on the
compositor owns a VideoMixerStream for this input and carries it across a
stop/start cycle, so the mixer no longer reads this value: assigning it afterwards -
while running or while stopped - does not move the input. Read that stream with
Input_VideoStream_Get and mutate it instead;
Input_VideoStream_Update pushes the change to a running mixer, and while stopped
the mutation alone is enough - the next start builds from it.
Methods
Dispose(bool)
Releases the unmanaged and optionally managed resources used by this video input.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
Remarks
This method properly disposes of the video tee and renderer components if they were created, then calls the base class disposal logic. This method is called by the public Dispose method and the finalizer.
ToString()
Returns a string representation of this video input.
public override string ToString()Returns
- string
-
A string containing the input name and its rectangle dimensions in the format "Name (Rectangle)".