Table of Contents

Class LVCVideoAudioInput

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

Represents a combined video and audio input source for the Live Video Compositor.

public class LVCVideoAudioInput : LVCInput, IDisposable

Inheritance

Implements

Inherited Members

Remarks

This class handles input streams that contain both video and audio components. It provides separate processing pipelines for video and audio, allowing independent effects and transformations on each stream while maintaining synchronization. Like video-only inputs, it supports positioning, resize policies, and preview rendering.

Constructors

LVCVideoAudioInput(string, LiveVideoCompositor, MediaBlock, VideoFrameInfoX, AudioInfoX, Rect, bool, MediaBlock, MediaBlock, bool, bool?)

Initializes a new instance of the VisioForge.Core.LiveVideoCompositorV2.LVCVideoAudioInput class with a compositor reference.

public LVCVideoAudioInput(string name, LiveVideoCompositor compositor, MediaBlock mainBlock, VideoFrameInfoX videoInfo, AudioInfoX audioInfo, Rect rect, bool autostart, MediaBlock processingVideoBlock = null, MediaBlock processingAudioBlock = null, bool live = true, bool? customSyncFlag = null)

Parameters

name string

A descriptive name for this input.

compositor LiveVideoCompositor

The VisioForge.Core.LiveVideoCompositorV2.LiveVideoCompositor instance this input belongs to.

mainBlock MediaBlock

The source media block that provides both video and audio streams.

videoInfo VideoFrameInfoX

The video frame information. Width, height, and frame rate are required. Can be null if video is disabled.

audioInfo AudioInfoX

The audio information. Format, channels, and sample rate are required. Can be null if audio is disabled.

rect Rect

The position and size of the video component within the compositor output.

autostart bool

If true, the input will start automatically when the compositor starts.

processingVideoBlock MediaBlock

An optional processing block for the video stream. Default is null.

processingAudioBlock MediaBlock

An optional processing block for the audio stream. Default is null.

live bool

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

customSyncFlag bool?

Optional custom synchronization flag for advanced timing control. Default is null.

LVCVideoAudioInput(string, MediaBlock, VideoFrameInfoX, AudioInfoX, Rect, bool, MediaBlock, MediaBlock, bool, bool?)

Initializes a new instance of the VisioForge.Core.LiveVideoCompositorV2.LVCVideoAudioInput class without a compositor reference.

public LVCVideoAudioInput(string name, MediaBlock mainBlock, VideoFrameInfoX videoInfo, AudioInfoX audioInfo, Rect rect, bool autostart, MediaBlock processingVideoBlock = null, MediaBlock processingAudioBlock = null, bool live = true, bool? customSyncFlag = null)

Parameters

name string

A descriptive name for this input.

mainBlock MediaBlock

The source media block that provides both video and audio streams.

videoInfo VideoFrameInfoX

The video frame information. Width, height, and frame rate are required. Can be null if video is disabled.

audioInfo AudioInfoX

The audio information. Format, channels, and sample rate are required. Can be null if audio is disabled.

rect Rect

The position and size of the video component within the compositor output.

autostart bool

If true, the input will start automatically when added to a compositor.

processingVideoBlock MediaBlock

An optional processing block for the video stream. Default is null.

processingAudioBlock MediaBlock

An optional processing block for the audio stream. Default is null.

live bool

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

customSyncFlag bool?

Optional custom synchronization flag for advanced timing control. Default is null.

Remarks

This constructor is typically used when creating inputs that will be added to a compositor later.

Properties

AudioInfo

Gets the audio stream information for this input.

public AudioInfoX AudioInfo { get; }

Property Value

AudioInfoX

ProcessingVideoBlocks

Gets the list of video processing blocks applied to the video stream.

public List<MediaBlock> ProcessingVideoBlocks { get; }

Property Value

List<MediaBlock>

Remarks

Video processing blocks are applied after the source but before the video is sent to the compositor. These blocks operate independently of any audio processing blocks. Common uses include color correction, deinterlacing, or other video filters.

Rectangle

Gets or sets the position and size of the video component within the compositor output.

public Rect Rectangle { get; set; }

Property Value

Rect

Remarks

Changes to this property after playback has started will not take effect automatically. To update the rectangle during playback, use the compositor's Input_VideoStream_Update method. When ResizePolicy is set to LetterboxToFill, changing this property will automatically recalculate the crop area. This property only affects the video component; audio is not affected.

ResizePolicy

Gets or sets the resize policy for the video component.

public LVCResizePolicy ResizePolicy { get; set; }

Property Value

LVCResizePolicy

Remarks

The resize policy controls how the input video is fitted into its designated rectangle. This property only affects the video component; audio is processed independently.

VideoInfo

Gets the video stream information for this input.

public VideoFrameInfoX VideoInfo { get; }

Property Value

VideoFrameInfoX

VideoView

Gets or sets an optional video view for previewing the video component of this input.

public IVideoView VideoView { get; set; }

Property Value

IVideoView

Remarks

When set, only the video component will be rendered to this view. Audio continues to be processed normally but is not affected by the preview setting.

ZOrder

Gets or sets the z-order (layer position) of the video component.

public uint ZOrder { get; set; }

Property Value

uint

Remarks

Z-order determines the stacking order when multiple video inputs overlap. This property only affects the video component; audio mixing is independent of z-order.

Methods

Dispose(bool)

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

protected override void Dispose(bool disposing)

Parameters

disposing bool

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

Remarks

This method properly disposes of both video and audio bridge sinks, as well as any preview components that were created. It ensures all resources are cleaned up in the correct order before calling the base class disposal logic.

ResumeAsync()

Resumes playback of this input after it has been paused.

public override Task ResumeAsync()

Returns

Task

A Task representing the asynchronous operation.

Remarks

This override ensures that the video stream's alpha channel is restored to full opacity when resuming, in case it was set to zero during initialization. This is particularly important for inputs that were added while the compositor was already running.

See Also