Table of Contents

Class VirtualCameraCustomStreamer

Namespace
VisioForge.Core
Assembly
VisioForge.Core.dll

Provides functionality to stream custom video frames to a VisioForge virtual camera device. This class creates a DirectShow filter graph that captures frames from a queue and outputs them to a virtual camera sink.

public class VirtualCameraCustomStreamer : IDisposable

Inheritance

Implements

Inherited Members

Remarks

The streamer uses a fake screen capture source combined with a sample grabber to intercept and replace frames with custom video data provided through VisioForge.Core.VirtualCameraCustomStreamer.WriteVideoFrame(VisioForge.Core.Types.VideoFrame). Frames are automatically resized and color space converted as needed.

Constructors

VirtualCameraCustomStreamer(DSContext, int, int, VideoFrameRate, RAWVideoColorSpace)

Initializes a new instance of the VisioForge.Core.VirtualCameraCustomStreamer class. Creates and configures a DirectShow filter graph for streaming custom video frames to a virtual camera.

public VirtualCameraCustomStreamer(DSContext context, int width, int height, VideoFrameRate fps, RAWVideoColorSpace colorspace = RAWVideoColorSpace.RGB)

Parameters

context DSContext

The DirectShow context for logging and error handling. If null, a new context is created.

width int

The width of the video frames in pixels.

height int

The height of the video frames in pixels.

fps VideoFrameRate

The frame rate for the video stream.

colorspace RAWVideoColorSpace

The color space of the input video frames. Default is RGB.

Methods

Dispose(bool)

Releases the unmanaged resources used by the VisioForge.Core.VirtualCameraCustomStreamer and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

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

Dispose()

Releases all resources used by the VisioForge.Core.VirtualCameraCustomStreamer.

public void Dispose()

~VirtualCameraCustomStreamer()

Finalizes an instance of the VisioForge.Core.VirtualCameraCustomStreamer class. Releases unmanaged resources and performs cleanup operations.

protected ~VirtualCameraCustomStreamer()

WriteVideoFrame(VideoFrame)

Writes a video frame to the virtual camera stream. The frame is added to an internal queue and will be processed on the next sample grabber callback.

public void WriteVideoFrame(VideoFrame frame)

Parameters

frame VideoFrame

The video frame to stream. The frame is cloned internally, so the caller retains ownership of the original.

Remarks

The queue is limited to 5 frames. If the queue is full, the oldest frame is automatically discarded. Frames are automatically resized and color-converted to match the output format if needed.