Class LVCVideoAudioInput
- Assembly
- VisioForge.Core.dll
Represents a combined video and audio input source for the Live Video Compositor.
public class LVCVideoAudioInput : LVCInput, IDisposableInheritance
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
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 both video and audio streams.
videoInfoVideoFrameInfoX-
The video frame information. Width, height, and frame rate are required. Can be
nullif video is disabled. audioInfoAudioInfoX-
The audio information. Format, channels, and sample rate are required. Can be
nullif audio is disabled. rectRect-
The position and size of the video component within the compositor output.
autostartbool-
If
true, the input will start automatically when the compositor starts. processingVideoBlockMediaBlock-
An optional processing block for the video stream. Default is
null. processingAudioBlockMediaBlock-
An optional processing block for the audio stream. Default is
null. livebool-
If
true, indicates this is a live source requiring real-time processing. Default istrue. customSyncFlagbool?-
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
namestring-
A descriptive name for this input.
mainBlockMediaBlock-
The source media block that provides both video and audio streams.
videoInfoVideoFrameInfoX-
The video frame information. Width, height, and frame rate are required. Can be
nullif video is disabled. audioInfoAudioInfoX-
The audio information. Format, channels, and sample rate are required. Can be
nullif audio is disabled. rectRect-
The position and size of the video component within the compositor output.
autostartbool-
If
true, the input will start automatically when added to a compositor. processingVideoBlockMediaBlock-
An optional processing block for the video stream. Default is
null. processingAudioBlockMediaBlock-
An optional processing block for the audio stream. Default is
null. livebool-
If
true, indicates this is a live source requiring real-time processing. Default istrue. customSyncFlagbool?-
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
ProcessingVideoBlocks
Gets the list of video processing blocks applied to the video stream.
public List<MediaBlock> ProcessingVideoBlocks { get; }Property Value
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
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
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
VideoView
Gets or sets an optional video view for previewing the video component of this input.
public IVideoView VideoView { get; set; }Property Value
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
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
disposingbool-
trueto release both managed and unmanaged resources;falseto 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
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.